
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Initial Loading Overlay */
.initial-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.initial-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.initial-loading-content {
    text-align: center;
    color: white;
}

.initial-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
/* App Name in Initial Loading Overlay */
.app-name {
    font-size: 2rem;
    /* =====================================================================
        Translator Agent - Main Stylesheet
        ---------------------------------------------------------------------
        This file contains all global and component-level CSS for the Translator Agent web UI.
        - Layout, typography, and color themes
        - Loading overlays, chat UI, agent selector, translation controls
        - Responsive and mobile adjustments
        - Utility classes and animations
        ---------------------------------------------------------------------
        Last updated: 2026-03-17
        ===================================================================== */
    /* =====================================================================
        Translator Agent - Main Stylesheet
        ---------------------------------------------------------------------
        This file contains all global and component-level CSS for the Translator Agent web UI.
        - Layout, typography, and color themes
        - Loading overlays, chat UI, agent selector, translation controls
        - Responsive and mobile adjustments
        - Utility classes and animations
        ---------------------------------------------------------------------
        Last updated: 2026-03-17
        ===================================================================== */
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 12px;
    letter-spacing: 1px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.initial-loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f7f7f8;
    color: #2d3748;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100%;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

html {
    height: -webkit-fill-available;
} 

header {
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.header .app-name {
    /* App Name in Initial Loading Overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
/* Spinner Animation for Loading Overlay */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Loading Text Animation */
.initial-loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
/* =============================
   Base Layout & Typography
   ============================= */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f7f7f8;
    color: #2d3748;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100%;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}
html {
    height: -webkit-fill-available;
} 

/* =============================
   Header Styles
   ============================= */
header {
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.header .app-name {
    /* App Name in Initial Loading Overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
/* Spinner Animation for Loading Overlay */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Loading Text Animation */
.initial-loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
/* =============================
   Base Layout & Typography
   ============================= */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f7f7f8;
    color: #2d3748;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100%;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}
html {
    height: -webkit-fill-available;
} 

/* =============================
   Header Styles
   ============================= */
header {
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
/* Gradient Title in Header */
/* Gradient Title in Header */
.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}
/* =============================
   Main Content Area
   ============================= */
/* =============================
   Main Content Area
   ============================= */
.content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#chat-container {
    flex: 1;
    padding: 2rem;
    padding-bottom: calc(2rem - 50px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    width: 1000px;
    margin: 0 auto;
}
#chat-top-spacer {
    display: none;
}

/* =============================
   Footer Styles
   ============================= */
footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
@media (max-width: 1000px) {
    #chat-container {
        width: 100%;
        padding: 1rem;
    }
}
/* =============================
   Input Area Styles
   ============================= */
.input-area {
    padding: 1rem 2rem;
}
/* Disabled input-area style */
.input-area.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.7);
}
@media (max-width: 768px) {
    body {
        overscroll-behavior: auto;
        position: fixed;
        width: 100%;
    }
    
    .content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
/* =============================
   Menu Toggle (Sidebar)
   ============================= */
.menu-toggle {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    z-index: 1001;
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
/* =============================
   Menu Toggle Hover Effect
   ============================= */
.menu-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-50%) scale(1.05);
}
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #6366f1;
    border-radius: 2px;
    transition: all 0.3s ease;
}
/* =============================
   Agent Selector (Sidebar)
   ============================= */
.agent-selector-container {
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
/* =============================
   Translation Options Bar
   ============================= */
.translate-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 2rem;
    background: #f0f0ff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
/* =============================
   Translation Result Styling
   ============================= */
.translation-result {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 8px;
}
@media (max-width: 768px) {
    header {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0.75rem 1rem;
    }

    .translate-options {
        padding: 6px 0.5rem;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .translate-options label {
        font-size: 0.82rem;
    }

    .source-language-display {
        padding: 6px 12px;
        min-width: 50px;
        font-size: 0.82rem;
        max-width: 160px;

    }

    .translation-direction-btn {
        width: 32px;
        height: 32px;
        margin: 0;
        box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3), 
                    0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .translation-direction-btn:active {
        transform: scale(0.90);
        box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
    }

    .translation-direction-btn svg {
        width: 16px;
        height: 16px;
    }

    .swap-button-container {
        margin: 0 4px;
        gap: 2px;
    }

    .swap-wrapper {
        margin: 0 4px;
    }

    .swap-hint {
        font-size: 0.65rem;
        padding: 2px 0;
    }

    .swap-hint-source {
        padding-right: 30px;
    }

    .swap-hint-target {
        padding-left: 30px;
    }



    .language-select {
        font-size: 0.78rem;
        padding: 5px 26px 5px 10px;
        border-radius: 16px;
        border-width: 1.5px;
        max-width: 140px;
        min-width: 90px;
        flex: 1;
    }
}
/* =============================
   Sidebar Navigation
   ============================= */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}
/* =============================
   Cookie Banner
   ============================= */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
/* ===================================
   MOBILE KEYBOARD STATE
   ===================================
   Styles when mobile keyboard is visible
*/
body.keyboard-visible {
    /* Prevent body scroll when keyboard is shown */
    overflow: hidden;
}
body.keyboard-visible #chat-container {
    /* Adjust chat container when keyboard appears */
    padding-bottom: 0;
}
body.keyboard-visible .input-area {
    /* Ensure input stays visible above keyboard */
    position: sticky;
    bottom: 0;
    z-index: 100;
}
@media (max-width: 768px) {
    body.keyboard-visible .content {
        /* Adjust content height for mobile keyboard */
        max-height: calc(100vh - env(safe-area-inset-bottom));
    }
    
    body.keyboard-visible #chat-container {
        /* Reduce padding when keyboard is visible */
        padding: 1rem;
        padding-bottom: 0;
    }
}

.content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#chat-container {
    flex: 1;
    padding: 2rem;
    padding-bottom: calc(2rem - 50px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    width: 1000px;
    margin: 0 auto;
}

#chat-top-spacer {
    display: none;
}

footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

@media (max-width: 1000px) {
    #chat-container {
        width: 100%;
        padding: 1rem;
    }
}

.input-area {
    padding: 1rem 2rem;
}

/* Disabled input-area style */
.input-area.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.7);
}

@media (max-width: 768px) {
    body {
        overscroll-behavior: auto;
        position: fixed;
        width: 100%;
    }
    
    .content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.menu-toggle {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    z-index: 1001;
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-50%) scale(1.05);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #6366f1;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Agent Selector - now in sidebar */
.agent-selector-container {
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-selector-container label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
}

.agent-selector {
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #ffffff;
    color: #2d3748;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.agent-selector:hover {
    border-color: #6366f1;
    background: #f8f9ff;
}

.agent-selector:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.agent-selector:hover {
    background-color: #ede9fe;
    border-color: #4f46e5;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.agent-selector:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Translation Options Bar */
.translate-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 2rem;
    background: #f0f0ff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.translate-options label {
    font-weight: 600;
    color: #4338ca;
    white-space: nowrap;
}

.source-language-display {
    display: inline-flex;
    align-items: center;
    justify-content: left;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #6366f1;
    font-weight: 600;
    min-width: 60px;
    color: #6366f1;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    min-width: 220px;
}

.translation-direction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3), 
                0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.translation-direction-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.translation-direction-btn svg {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.translation-direction-btn.reversed svg {
    transform: rotate(180deg);
}

.translation-direction-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4), 
                0 2px 6px rgba(0, 0, 0, 0.15);
}

.translation-direction-btn:hover::before {
    opacity: 1;
}

.translation-direction-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.3);
    transition: all 0.1s ease;
}

.swap-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0 8px;
    flex-shrink: 0;
}

.swap-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-hint {
    display: block;
    width: 100%;
    font-size: 0.7rem;
    color: #0005ff;
    white-space: nowrap;
    opacity: 0.7;
    font-weight: 500;
    text-align: center;
    padding: 4px 0;
    background: #f0f0ff;
    border-top: 1px solid #e2e8f0;
    margin: 0;
    line-height: 1;
}

.swap-hint-source {
    padding-right: 50px;
}

.swap-hint-target {
    padding-left: 50px;
}

.language-select {
    padding: 8px 36px 8px 14px;
    border: 2px solid #6366f1;
    border-radius: 20px;
    background: #f5f3ff;
    color: #4338ca;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    max-width: 160px;
    min-width: 0;
    flex-shrink: 1;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.12);
}

.language-select:hover {
    background-color: #ede9fe;
    border-color: #4f46e5;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.language-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Translation result styling */
.translation-result {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 8px;
}

.translation-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.transcription-result {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 8px;
}

.transcription-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    header {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0.75rem 1rem;
    }

    .translate-options {
        padding: 6px 0.5rem;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .translate-options label {
        font-size: 0.82rem;
    }

    .source-language-display {
        padding: 6px 12px;
        min-width: 50px;
        font-size: 0.82rem;
        max-width: 160px;

    }

    .translation-direction-btn {
        width: 32px;
        height: 32px;
        margin: 0;
        box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3), 
                    0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .translation-direction-btn:active {
        transform: scale(0.90);
        box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
    }

    .translation-direction-btn svg {
        width: 16px;
        height: 16px;
    }

    .swap-button-container {
        margin: 0 4px;
        gap: 2px;
    }

    .swap-wrapper {
        margin: 0 4px;
    }

    .swap-hint {
        font-size: 0.65rem;
        padding: 2px 0;
    }

    .swap-hint-source {
        padding-right: 30px;
    }

    .swap-hint-target {
        padding-left: 30px;
    }



    .language-select {
        font-size: 0.78rem;
        padding: 5px 26px 5px 10px;
        border-radius: 16px;
        border-width: 1.5px;
        max-width: 140px;
        min-width: 90px;
        flex: 1;
    }
}

@media (max-width: 380px) {
    header h2 {
        display: none;
    }

    .swap-wrapper {
        margin: 0 2px;
    }

    .swap-hint {
        font-size: 0.6rem;
        padding: 2px 0;
    }

    .swap-hint-source {
        padding-right: 20px;
    }

    .swap-hint-target {
        padding-left: 20px;
    }

    .translation-direction-btn {
        width: 28px;
        height: 28px;
    }

    .translation-direction-btn svg {
        width: 14px;
        height: 14px;
    }

    .language-select {
        font-size: 0.72rem;
        padding: 4px 22px 4px 6px;
        max-width: 120px;
        min-width: 80px;
        flex: 1;
    }

    .input-disclaimer {
        font-size: 0.65rem;
        gap: 6px;
        flex-direction: column;
        line-height: 1.3;
    }

    #speech-method-indicator {
        font-size: 0.65rem !important;
        padding: 2px 6px !important;
        margin-left: 0 !important;
    }

    .input-box {
        padding: 0.75rem 5rem 0.75rem 0.75rem;
        line-height: 1.35;
    }

    .input-box::placeholder {
        font-size: 13px;
    }

    .input-buttons {
        right: 0.25rem;
        gap: 2px;
        top: 0.75rem;
        transform: none;
    }

    .voice-button,
    .send-button {
        width: 28px;
        height: 28px;
    }

    .voice-button svg,
    .send-button svg {
        width: 14px;
        height: 14px;
    }
}

.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 2rem;
    color: #718096;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-sidebar:hover {
    background: #f7f7f8;
    color: #2d3748;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.footer-info {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #2d3748;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-link:hover {
    background: #f7f7f8;
    color: #6366f1;
}

.sidebar-link .icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.language-selector-container {
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.language-selector-container label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
}

.language-selector {
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #ffffff;
    color: #2d3748;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.language-selector:hover {
    border-color: #6366f1;
    background: #f8f9ff;
}

.language-selector:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .sidebar {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
    }
    
    .sidebar-nav {
        padding-bottom: 2rem;
    }
    
    .footer-info {
        padding: 0.75rem 1rem;
        font-size: 0.85em !important;
    }
}



@media (max-width: 768px) {
    .header {
        padding: 1rem 1rem;
    }
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}




.scroll-indicator {
    position: fixed;
    bottom: 140px;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: #6366f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 50;
}

.scroll-indicator.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.scroll-indicator:hover {
    background: #4f46e5;
    transform: scale(1.1);
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    fill: white;
}

@media (max-width: 768px) {
    .scroll-indicator {
        bottom: 180px;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

.message {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-in;
    border-radius: 12px;
    max-width: 100%;
    margin: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .message {
        padding: 1rem;
        gap: 0.75rem;
        flex-direction: column;
    }
    
    .message .message-icon {
        align-self: flex-start;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.message.assistant {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.message-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.message.user .message-icon {
    background: #10b981;
    color: #ffffff;
}

.message.assistant .message-icon {
    background: #6366f1;
    color: #ffffff;
}

.message-content {
    flex: 1;
    line-height: 1.6;
}

.message-text {
    margin-bottom: 0.5rem;
}

.message-disclaimer {
    font-size: 0.75rem;
    font-style: italic;
    color: #718096;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.message.user .message-disclaimer {
    display: none;
}



@media (max-width: 768px) {
    .input-area {
        padding: 1rem 1rem 1rem;
    }

    .input-disclaimer {
        font-size: 0.7rem;
        gap: 8px;
        padding: 0 0.5rem;
    }

    #speech-method-indicator {
        font-size: 0.68rem !important;
        padding: 2px 6px !important;
    }
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.input-wrapper .input-box {
    flex: 1;
    min-width: 0;
}

.input-buttons {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.input-disclaimer {
    max-width: 800px;
    margin: 0.5rem auto 0;
    font-size: 0.75rem;
    color: #718096;
    text-align: center;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#speech-method-indicator {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.input-box {
    width: 100%;
    padding: 1rem 7rem 1rem 1rem;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 12px;
    color: #2d3748;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.input-box::placeholder {
    color: #a0aec0;
    font-size: 1rem;
}

.input-box:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .input-box {
        font-size: 16px;
        padding: 0.875rem 6rem 0.875rem 0.875rem;
        line-height: 1.4;
    }

    .input-box::placeholder {
        font-size: 14px;
    }

    .input-buttons {
        right: 0.375rem;
        gap: 3px;
        top: 0.875rem;
        transform: none;
    }

    .input-wrapper {
        align-items: flex-start;
    }
}

.voice-button {
    width: 32px;
    height: 32px;
    background: #10b981;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.voice-button:hover:not(:disabled) {
    background: #059669;
    transform: scale(1.05);
}

.voice-button:active:not(:disabled) {
    transform: scale(0.95);
    background: #ef4444;
}

.voice-button.recording {
    background: #ef4444 !important;
    animation: pulse 1.5s ease-in-out infinite;
}

.voice-button.recording:hover {
    background: #dc2626 !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.voice-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.voice-button svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.send-button {
    width: 32px;
    height: 32px;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background: #4f46e5;
    transform: scale(1.05);
}

.send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.send-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.send-button svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* TTS Toggle Button */
.tts-toggle {
    width: 28px;
    height: 28px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    padding: 0;
    flex-shrink: 0;
}

.tts-toggle:hover {
    background: #cbd5e0;
    transform: scale(1.1);
}

.tts-toggle.active {
    background: #6366f1;
}

.tts-toggle.active svg {
    fill: white;
}

.tts-toggle svg {
    width: 14px;
    height: 14px;
    fill: #4a5568;
}

.tts-toggle.speaking {
    animation: tts-pulse 1s ease-in-out infinite;
}

@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

.spinner-border {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tts-spin 0.75s linear infinite;
}

.spinner-border-sm {
    width: 12px;
    height: 12px;
    border-width: 2px;
}

@keyframes tts-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 0;
}

.loading-dot {
    width: 10px;
    height: 10px;
    background: #6366f1;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    display: inline-block;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

.empty-state-icon {
    font-size: 4rem;
}

@media (max-width: 768px) {
    .empty-state-icon {
        font-size: 3rem;
    }
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: contain;
    padding: 18px;
    background: #fff;
    border: 4px solid #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

@media (max-width: 768px) {
    .profile-photo {
        width: 100px;
        height: 100px;
        border-width: 3px;
    }
}

.empty-state h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1a202c;
    text-align: center;
}

@media (max-width: 768px) {
    .empty-state h2 {
        font-size: 1.5rem;
    }
}

.empty-state p {
    text-align: center;
    max-width: 800px;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin-top: 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .suggestions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .suggestions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.suggestion-card {
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.suggestion-card:hover {
    background: #f8fafc;
    border-color: #6366f1;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.suggestion-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.suggestion-card p {
    font-size: 0.875rem;
    color: #718096;
    line-height: 1.5;
}

/* Agent-specific card styling */
.suggestion-card.agent-card[data-agent="translator"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.suggestion-card.agent-card[data-agent="translator"]:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    border-color: #5568d3;
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.suggestion-card.agent-card[data-agent="translator"] h3,
.suggestion-card.agent-card[data-agent="translator"] p {
    color: #ffffff;
}

.suggestion-card.agent-card[data-agent="dok2u"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
}

.suggestion-card.agent-card[data-agent="dok2u"]:hover {
    background: linear-gradient(135deg, #0d9668 0%, #047857 100%);
    border-color: #0d9668;
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.suggestion-card.agent-card[data-agent="dok2u"] h3,
.suggestion-card.agent-card[data-agent="dok2u"] p {
    color: #ffffff;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.cookie-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #1a202c;
}

.cookie-content p {
    margin: 0 0 1rem 0;
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-accept {
    background: #6366f1;
    color: white;
}

.cookie-accept:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.cookie-decline {
    background: #e2e8f0;
    color: #4a5568;
}

.cookie-decline:hover {
    background: #cbd5e0;
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-content h3 {
        font-size: 1.1rem;
    }
    
    .cookie-content p {
        font-size: 0.9rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        padding: 0.875rem;
    }
}

/* ===================================
   MOBILE KEYBOARD STATE
   ===================================
   Styles when mobile keyboard is visible
*/

body.keyboard-visible {
    /* Prevent body scroll when keyboard is shown */
    overflow: hidden;
}

body.keyboard-visible #chat-container {
    /* Adjust chat container when keyboard appears */
    padding-bottom: 0;
}

body.keyboard-visible .input-area {
    /* Ensure input stays visible above keyboard */
    position: sticky;
    bottom: 0;
    z-index: 100;
}

@media (max-width: 768px) {
    body.keyboard-visible .content {
        /* Adjust content height for mobile keyboard */
        max-height: calc(100vh - env(safe-area-inset-bottom));
    }
    
    body.keyboard-visible #chat-container {
        /* Reduce padding when keyboard is visible */
        padding: 1rem;
        padding-bottom: 0;
    }
}
