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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content h1 {
    color: #4a5568;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.header-content h1 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.header-content p {
    color: #718096;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Video Section */
.video-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

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

.video-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
}

.video-header h2 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.video-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.video-selector {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
    background: white;
}

.video-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #2d3748;
    color: #a0aec0;
}

.video-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.video-placeholder p {
    font-size: 1.2rem;
    opacity: 0.7;
}

.video-info {
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.video-info h3 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.video-metadata {
    display: flex;
    gap: 2rem;
    color: #718096;
    font-size: 0.9rem;
}

.video-metadata span i {
    margin-right: 0.5rem;
}

/* Q&A Section */
.qna-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
}

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

.qna-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
}

.qna-header h2 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.qna-stats {
    color: #718096;
    font-size: 0.9rem;
}

/* Question Input */
.question-input-container {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.question-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

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

.input-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.suggestion-label {
    color: #718096;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.suggestion-btn {
    padding: 0.3rem 0.8rem;
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.welcome-message {
    text-align: center;
    padding: 2rem;
    color: #4a5568;
}

.welcome-message i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.welcome-message h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.welcome-message p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.example-questions {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.example-questions h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.example-questions ul {
    list-style: none;
    padding-left: 0;
}

.example-questions li {
    padding: 0.3rem 0;
    color: #718096;
    font-style: italic;
}

.example-questions li:before {
    content: "💬 ";
    margin-right: 0.5rem;
}

/* Chat Messages */
.message {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-in;
}

.message-user {
    text-align: right;
}

.message-bot {
    text-align: left;
}

.message-content {
    display: inline-block;
    max-width: 80%;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    line-height: 1.5;
}

.message-user .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bot .message-content {
    background: white;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Context and Translation Indicators */
.context-indicator {
    background: #e6fffa;
    border-left: 4px solid #38b2ac;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #2c7a7b;
    border-radius: 4px;
}

.translation-indicator {
    background: #fef5e7;
    border-left: 4px solid #ed8936;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #c05621;
    border-radius: 4px;
}

.message-timestamp {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 0.5rem;
}

/* Timestamp Links */
.timestamp-link {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0.2rem;
    transition: all 0.2s;
    cursor: pointer;
}

.timestamp-link:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.timestamp-link i {
    margin-right: 0.3rem;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: #718096;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.app-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .qna-section {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .video-header,
    .qna-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .video-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .video-selector {
        flex: 1;
        min-width: auto;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .question-input {
        margin-bottom: 0.5rem;
    }
}

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

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}