/*
 * Jarven AI - Emerald Blue Glassmorphism Stylesheet
 * Theme: Vibrant Emerald & Blue mesh gradients with frosted glass UI
 * Design: Modern, Translucent, Glowing
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ================================================
   DESIGN TOKENS
   ================================================ */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

    /* Core Colors */
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --cyan-500: #06b6d4;
    
    --navy-900: #0f172a;
    --navy-800: #1e293b;

    --white:     #ffffff;
    --gray-50:   #f8fafc;
    --gray-100:  #f1f5f9;
    --gray-200:  #e2e8f0;
    --gray-300:  #cbd5e1;
    --gray-400:  #94a3b8;
    --gray-500:  #64748b;
    --gray-700:  #334155;
    --gray-900:  #0f172a;

    /* Semantic Mapping */
    --bg-base:         var(--navy-900);
    --bg-sidebar:      rgba(15, 23, 42, 0.65);
    --bg-sidebar-hover:rgba(255, 255, 255, 0.1);
    --bg-card:         rgba(255, 255, 255, 0.08);
    --bg-input:        rgba(255, 255, 255, 0.1);
    --bg-bubble-user:  linear-gradient(135deg, var(--emerald-500), var(--blue-500));
    --bg-bubble-bot:   rgba(255, 255, 255, 0.08);

    --text-primary:    var(--white);
    --text-secondary:  var(--gray-300);
    --text-muted:      var(--gray-400);
    --text-sidebar:    var(--gray-300);
    --text-sidebar-active: var(--white);

    --accent:          var(--emerald-500);
    --accent-hover:    var(--emerald-600);

    --border-light:    rgba(255, 255, 255, 0.1);
    --border-medium:   rgba(255, 255, 255, 0.15);
    --border-strong:   rgba(255, 255, 255, 0.25);
    --border-sidebar:  rgba(255, 255, 255, 0.1);

    --shadow-glass:    0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-glow:     0 0 15px rgba(16, 185, 129, 0.4);
    
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  18px;
    --radius-full:9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* ================================================
   BACKGROUND MESH (EMERALD BLUE GLASSMORPHISM)
   ================================================ */
.glass-bg-mesh {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: drift 20s infinite alternate ease-in-out;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--emerald-500), transparent 70%);
}

.shape-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--blue-600), transparent 70%);
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--cyan-500), transparent 70%);
    animation-delay: -10s;
    opacity: 0.4;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(10vw, 5vh) scale(1.1); }
    100% { transform: translate(-5vw, 15vh) scale(0.9); }
}

/* ================================================
   SCROLLBAR
   ================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

/* ================================================
   LAYOUT
   ================================================ */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: transparent;
}

/* ================================================
   SIDEBAR (FROSTED GLASS)
   ================================================ */
.chat-sidebar {
    width: 290px;
    min-width: 290px;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid var(--border-sidebar);
    z-index: 100;
    transition: var(--transition);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.02em;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.brand-title i {
    color: var(--emerald-500);
    font-size: 1.2rem;
}

/* New Chat Button */
.btn-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: linear-gradient(135deg, var(--emerald-500), var(--blue-500));
    color: var(--white);
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-new-chat:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-new-chat:active { transform: translateY(0); }

/* Threads List */
.threads-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.threads-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray-400);
    margin-bottom: 0.6rem;
    padding-left: 0.5rem;
    font-weight: 600;
}

.thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.thread-item:hover {
    background-color: var(--bg-sidebar-hover);
    border-color: var(--border-light);
}

.thread-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--border-medium);
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.1);
}

.thread-details {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.thread-icon {
    color: var(--emerald-500);
    font-size: 0.85rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.thread-item.active .thread-icon { opacity: 1; text-shadow: 0 0 5px var(--emerald-500); }

.thread-title {
    font-size: 0.875rem;
    color: var(--text-sidebar);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.thread-item.active .thread-title {
    color: var(--white);
    font-weight: 500;
}

.thread-actions { display: none; gap: 0.2rem; }
.thread-item:hover .thread-actions { display: flex; }

.thread-action-btn {
    background: transparent;
    border: none;
    color: var(--gray-400);
    padding: 0.2rem 0.3rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.thread-action-btn:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.thread-action-btn.delete:hover { color: #ef4444; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-sidebar);
    flex-shrink: 0;
}

.settings-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--white);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-glow);
}

/* ================================================
   MAIN VIEWPORT (FROSTED GLASS OVERLAY)
   ================================================ */
.main-chat-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
}

/* Header */
.viewport-header {
    height: 64px;
    border-bottom: 1px solid var(--border-sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
    flex-shrink: 0;
    gap: 0.75rem;
}

.menu-toggle {
    display: flex;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover { background: rgba(255, 255, 255, 0.1); }

/* Selectors */
.model-selector-wrapper,
.subject-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    white-space: nowrap;
}

.model-select {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-light);
    color: var(--white);
    padding: 0.4rem 1rem 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-sans);
    max-width: 200px;
    backdrop-filter: blur(4px);
}

.model-select option {
    background-color: var(--navy-900);
    color: var(--white);
}

.model-select:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.model-select:hover {
    border-color: var(--border-strong);
    background-color: rgba(255, 255, 255, 0.12);
}

/* Header Action Buttons */
.btn-header-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-light);
    color: var(--gray-300);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.btn-header-action:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-color: var(--border-medium);
}

/* ================================================
   MESSAGES AREA
   ================================================ */
.messages-scroller {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.75rem;
    scroll-behavior: smooth;
}

.messages-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Message Bubbles */
.message-wrapper {
    display: flex;
    gap: 0.85rem;
    max-width: 88%;
    animation: slideInUp 0.3s ease forwards;
}

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

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

.message-wrapper.assistant {
    align-self: flex-start;
}

/* Avatars */
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    box-shadow: var(--shadow-glass);
}

.message-wrapper.user .message-avatar {
    background: linear-gradient(135deg, var(--emerald-500), var(--blue-500));
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-wrapper.assistant .message-avatar {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--emerald-500);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(8px);
}

/* Bubble Body */
.message-bubble {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-xl);
    line-height: 1.65;
    font-size: 0.9375rem;
    word-break: break-word;
    position: relative;
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.message-wrapper.user .message-bubble {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.85), rgba(59, 130, 246, 0.85));
    color: var(--white);
    border-top-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-wrapper.assistant .message-bubble {
    background-color: var(--bg-bubble-bot);
    color: var(--white);
    border-top-left-radius: 4px;
    border: 1px solid var(--border-medium);
    padding-bottom: 1.75rem;
}

/* Markdown inside bubbles */
.message-bubble p { margin-bottom: 0.6rem; }
.message-bubble p:last-child { margin-bottom: 0; }

.message-bubble h1, .message-bubble h2, .message-bubble h3 {
    font-size: 1.05rem;
    margin: 0.85rem 0 0.4rem;
    font-weight: 700;
    color: var(--white);
}

.message-bubble ul, .message-bubble ol {
    padding-left: 1.35rem;
    margin-bottom: 0.5rem;
}

.message-bubble li { margin-bottom: 0.25rem; }

.message-bubble strong { font-weight: 700; color: var(--emerald-500); }
.message-wrapper.user .message-bubble strong { color: var(--white); }

.message-bubble code {
    font-family: var(--font-mono);
    font-size: 0.84em;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--emerald-500);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-wrapper.user .message-bubble code {
    background: rgba(0, 0, 0, 0.2);
    color: var(--white);
}

.message-bubble pre {
    margin: 0.85rem 0 0;
    border-radius: var(--radius-md);
    background-color: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.message-bubble pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
    border: none;
    font-size: 0.85em;
}

/* Code Block Header */
.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 0.45rem 1rem;
    font-size: 0.75rem;
    color: var(--gray-400);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.btn-copy-code {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-family: var(--font-sans);
    transition: var(--transition);
}

.btn-copy-code:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Typing Caret */
.typing-caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--emerald-500);
    margin-left: 3px;
    vertical-align: middle;
    border-radius: 1px;
    animation: blink 0.85s step-start infinite;
    box-shadow: 0 0 5px var(--emerald-500);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Tables in bubbles */
.message-bubble table {
    width: 100%;
    margin: 0.85rem 0;
    border-collapse: collapse;
    font-size: 0.9em;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.message-bubble th, .message-bubble td {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-light);
    text-align: left;
}

.message-bubble th {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: var(--white);
}

.message-bubble tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.03);
}

/* ================================================
   EMPTY / WELCOME STATE
   ================================================ */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 4vh;
}

.empty-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.8), rgba(59, 130, 246, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(10px);
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
    50%       { transform: translateY(-8px); box-shadow: 0 0 25px rgba(59, 130, 246, 0.6); }
}

.empty-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.empty-subtitle {
    max-width: 440px;
    font-size: 0.9375rem;
    color: var(--gray-300);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

/* Suggestion Cards */
.empty-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    max-width: 580px;
    width: 100%;
}

.suggestion-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.suggestion-card:hover {
    border-color: var(--emerald-500);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.suggestion-icon {
    font-size: 1.15rem;
    color: var(--emerald-500);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.suggestion-text {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--white);
    margin-bottom: 0.2rem;
}

.suggestion-desc {
    font-size: 0.8rem;
    color: var(--gray-400);
    line-height: 1.4;
}

/* ================================================
   CHAT FOOTER (FROSTED GLASS)
   ================================================ */
.chat-footer {
    padding: 1rem 1.75rem 1.5rem;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-sidebar);
    flex-shrink: 0;
    z-index: 10;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 0.5rem 0.65rem;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-glass);
}

.input-container:focus-within {
    border-color: var(--emerald-500);
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2), var(--shadow-glow);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 0.9375rem;
    padding: 0.45rem 0.35rem;
    resize: none;
    max-height: 180px;
    min-height: 24px;
    font-family: var(--font-sans);
    line-height: 1.6;
}

.chat-input::placeholder { color: var(--gray-400); }

/* Voice Input Mic Button */
.btn-voice-input {
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    margin-bottom: 1px;
}

.btn-voice-input:hover {
    color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.1);
}

.btn-voice-input.recording {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: pulseRecording 1.4s ease-in-out infinite;
}

@keyframes pulseRecording {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(239, 68, 68, 0.4); }
    50%       { transform: scale(1.08); box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}

/* Send Button */
.btn-send {
    background: linear-gradient(135deg, var(--emerald-500), var(--blue-500));
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.875rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    margin-bottom: 1px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-send:disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--gray-500);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-info-text {
    text-align: center;
    font-size: 0.72rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
}

/* ================================================
   VOICE OUTPUT BUTTON (INSIDE BOT BUBBLES)
   ================================================ */
.btn-speak-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-light);
    color: var(--gray-300);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    position: absolute;
    bottom: 8px;
    right: 12px;
    opacity: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

.message-wrapper.assistant:hover .btn-speak-text { opacity: 1; }

.btn-speak-text:hover {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-500);
    border-color: rgba(16, 185, 129, 0.4);
}

.btn-speak-text.playing {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    background: rgba(239, 68, 68, 0.2) !important;
    opacity: 1 !important;
    animation: pulseRecording 1.2s ease-in-out infinite;
}

/* ================================================
   MODALS (GLASSMORPHISM)
   ================================================ */
.modal-content {
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass), 0 0 40px rgba(16, 185, 129, 0.15);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--white);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.btn-close { 
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.5; 
}
.btn-close:hover { opacity: 1; }

/* ================================================
   FORMS (inside modals)
   ================================================ */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-300);
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    color: var(--white);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-sans);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: var(--emerald-500);
    color: var(--white);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    outline: none;
}

.form-control::placeholder { color: var(--gray-500); }

.form-text { color: var(--gray-400); font-size: 0.8rem; }

.form-range::-webkit-slider-thumb {
    background: var(--emerald-500);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border-light);
}

.form-check-input:checked {
    background-color: var(--emerald-500);
    border-color: var(--emerald-500);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* ================================================
   BUTTONS (bootstrap override)
   ================================================ */
.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border-medium);
    color: var(--white);
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--border-strong);
    color: var(--white);
}

.btn-primary {
    background: linear-gradient(135deg, var(--emerald-500), var(--blue-500));
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
}

.btn-outline-danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-outline-danger:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: #f87171;
}

/* ================================================
   HEADER UTILITY BUTTONS (clear / export)
   ================================================ */
.btn-outline-secondary.border-0.text-secondary {
    color: var(--gray-400) !important;
    border-radius: var(--radius-md) !important;
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: var(--transition);
}

.btn-outline-secondary.border-0.text-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

@media (min-width: 992px) {
    .chat-sidebar.collapsed {
        margin-left: -290px;
    }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 991.98px) {
    .chat-sidebar {
        position: absolute;
        left: -290px;
        top: 0;
        bottom: 0;
        box-shadow: var(--shadow-glass);
    }

    .chat-sidebar.open { left: 0; }

    .model-label { display: none !important; }

    .model-select { max-width: 140px; font-size: 0.8rem; }

    .messages-scroller { padding: 1.25rem 1rem; }

    .empty-suggestions { grid-template-columns: 1fr; }

    .chat-footer { padding: 0.75rem 1rem 1rem; }

    .viewport-header { padding: 0 1rem; }
}

@media (max-width: 480px) {
    .empty-title { font-size: 1.35rem; }
    .message-wrapper { max-width: 96%; }
}
