/* AI Video Detective - Professional ChatGPT-style Design */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* Floating Cleanup Button */
.floating-cleanup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.cleanup-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cleanup-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #374151;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Upload Section */
.upload-section {
    padding: 0 2rem;
    margin-bottom: 2rem;
}

.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.upload-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
}

.upload-description {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.feature-item i {
    color: #10b981;
    font-size: 1rem;
}

.file-requirements {
    margin-bottom: 2rem;
}

.file-requirements p {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Upload Buttons Layout */
.upload-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.upload-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.upload-btn.primary:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.upload-btn.secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.upload-btn.secondary:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}



.upload-divider {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 300px;
    margin: 0.5rem 0;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #d1d5db;
}

.upload-divider span {
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    background: #ffffff;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1.5rem;
}

.progress-container {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: #6b7280;
    font-weight: 500;
}

/* File Info */
.file-info {
    margin-top: 1.5rem;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.file-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.file-size {
    color: #6b7280;
    font-size: 0.875rem;
}

.file-remove {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Video Preview */
.video-preview {
    margin-top: 1.5rem;
}

.preview-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.preview-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.preview-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.preview-header p {
    color: #6b7280;
    font-size: 0.875rem;
}

.video-container {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #000;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: contain;
}

.preview-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.preview-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 160px;
    justify-content: center;
}

.preview-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.preview-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.preview-btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.preview-btn.secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Chat Interface */
.chat-interface {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.chat-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
}

.chat-message {
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.user-message {
    flex-direction: row-reverse;
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 80%;
}

.user-message .message-content {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-message .message-avatar {
    background: #1a1a1a;
    color: white;
}

.message-text {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 16px;
    color: #1a1a1a;
    line-height: 1.7;
    white-space: pre-wrap;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.user-message .message-text {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

/* Enhanced AI Response Styling */
.ai-message .message-text {
    background: #ffffff;
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ai-message .message-text h2,
.ai-message .message-text h3,
.ai-message .message-text h4 {
    margin: 15px 0 8px 0;
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.3;
}

.ai-message .message-text h2 {
    font-size: 1.2rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.ai-message .message-text h3 {
    font-size: 1.1rem;
    color: #374151;
}

.ai-message .message-text h4 {
    font-size: 1rem;
    color: #6b7280;
}

.ai-message .message-text strong {
    color: #1a1a1a;
    font-weight: 700;
}

.ai-message .message-text em {
    color: #374151;
    font-style: italic;
}

.ai-message .message-text ul {
    margin: 12px 0;
    padding-left: 24px;
}

.ai-message .message-text li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.ai-message .message-text span[style*="background: #f0f0f0"] {
    background: #f3f4f6 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace !important;
    font-weight: 600 !important;
    color: #374151 !important;
    border: 1px solid #e5e7eb !important;
    font-size: 0.85rem !important;
}

/* Typing Indicator */
.typing-indicator {
    padding: 1rem 2rem;
    margin-bottom: 1rem;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.typing-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 2rem;
    background: #ffffff;
}

.chat-input-wrapper {
    max-width: 100%;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: #1a1a1a;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: #9ca3af;
}

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-footer {
    margin-top: 0.75rem;
    text-align: center;
}

.input-hint {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Loading Modal */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.loading-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-spinner {
    margin-bottom: 2rem;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.loading-text p {
    color: #6b7280;
    margin-bottom: 2rem;
}

.loading-steps {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.step.active {
    color: #667eea;
}

.step i {
    font-size: 1.25rem;
}

/* Evidence Modal */
.evidence-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.evidence-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.evidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.evidence-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.close-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.evidence-body {
    padding: 2rem;
    text-align: center;
}

.evidence-body img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.evidence-info {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Evidence Display in Chat */
.screenshot-evidence {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.screenshot-evidence h4 {
    margin-bottom: 1rem;
    color: #1a1a1a;
    font-size: 1.1rem;
    font-weight: 600;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.evidence-item {
    text-align: center;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.evidence-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.evidence-item img,
.evidence-item video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.evidence-item .timestamp {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0% { 
        opacity: 0.7; 
        transform: translateY(5px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Enhanced Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    border: 2px solid #f8f9fa;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .floating-cleanup {
        top: 10px;
        right: 10px;
    }
    
    .cleanup-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .upload-section,
    .chat-interface {
        padding: 0 1rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-features {
        flex-direction: column;
        gap: 1rem;
    }
    
    .upload-buttons {
        gap: 0.75rem;
    }
    
    .upload-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .upload-buttons {
        gap: 0.75rem;
    }
    
    .preview-container {
        padding: 1.5rem;
    }
    
    .video-container video {
        max-height: 300px;
    }
    
    .preview-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .preview-btn {
        width: 100%;
        min-width: auto;
    }
    
    .chat-interface {
        height: 100vh;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .loading-content {
        padding: 2rem 1.5rem;
    }
    
    .loading-steps {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 1rem 0;
    }
    
    .upload-section,
    .chat-interface {
        padding: 0 0.5rem;
    }
    
    .upload-area {
        padding: 1.5rem 0.75rem;
    }
    
    .upload-buttons {
        gap: 0.5rem;
    }
    
    .upload-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .upload-divider {
        max-width: 250px;
    }
    
    .upload-buttons {
        gap: 0.5rem;
    }
    
    .preview-container {
        padding: 1rem;
    }
    
    .video-container video {
        max-height: 250px;
    }
    
    .preview-header h3 {
        font-size: 1.125rem;
    }
    
    .message-content {
        max-width: 95%;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .input-container {
        padding: 0.75rem;
    }
} 