/* 
   EduTalk Modern Flat Design System
   Professional, Clean, and Proportional
*/

:root {
    /* Colors - Slate & Indigo Palette */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    
    /* Surfaces */
    --bg-body: #f1f5f9;
    --bg-chat: #ffffff;
    --bg-messages: #f8fafc;
    --bg-input: #ffffff;
    
    /* Text */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;
    
    /* Borders & Shadows */
    --border-soft: #e2e8f0;
    --shadow-flat: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 999px;
    
    /* Layout */
    --max-chat-width: 900px;
}

body.dark-mode {
    --bg-body: #0f172a;
    --bg-chat: #1e293b;
    --bg-messages: #0f172a;
    --bg-input: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-soft: #334155;
    --shadow-flat: 0 1px 2px rgba(0,0,0,0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    transition: background 0.3s ease;
}

/* ===== MAIN CONTAINER ===== */
.chat-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-chat);
    position: relative;
    box-shadow: var(--shadow-md);
}

/* ===== HEADER ===== */
.chat-header {
    background: var(--bg-chat);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-soft);
    z-index: 100;
}

.header-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-chat-width);
    margin: 0 auto;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px; /* Flat rounded box instead of circle */
    background: var(--primary);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.header-info h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.status {
    font-size: 12px;
    font-weight: 500;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
}

.header-right {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover {
    background: var(--bg-body);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

/* Custom Colors for Header Icons - More Subtle */
.icon-btn-glossary:hover { color: var(--secondary); border-color: var(--secondary); }
.icon-btn-theme:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn-danger:hover { color: var(--danger); border-color: var(--danger); }

/* ===== API KEY LIFE INDICATOR ===== */
.header-row-bottom {
    max-width: var(--max-chat-width);
    margin: 8px auto 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.apikey-life-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: var(--bg-messages);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
    max-width: 400px;
}

.apikey-life-indicator.ai-off {
    opacity: 0.6;
}

.apikey-life-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 40px;
}

.apikey-life-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--border-soft);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.apikey-life-bar {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 0.6s ease;
}

.apikey-life-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

/* AI Toggle Switch Flat */
.ai-toggle {
    width: 32px;
    height: 18px;
    background: var(--border-soft);
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
}

.ai-toggle.on { background: var(--secondary); }

.ai-toggle-knob {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.ai-toggle.on .ai-toggle-knob { transform: translateX(14px); }

/* ===== MESSAGES AREA ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    background: var(--bg-messages);
    scroll-behavior: smooth;
}

.chat-messages-inner { /* Helper for width constraint */
    max-width: var(--max-chat-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease-out;
    align-items: flex-start;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-top: 4px;
}

.bot-message .message-avatar {
    background: var(--primary);
    color: white;
}

.user-message .message-avatar {
    background: var(--secondary);
    color: white;
}

.message-content {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    box-shadow: var(--shadow-flat);
}

.bot-message .message-content {
    background: var(--bg-chat);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-top-left-radius: 4px;
}

.user-message .message-content {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

/* TYPING INDICATOR */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-chat);
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    width: fit-content;
    margin-bottom: 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.3s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.6s; }

@keyframes typing {
    from { opacity: 0.3; transform: translateY(0); }
    to { opacity: 1; transform: translateY(-4px); }
}

/* ===== TTS BUTTONS ===== */
.bot-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.tts-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-body);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tts-btn:hover {
    background: var(--primary-light);
    color: white;
}

.tts-btn.tts-active {
    background: var(--primary);
    color: white;
    animation: pulse-tts 1.5s infinite;
}

@keyframes pulse-tts {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.tts-wave, .tts-wave2 {
    opacity: 0.6;
}

.tts-active .tts-wave { animation: wave 1s infinite; }
.tts-active .tts-wave2 { animation: wave 1s infinite 0.2s; }

@keyframes wave {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* ===== INPUT AREA ===== */
.chat-input-container {
    background: var(--bg-chat);
    padding: 20px 24px;
    border-top: 1px solid var(--border-soft);
}

.chat-input-inner {
    max-width: var(--max-chat-width);
    margin: 0 auto;
    position: relative;
}

.chat-input {
    display: flex;
    align-items: center;
    background: var(--bg-messages);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    padding: 6px 6px 6px 20px;
    transition: all 0.2s;
}

.chat-input:focus-within {
    border-color: var(--primary-light);
    background: var(--bg-chat);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.chat-input input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
}

.chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#voiceBtn {
    background: transparent;
    color: var(--text-muted);
}

#voiceBtn:hover { color: var(--primary); background: var(--border-soft); }

#sendBtn {
    background: var(--primary);
    color: white;
    margin-left: 8px;
}

#sendBtn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== RESULT CARDS (Flat Style) ===== */
.result-card-chat {
    background: var(--bg-chat);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 16px;
    transition: transform 0.2s;
}

.result-card-chat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-card-content {
    padding: 16px;
}

.result-card-content h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-card-content p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.result-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-card-link, .result-card-wa, .result-card-analyze {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.result-card-link { background: var(--bg-body); color: var(--text-main); }
.result-card-link:hover { background: var(--border-soft); }

.result-card-analyze { background: var(--primary); color: white; }
.result-card-analyze:hover { background: var(--primary-dark); }

.result-card-wa { background: #25D366; color: white; }
.result-card-wa:hover { background: #1ebe5d; }

/* ===== QUICK REPLIES ===== */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.quick-replies button {
    padding: 10px 20px;
    background: var(--bg-chat);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-replies button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== MODALS & DIALOGS ===== */
.help-modal, .about-modal, .ai-choice-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.help-modal.active, .about-modal.active, .ai-choice-dialog.active {
    display: flex;
}

.help-modal-content, .about-modal-content, .ai-choice-content {
    background: var(--bg-chat);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.help-modal-header, .about-modal-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.help-modal-header h2, .about-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.about-modal-header p {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.about-logo {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.help-close-btn, .about-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.help-close-btn:hover, .about-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.help-modal-body, .about-modal-body {
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-messages);
}

.help-modal-body {
    padding: 0;
}

/* About Sections */
.about-section {
    background: var(--bg-chat);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-flat);
}

.about-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-section p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.about-section p:last-child {
    margin-bottom: 0;
}

/* Philosophy Layout */
.about-philosophy {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.philosophy-item {
    background: var(--bg-messages);
    border-radius: 12px;
    padding: 16px 20px;
    border-left: 4px solid var(--secondary);
    transition: transform 0.2s;
}

.philosophy-item:hover {
    transform: translateX(4px);
    background: white;
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.philosophy-item:nth-child(2) { border-left-color: var(--accent); }
.philosophy-item:nth-child(3) { border-left-color: var(--primary); }

.philosophy-label {
    display: inline-block;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.philosophy-item p {
    font-size: 14px;
    margin: 0;
}

.about-tagline {
    text-align: center;
    font-style: italic;
    padding: 20px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 12px;
    margin-top: 24px;
    color: var(--text-main) !important;
    font-weight: 500;
}


/* Help Tabs - Segmented Control Style */
.help-tabs {
    display: flex;
    gap: 0;
    margin: 20px 24px 24px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
}

.help-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-tab:hover {
    color: var(--primary);
}

.help-tab.active {
    background: var(--bg-chat);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.help-tab-content {
    display: none;
    padding: 0 24px 24px;
    animation: fadeIn 0.3s ease-out;
}

.help-tab-content.active {
    display: block;
}

.help-tab-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

/* Help Sections */
.help-section {
    background: var(--bg-chat);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.help-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.help-section h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.help-example {
    background: var(--bg-messages);
    border-radius: 12px;
    padding: 14px;
    border-left: 4px solid var(--primary-light);
}

.help-example strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.help-example li {
    font-size: 14px;
    color: var(--text-main);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-example li::before {
    content: '→';
    color: var(--primary-light);
    font-weight: bold;
}

/* Category List */
.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.category-item {
    background: var(--bg-messages);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.category-item:hover {
    border-color: var(--primary-light);
    background: var(--bg-chat);
}

.category-item strong {
    color: var(--primary);
    display: block;
    margin-bottom: 2px;
}

/* FAQ Styling */
.faq-item {
    margin-bottom: 12px;
    background: var(--bg-chat);
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    overflow: hidden;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-question {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
    cursor: pointer;
    background: var(--bg-chat);
}

.faq-answer {
    padding: 0 20px 16px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px dashed var(--border-soft);
    padding-top: 16px;
}

/* Tips Styling */
.tip-item {
    display: flex;
    gap: 16px;
    background: var(--bg-chat);
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    margin-bottom: 16px;
}

.tip-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--border-soft) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tip-content h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
}

.tip-content p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.tip-example {
    font-size: 13px;
    padding: 10px 14px;
    background: var(--bg-messages);
    border-radius: 10px;
    color: var(--primary);
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.help-footer {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(to right, rgba(79, 70, 229, 0.05), rgba(16, 185, 129, 0.05));
    border-radius: 0 0 20px 20px;
    text-align: center;
    border-top: 1px solid var(--border-soft);
}

.help-footer p {
    font-size: 13px;
    color: var(--text-muted);
}

/* AI Choice Dialog Specific */
.ai-choice-content {
    max-width: 400px;
    text-align: center;
    padding: 32px;
}

.ai-choice-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ai-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.ai-choice-btn {
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-choice-yes {
    background: var(--secondary);
    color: white;
}

.ai-choice-no {
    background: var(--bg-body);
    color: var(--text-muted);
}

.ai-choice-yes:hover { transform: scale(1.02); filter: brightness(1.1); }
.ai-choice-no:hover { background: var(--border-soft); }

/* ===== FILE PREVIEW MODAL ===== */
.file-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.file-preview-modal.active {
    display: flex;
}

.file-preview-content {
    background: white;
    width: 50%; /* 50% width as requested */
    height: 90vh;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.file-preview-header {
    padding: 16px 24px;
    background: var(--bg-messages);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.file-preview-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-actions {
    display: flex;
    gap: 8px;
}

.file-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-soft);
    background: white;
    color: var(--text-main);
    transition: all 0.2s;
}

.file-btn:hover {
    background: var(--bg-body);
    border-color: var(--primary-light);
}

.file-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.file-btn-primary:hover {
    background: var(--primary-dark);
}

.file-preview-body {
    flex: 1;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.file-preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.file-preview-container iframe, 
.file-preview-container object,
.file-preview-container img {
    width: 100%;
    height: 100%;
    border: none;
}

.file-preview-container img {
    object-fit: contain;
    background: #000;
}

.file-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.file-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-soft);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Responsive Preview */
@media (max-width: 1200px) {
    .file-preview-content { width: 70%; }
}

@media (max-width: 768px) {
    .file-preview-content { 
        width: 100%; 
        height: 100%;
        border-radius: 0;
    }
    .file-preview-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .file-preview-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Scrollbar Modern */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .chat-messages-inner { padding: 0 16px; }
    .chat-header { padding: 12px 16px; }
    .header-info h2 { font-size: 16px; }
    .bot-avatar { width: 38px; height: 38px; }
    .message { max-width: 90%; }
    .chat-input-container { padding: 12px 16px; }
}
