﻿/* ============================================
   LCI - Speech to Text
   Complete Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #0066B3;
    --primary-dark: #004C8C;
    --primary-light: #e6f2ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

[hidden] {
    display: none !important;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Admin Styles */
.admin-sidebar {
    width: 250px;
    background-color: var(--dark-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.code-editor {
    width: 100%;
    height: 300px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

.code-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 179, 0.25);
}

/* ===== HEADER ===== */
.header {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: white;
    color: var(--primary-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.logo-icon.small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.logo-sub {
    font-size: 11px;
    opacity: 0.9;
}

.nav {
    display: flex;
    gap: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
}

.gradient-text {
    color: white;
}

.subtitle {
    display: block;
    font-size: 24px;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 8px;
}

.hero-desc {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
    text-transform: uppercase;
}

/* ===== SECTION ===== */
.section {
    padding: 60px 0;
}

.section-alt {
    background-color: white;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 16px;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 2px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border: none;
    background-color: transparent;
    color: #94a3b8;
    font-weight: 500;
    font-size: 11px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.25s ease;
    white-space: nowrap;
    min-width: 64px;
    position: relative;
}

.tab-btn i {
    font-size: 18px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.tab-btn:hover i {
    transform: scale(1.1);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 179, 0.3);
    transform: translateY(-1px);
}

.tab-btn.active i {
    transform: scale(1.05);
}

.tab-panel {
    display: none;
    padding: 30px;
}

.tab-panel.active {
    display: block;
}

/* ===== CARDS & CONTAINERS ===== */
.transcribe-container,
.tts-container,
.voice-sample-container,
.api-docs-container {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tts-container,
.api-docs-container {
    padding: 30px;
}

.voice-sample-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.model-selection-bar {
    padding: 15px 30px;
    background-color: var(--primary-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.row-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0 !important;
}

.row-group label {
    margin-bottom: 0 !important;
    white-space: nowrap;
}

.form-select-sm {
    width: auto !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.model-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.model-status.ready {
    background-color: #d4edda;
    color: #155724;
}

.model-status.loading {
    background-color: #fff3cd;
    color: #856404;
}

.model-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.sample-form-card,
.sample-list-card,
.tts-form-card,
.tts-result-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.sample-form-card h3,
.sample-list-card h3,
.tts-result-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 18px;
}

.sample-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sample-list-header h3 {
    margin-bottom: 0;
}

/* ===== RECORD AREA ===== */
.record-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.waveform {
    width: 100%;
    max-width: 400px;
    height: 60px;
    margin-bottom: 20px;
}

.waveform-bars {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 4px;
}

.waveform-bars span {
    width: 4px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 2px;
    opacity: 0.3;
}

.waveform-bars.small span {
    width: 3px;
    height: 15px;
}

.record-timer,
.sample-timer {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    font-family: 'Consolas', monospace;
    margin-bottom: 20px;
}

.record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.record-btn span {
    font-size: 10px;
    font-weight: 600;
}

.record-btn:hover {
    transform: scale(1.05);
}

.record-btn.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.record-hint {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Live Area */
.live-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 8px 16px;
    background-color: var(--light-color);
    border-radius: 30px;
    font-weight: 600;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: var(--secondary-color);
    border-radius: 50%;
}

.recording .status-indicator {
    background-color: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* YouTube Area */
.youtube-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
}

.youtube-icon {
    font-size: 60px;
    color: #FF0000;
    margin-bottom: 20px;
}

.youtube-area .form-group {
    width: 100%;
    max-width: 600px;
}

.youtube-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Sample Record */
.sample-record-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.sample-waveform {
    width: 100%;
    height: 40px;
    margin-bottom: 10px;
}

.sample-record-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sample-record-btn.recording {
    animation: pulse 1.5s infinite;
}

/* ===== UPLOAD AREA ===== */
.upload-area,
.sample-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--light-color);
}

.upload-area:hover,
.sample-upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.upload-icon,
.sample-upload-area i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.upload-text {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 5px;
}

.upload-hint,
.upload-formats {
    font-size: 13px;
    color: var(--text-muted);
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background-color: var(--primary-light);
    border-radius: var(--radius);
    margin-top: 15px;
}

.selected-file i {
    color: var(--primary-color);
    font-size: 20px;
}

.selected-file span {
    flex: 1;
    font-weight: 500;
}

.remove-file {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-control,
input[type="text"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    background-color: white;
    color: var(--text-color);
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Sample Input Tabs */
.sample-input-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.sample-input-tab {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sample-input-tab:hover {
    border-color: var(--primary-color);
}

.sample-input-tab.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sample-panel {
    display: none;
}

.sample-panel.active {
    display: block;
}

/* ===== BUTTONS ===== */
.transcribe-btn,
.generate-btn,
.submit-btn {
    width: 100%;
    padding: 15px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-top: 10px;
}

.transcribe-btn:hover,
.generate-btn:hover,
.submit-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.transcribe-btn:disabled,
.generate-btn:disabled,
.submit-btn:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
    transition: color 0.2s;
}

.refresh-btn:hover {
    color: var(--primary-color);
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--primary-color);
}

/* ===== RESULT AREA ===== */
.result-area,
.tts-result-card {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background-color: #fdfdfd;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--primary-color);
}

.result-actions {
    display: flex;
    gap: 5px;
}

.result-content {
    padding: 20px;
}

.result-text {
    font-size: 16px;
    line-height: 1.8;
    min-height: 80px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    padding: 20px;
    background-color: #f8fbff;
    border: 1px solid #e1eaf5;
    border-radius: 8px;
    color: #2c3e50;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.result-meta {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* TTS Result */
.tts-audio-player {
    margin: 20px 0;
}

.tts-audio-player audio {
    width: 100%;
    margin-bottom: 15px;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background-color 0.2s;
}

.download-link:hover {
    background-color: var(--primary-dark);
}

.tts-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== SAMPLE LIST ===== */
.sample-list {
    max-height: 400px;
    overflow-y: auto;
}

.sample-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.sample-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.sample-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.sample-item:last-child {
    border-bottom: none;
}

.sample-item:hover {
    background-color: var(--light-color);
}

.sample-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.sample-info {
    flex: 1;
}

.sample-name {
    font-weight: 600;
    color: var(--text-color);
}

.sample-meta-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== YOUTUBE LIBRARY ===== */
.youtube-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #fff8f0;
    border-radius: var(--radius);
    margin-bottom: 15px;
    border: 1px solid #ffe0b2;
}

.library-stats {
    font-size: 14px;
    color: #e65100;
    font-weight: 500;
}

.youtube-library-list {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yt-library-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.yt-library-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.yt-item-icon {
    width: 45px;
    height: 45px;
    background: #ffebee;
    color: #c62828;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
}

.yt-item-info {
    flex: 1;
}

.yt-item-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

.yt-item-actions {
    display: flex;
    gap: 8px;
}

.btn-sm-icon {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

.sample-actions {
    display: flex;
    gap: 5px;
}

.sample-actions button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.sample-actions button:hover {
    color: var(--primary-color);
}

.sample-actions .delete-sample:hover {
    color: var(--danger-color);
}

/* ===== API DOCS ===== */
.api-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.api-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.api-method {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.api-method.post {
    background-color: #d4edda;
    color: #155724;
}

.api-method.get {
    background-color: #cce5ff;
    color: #004085;
}

.api-method.delete {
    background-color: #f8d7da;
    color: #721c24;
}

.api-endpoint {
    font-family: 'Consolas', monospace;
    font-size: 14px;
    color: var(--text-color);
}

.api-desc {
    padding: 15px 20px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.api-details {
    padding: 20px;
}

.api-details h4 {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 10px;
    margin-top: 15px;
}

.api-details h4:first-child {
    margin-top: 0;
}

.api-details pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 13px;
}

.api-details code {
    font-family: 'Consolas', monospace;
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--dark-color);
    color: #adb5bd;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-brand .logo {
    margin-bottom: 15px;
}

.footer-brand p {
    font-size: 14px;
}

.footer-links h4,
.footer-contact h4 {
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
}

.footer-links a {
    display: block;
    color: #adb5bd;
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    font-size: 13px;
}

/* ===== LOADING ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    color: var(--text-muted);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast i {
    font-size: 20px;
}

.toast.success i {
    color: var(--success-color);
}

.toast.error i {
    color: var(--danger-color);
}

.toast.warning i {
    color: var(--warning-color);
}

/* AI Assistant Styles */
.ai-assistant-area {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px dashed var(--border-color);
}

.ai-header {
    margin-bottom: 20px;
}

.ai-header h3 {
    color: var(--primary-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.ai-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.ai-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.2);
}

.ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.3);
}

.ai-btn i {
    font-size: 16px;
}

.ai-result-card {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

.ai-result-header {
    background: #f8f9fa;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #444;
}

.ai-result-tools {
    display: flex;
    gap: 10px;
}

.ai-result-body {
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(118, 75, 162, 0.1);
    border-left-color: #764ba2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Button Variants */
.ai-btn-sentiment {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.2) !important;
}

.ai-btn-sentiment:hover {
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.3) !important;
}

.ai-btn-translate {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.2) !important;
}

.ai-btn-translate:hover {
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.3) !important;
}

.ai-btn-meeting {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2) !important;
}

.ai-btn-meeting:hover {
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.3) !important;
}

.ai-translate-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-lang-select {
    padding: 8px 12px;
    border: 2px solid #f093fb;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: white;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.ai-lang-select:hover {
    border-color: #f5576c;
}

.ai-lang-select:focus {
    border-color: #f5576c;
    box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.1);
}

/* Document Upload Specifics */
#document-panel .upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

#document-panel .upload-area:hover,
#document-panel .upload-area.dragover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

#document-panel .upload-icon {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 15px;
    opacity: 0.8;
}

#document-panel .selected-file {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeIn 0.3s ease;
}

#document-panel .file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#document-panel .file-icon {
    font-size: 1.5rem;
    color: #2ecc71;
}

#document-panel .file-name {
    font-weight: 500;
    color: white;
}

#document-panel .upload-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .voice-sample-container {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-stats {
        gap: 30px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group.half {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-contact p {
        justify-content: center;
    }
}

/* AI Assistant Buttons */
.ai-actions .btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-actions .btn-primary {
    background: #0066B3;
    color: white;
}

.ai-actions .btn-primary:hover {
    background: #004C8C;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 179, 0.3);
}

.ai-actions .btn-warning {
    background: #f39c12;
    color: #fff;
}

.ai-actions .btn-warning:hover {
    background: #d68910;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.ai-actions .btn-success {
    background: #27ae60;
    color: white;
}

.ai-actions .btn-success:hover {
    background: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.ai-actions .ai-action-btn {
    background: #e0e0e0;
    color: #333;
}

.ai-actions .ai-action-btn:hover {
    background: #c0c0c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ai-actions #ai-target-lang {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    font-weight: 500;
    outline: none;
}

/* ===== PROCESSING OVERLAY & PROGRESS BAR ===== */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.processing-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.processing-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.processing-status {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.progress-container {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #4facfe);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== PROCESSING STATS IN RESULTS ===== */
.processing-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 10px;
    border: 1px dashed var(--primary-light);
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #4a5568;
    background: white;
    padding: 4px 12px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.stat-chip i {
    color: var(--primary-color);
    font-size: 10px;
}

.stat-chip.time {
    background: #e6fffa;
    color: #2c7a7b;
    border-color: #b2f5ea;
    font-weight: 600;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ===== PROCESSING OVERLAY & PROGRESS BAR ===== */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.processing-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.processing-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.processing-status {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.progress-container {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #4facfe);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== PROCESSING STATS IN RESULTS ===== */
.processing-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 10px;
    border: 1px dashed var(--primary-light);
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #4a5568;
    background: white;
    padding: 4px 12px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.stat-chip i {
    color: var(--primary-color);
    font-size: 10px;
}

.stat-chip.time {
    background: #e6fffa;
    color: #2c7a7b;
    border-color: #b2f5ea;
    font-weight: 600;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ===== TRANSLATION TAB ===== */
.translate-input-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.translate-toolbar {
    margin-bottom: 15px;
}

.lang-selectors {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lang-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4a5568;
    white-space: nowrap;
}

.lang-group select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    background: #f8fafc;
    transition: border-color 0.3s;
    min-width: 160px;
}

.lang-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.swap-lang-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary-color);
    transition: all 0.3s;
}

.swap-lang-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: rotate(180deg);
}

.translate-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 150px;
    font-family: inherit;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.translate-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.translate-sources {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.source-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #4a5568;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.source-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.char-count {
    margin-left: auto;
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.translate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.translate-result {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.translate-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.translate-result-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1a237e;
}

.translate-result-actions {
    display: flex;
    gap: 8px;
}

.bilingual-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bilingual-col {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

.bilingual-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.bilingual-text {
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    color: #333;
    max-height: 500px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .bilingual-display {
        grid-template-columns: 1fr;
    }

    .lang-selectors {
        flex-direction: column;
        align-items: stretch;
    }

    .swap-lang-btn {
        align-self: center;
        transform: rotate(90deg);
    }

    .swap-lang-btn:hover {
        transform: rotate(270deg);
    }
}

/* ==================== Chat AI UI ==================== */
.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15);
    max-width: 1200px;
    margin: 0 auto;
    min-height: 650px;
}

/* Chat Sidebar */
.chat-sidebar {
    background: #1e293b;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.chat-sessions {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-session-item {
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-session-item:hover,
.chat-session-item.active {
    background: rgba(255,255,255,0.1);
}

.chat-session-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.chat-session-open {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.chat-session-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.chat-session-item:hover .chat-session-actions,
.chat-session-item.active .chat-session-actions {
    opacity: 1;
}

.chat-session-action {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-session-action:hover {
    background: rgba(255, 255, 255, 0.14);
}

.delete-session-btn {
    opacity: 0;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s;
}

.chat-session-item:hover .delete-session-btn {
    opacity: 1;
}

/* Chat Main */
.chat-main {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #10b981;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.chat-action-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-welcome {
    text-align: center;
    padding: 60px 20px;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 36px;
}

.chat-welcome h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: #1e293b;
}

.chat-welcome p {
    color: #64748b;
    margin: 0 0 30px;
}

.welcome-suggestions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #1e293b;
}

.suggestion-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-message.assistant {
    margin-right: auto;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.user .message-avatar {
    background: #667eea;
    color: white;
}

.chat-message.assistant .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.chat-message.user .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-content {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0 0 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Standalone ChatGPT-style page */
body.chat-page {
    height: 100vh;
    overflow: hidden;
    background: #f6f7f9;
}

body.chat-page .hero {
    display: none;
}

body.chat-page #chat-panel.section {
    height: calc(100vh - 72px);
    padding: 8px 0 12px;
    background: #f6f7f9;
    overflow: hidden;
    box-sizing: border-box;
}

body.chat-page #chat-panel > .container {
    max-width: 1480px;
    padding: 0 18px;
    height: 100%;
}

body.chat-page #chat-panel .chat-container {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    max-width: none;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
    border: 1px solid #d9dee7;
    background: #ffffff;
    overflow: hidden;
}

body.chat-page #chat-panel .chat-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #f2f4f7;
    color: #111827;
    border-right: 1px solid #d9dee7;
    padding: 18px 14px;
}

body.chat-page #chat-panel .new-chat-btn {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: none;
    flex-shrink: 0;
}

body.chat-page #chat-panel .new-chat-btn:hover {
    transform: none;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

body.chat-page #chat-panel .chat-sessions {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 2px 0;
}

body.chat-page #chat-panel .chat-sessions::-webkit-scrollbar,
body.chat-page #chat-panel .chat-messages::-webkit-scrollbar {
    width: 10px;
}

body.chat-page #chat-panel .chat-sessions::-webkit-scrollbar-thumb,
body.chat-page #chat-panel .chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

body.chat-page #chat-panel .chat-sessions::-webkit-scrollbar-track,
body.chat-page #chat-panel .chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

body.chat-page #chat-panel .chat-session-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 8px 8px 12px !important;
    margin-bottom: 4px !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #374151 !important;
    border: 1px solid transparent;
    cursor: default !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

body.chat-page #chat-panel .chat-session-item:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
}

body.chat-page #chat-panel .chat-session-item.active {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

body.chat-page #chat-panel .chat-session-open {
    color: inherit;
    min-height: 28px;
}

body.chat-page #chat-panel .chat-session-actions {
    opacity: 1;
}

body.chat-page #chat-panel .chat-session-action {
    color: #6b7280;
}

body.chat-page #chat-panel .chat-session-action:hover {
    background: #dbe4ef;
    color: #111827;
}

body.chat-page #chat-panel .chat-session-delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

body.chat-page #chat-panel .chat-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    background: #ffffff;
    min-width: 0;
    overflow: hidden;
}

body.chat-page #chat-panel .chat-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    min-height: 78px;
}

body.chat-page #chat-panel .chat-messages {
    position: relative;
    max-width: none;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 28px max(28px, calc((100% - 900px) / 2 + 28px));
    background: #ffffff;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

body.chat-page #chat-panel .chat-message {
    max-width: 100%;
}

body.chat-page #chat-panel .chat-bubble {
    border-radius: 8px !important;
    box-shadow: none !important;
}

body.chat-page #chat-panel .chat-message.user .chat-bubble {
    background: #f4f4f5 !important;
    color: #111827 !important;
}

body.chat-page #chat-panel .chat-message.assistant .chat-bubble {
    background: transparent !important;
    border: none !important;
    color: #111827 !important;
}

body.chat-page #chat-panel .chat-input-area,
body.chat-page #chat-panel .chat-input-container {
    max-width: 900px;
    width: calc(100% - 56px);
    margin: 0 auto;
    border-top: none !important;
    background: #ffffff;
    padding: 14px 0 16px !important;
    flex-shrink: 0;
}

body.chat-page #chat-panel .chat-input-wrapper {
    border-radius: 8px !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10) !important;
    align-items: center;
    background: #ffffff;
    padding: 10px 12px;
}

body.chat-page #chat-panel #chat-input {
    min-height: 44px;
    max-height: 180px;
    padding: 11px 4px;
    line-height: 1.45;
    color: #111827;
    overflow-y: auto;
    scrollbar-width: thin;
}

body.chat-page #chat-panel #chat-input::placeholder {
    color: #6b7280;
}

body.chat-page #chat-panel .chat-action-btn,
body.chat-page #chat-panel .chat-send-btn,
body.chat-page #chat-panel #chat-send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex: 0 0 40px;
}

body.chat-page #chat-panel .chat-send-btn,
body.chat-page #chat-panel #chat-send-btn {
    border-radius: 8px !important;
}

body.chat-page #chat-panel.chat-drag-over .chat-main {
    outline: 2px dashed #0ea5e9;
    outline-offset: -10px;
    background: #f0f9ff;
}

body.chat-page #chat-panel.chat-drag-over .chat-messages::after {
    content: "Thả file vào đây để đính kèm";
    position: absolute;
    inset: 96px 28px 108px;
    border: 2px dashed #38bdf8;
    border-radius: 8px;
    background: rgba(240, 249, 255, 0.92);
    color: #075985;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

body.chat-page #chat-panel .chat-document-card {
    width: min(900px, 100%);
    margin: 16px auto;
    padding: 14px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #f8fafc;
    color: #111827;
}

body.chat-page #chat-panel .chat-document-card-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

body.chat-page #chat-panel .chat-document-card-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.chat-page #chat-panel .chat-document-card-body {
    min-width: 0;
    flex: 1;
}

body.chat-page #chat-panel .chat-document-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 3px;
}

body.chat-page #chat-panel .chat-document-card-title .fa-check-circle {
    color: #059669;
}

body.chat-page #chat-panel .chat-document-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    overflow-wrap: anywhere;
}

body.chat-page #chat-panel .chat-document-card-meta {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
}

body.chat-page #chat-panel .chat-document-preview {
    margin-top: 10px;
    max-height: 132px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    line-height: 1.55;
    color: #334155;
}

body.chat-page #chat-panel .chat-document-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

body.chat-page #chat-panel .chat-document-card-actions button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 600;
    cursor: pointer;
}

body.chat-page #chat-panel .chat-document-card-actions button:hover {
    background: #eef6ff;
    border-color: #93c5fd;
}

body.chat-page #chat-panel .chat-document-text-message {
    align-items: flex-start;
}

body.chat-page #chat-panel .chat-document-text-bubble {
    width: min(900px, 100%) !important;
    max-width: min(900px, 100%) !important;
    background: #ffffff !important;
    border: 1px solid #dbe3ee !important;
    padding: 14px !important;
}

body.chat-page #chat-panel .chat-document-text-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

body.chat-page #chat-panel .chat-document-text-bubble pre {
    max-height: 460px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    color: #111827;
    border: 1px solid #e5e7eb;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.chat-model-private {
    display: none !important;
}

@media (max-width: 800px) {
    body.chat-page #chat-panel .chat-container {
        grid-template-columns: 1fr;
    }

    body.chat-page #chat-panel .chat-sidebar {
        display: none;
    }

    body.chat-page #chat-panel .chat-messages,
    body.chat-page #chat-panel .chat-input-area,
    body.chat-page #chat-panel .chat-input-container {
        width: calc(100% - 24px);
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

.message-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
}

.message-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 4px;
}

/* Chat Input */
.chat-input-area {
    padding: 16px 24px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    transition: border-color 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: #667eea;
}

#chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    outline: none;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        display: none;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-message {
        max-width: 90%;
    }
}

