/* CSS Variables */
:root {
    --primary-color: #dc2626;
    --secondary-color: #ea580c;
    --accent-color: #059669;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-muted: #6b7280;
}

/* Global 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, #dc2626 0%, #ea580c 100%);
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.6;
    overflow: hidden;
}

/* Navigation */
.navbar {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: white !important;
}

/* Main Demo Section */
.main-demo-section {
    height: 100vh;
    padding-top: 80px;
    background: var(--light-color);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(234, 88, 12, 0.1) 0%, transparent 50%);
    max-width: 600px;
    width: 100%;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.1);
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* YouTube Input */
.youtube-input {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.youtube-input h5 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

/* Media Player */
.media-player {
    background: var(--dark-color);
    border-radius: 12px;
    padding: 1rem;
    overflow: hidden;
}

.media-player video,
.media-player audio {
    border-radius: 8px;
    background: black;
}

/* Analysis Status */
.analysis-status {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
}

/* Question Section */
.question-section {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.question-section h5 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.suggested-questions h6 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.question-chips .btn {
    border-radius: 20px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.question-chips .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Chat History */
.chat-history {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.chat-message {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease-out;
}

.message-user {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.message-ai {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
}

.message-bubble {
    max-width: 80%;
    padding: 1rem;
    border-radius: 12px;
    position: relative;
    word-wrap: break-word;
}

.message-bubble.user {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.ai {
    background: white;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* Message Components */
.message-timestamp {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    margin: 0 0.5rem;
}

.avatar-user {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.avatar-ai {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--success-color) 100%);
    color: white;
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer h5 {
    color: white;
    margin-bottom: 1rem;
}

.footer p {
    opacity: 0.8;
    margin-bottom: 0;
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-demo-section {
        height: auto;
        min-height: 100vh;
    }
    
    .upload-area {
        padding: 2rem 1rem;
        margin: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .question-chips .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Mobile layout adjustments */
    .analysis-interface {
        height: auto;
        min-height: 100vh;
    }
    
    .media-section,
    .qa-section {
        min-height: 400px;
        margin-bottom: 1rem;
    }
    
    .chat-history {
        max-height: 300px;
    }
    
    .message-bubble {
        max-width: 90%;
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 100px 0 60px;
    }
    
    .features-section,
    .demo-section {
        padding: 60px 0;
    }
    
    .message-bubble {
        max-width: 90%;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-lg {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.rounded-xl {
    border-radius: 12px;
}

/* Scrollbar Styling */
.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
} 

/* Analysis Summary */
.analysis-summary {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.analysis-summary .card {
    border: none;
    border-radius: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.analysis-summary .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    padding: 1rem;
    flex-shrink: 0;
}

.analysis-summary .card-header h6 {
    font-weight: 600;
    margin: 0;
}

.analysis-summary .card-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    line-height: 1.6;
}

.analysis-summary .card-body::-webkit-scrollbar {
    width: 6px;
}

.analysis-summary .card-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.analysis-summary .card-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.analysis-summary .card-body::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
} 

/* Analysis Interface - Left/Right Layout */
.analysis-interface {
    height: 100%;
}

.media-section,
.qa-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.section-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* Media Section */
.media-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.media-player {
    flex: 0 0 auto;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.analysis-summary {
    flex: 1;
    min-height: 0;
}

/* Q&A Section */
.qa-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.question-section {
    flex-shrink: 0;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-height: 0;
    max-height: 100%;
    height: 0; /* This forces the flex item to take remaining space */
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Enhanced Message Styling */
.chat-message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

/* User message alignment (right) */
.message-user {
    flex-direction: row-reverse;
    justify-content: flex-end;
    text-align: right;
}

.message-bubble.user {
    margin-left: auto;
    margin-right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 12px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* AI message alignment (left) */
.message-ai {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
}

.message-bubble.ai {
    margin-right: auto;
    margin-left: 0;
}

.message-bubble {
    max-width: 85%;
    padding: 1rem;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-bubble.user {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.ai {
    background: white;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Enhanced AI Response Formatting */
.message-bubble.ai {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.message-bubble.ai strong {
    color: var(--primary-color);
    font-weight: 600;
}

.message-bubble.ai em {
    color: var(--secondary-color);
    font-style: italic;
}

/* Frame Analysis Formatting */
.frame-analysis {
    background: rgba(220, 38, 38, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.frame-timestamp {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.frame-content {
    color: var(--dark-color);
    line-height: 1.6;
}

/* Summary Formatting */
.summary-section {
    background: rgba(5, 150, 105, 0.05);
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.summary-title {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
} 