/* ============================================
   iOS-Inspired Design - Komplett neu
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Mode Colors */
    --ios-blue: #333333; /* Changed from Blue to Dark Grey/Black */
    --ios-gray: #8E8E93;
    --ios-gray-light: #C7C7CC;
    --ios-gray-lighter: #E5E5EA;
    --ios-bg: #F2F2F7;
    --ios-white: #FFFFFF;
    --ios-red: #FF3B30;
    --ios-green: #34C759;
    
    /* Theme Colors - werden von Dark Mode überschrieben */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --bg-tertiary: #E5E5EA;
    --bg-input: #E5E5EA;
    --text-primary: #000000;
    --text-secondary: #3C3C43;
    --text-tertiary: #8E8E93;
    --text-placeholder: #8E8E93;
    --border-color: #E5E5EA;
    --border-color-light: #F0F0F0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-color: #333333;
    --accent-hover: #1a1a1a;
    --code-bg: #f5f5f5;
    --code-border: #e0e0e0;
    
    /* Scrollbar Colors */
    --scrollbar-track: transparent;
    --scrollbar-thumb: #d1d1d1;
    --scrollbar-thumb-hover: #b0b0b0;
}

/* Dark Mode Variables */
body.dark-mode {
    --ios-bg: #1C1C1E;
    --ios-white: #2C2C2E;
    --ios-gray-lighter: #3A3A3C;
    --ios-gray-light: #48484A;
    
    --bg-primary: #1C1C1E;
    --bg-secondary: #2C2C2E;
    --bg-tertiary: #3A3A3C;
    --bg-input: #3A3A3C;
    --text-primary: #FFFFFF;
    --text-secondary: #EBEBF5;
    --text-tertiary: #8E8E93;
    --text-placeholder: #636366;
    --border-color: #3A3A3C;
    --border-color-light: #2C2C2E;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-color: #FFFFFF;
    --accent-hover: #E5E5E5;
    --code-bg: #2d2d2d;
    --code-border: #404040;
    
    /* Scrollbar Colors - Dark Mode */
    --scrollbar-track: transparent;
    --scrollbar-thumb: #4d4d4f;
    --scrollbar-thumb-hover: #636366;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: var(--ios-bg);
    color: #000;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Login */
/* Disable animations when requested */
.auth-container.no-animation,
.auth-container.no-animation .auth-card,
.auth-container.no-animation .auth-card h1,
.auth-container.no-animation .auth-subtitle,
.auth-container.no-animation .auth-form {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    /* Foggy Spotlight Effect */
    background-color: #e6e9f0;
    background-image: radial-gradient(circle at center, #ffffff 0%, #e6e9f0 50%, #d0dbe7 100%);
    background-size: 140% 140%;
    animation: fogPulse 15s ease-in-out infinite alternate;
}

.auth-card.elia-gpt-style {
    background: #ffffff;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    /* Strong 3D Shadow */
    box-shadow: 
        0 20px 40px -10px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    text-align: center;
    animation: cardEntrance 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.auth-header {
    margin-bottom: 32px;
    animation: contentSlideUp 0.6s ease-out 0.2s backwards;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.logo-icon {
    color: #2d3748;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a202c;
}

.auth-subtitle {
    font-size: 14px;
    color: #718096;
}

.form-container-inner {
    background: #f7fafc; /* Inner gray box */
    padding: 24px;
    border-radius: 16px;
    text-align: left;
    animation: contentSlideUp 0.6s ease-out 0.4s backwards;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    margin-bottom: 0;
}

.static-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #4a5568;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.15);
}

.password-input-wrapper {
    position: relative;
}

.password-input {
    padding-right: 40px;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d00e17;
    font-size: 14px;
    margin-top: 8px;
}

.error-icon {
    flex-shrink: 0;
}

.form-actions {
    text-align: center;
    margin-top: 4px;
}

.forgot-password-link {
    color: #5a67d8; /* Matching Blue link color */
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
    color: #4c51bf;
}

/* Remember Me Toggle Switch */
.remember-me-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.remember-me-container input[type="checkbox"] {
    display: none;
}

.remember-me-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #cbd5e0;
    border-radius: 24px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.remember-me-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.remember-me-container input[type="checkbox"]:checked + .remember-me-slider {
    background-color: #5a67d8;
}

.remember-me-container input[type="checkbox"]:checked + .remember-me-slider::before {
    transform: translateX(20px);
}

.remember-me-label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

/* Password Requirements List */
.password-requirements {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #718096;
    transition: color 0.2s;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.requirement-item.valid {
    color: #38a169; /* Green */
}

.requirement-item.invalid {
    color: #e53e3e; /* Red */
}

.requirement-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Blue Login Button */
.btn-login-blue {
    background-color: #5a67d8; /* Indigo/Blue like screenshot */
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
    border: none;
    margin-top: 8px;
    transition: background-color 0.2s;
    cursor: pointer;
    width: 100%;
}

.btn-login-blue:hover {
    background-color: #4c51bf;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}


/* Navbar */
.navbar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ios-gray-lighter);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    color: #000;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.navbar-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.navbar-link {
    color: #333333;
    text-decoration: none;
    font-size: 15px;
}

/* Alerts */
.alert {
    padding: 16px 24px;
    text-align: center;
    font-weight: 500;
}

.alert-success {
    background: var(--ios-green);
    color: white;
}

.alert-error {
    background: var(--ios-red);
    color: white;
}

/* Auth-spezifische Alerts - schlicht ohne Hintergrund/Rahmen */
.auth-container .alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 0;
}

.auth-container .alert svg {
    flex-shrink: 0;
    margin-top: 1px;
    width: 20px;
    height: 20px;
}

.auth-container .alert-success {
    color: #059669;
    background: transparent;
}

.auth-container .alert-success svg {
    color: #059669;
}

.auth-container .alert-error {
    color: #dc2626;
    background: transparent;
}

.auth-container .alert-error svg {
    color: #dc2626;
}

/* Chat Container */
.chat-container {
    display: flex;
    height: calc(100vh - 61px);
    background: var(--ios-bg);
}

/* Sidebar */
.chat-sidebar {
    width: 320px;
    background: var(--ios-white);
    border-right: 1px solid var(--ios-gray-lighter);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--ios-gray-lighter);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.btn-new-chat {
    background: #333;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.session-list {
    flex: 1;
    overflow-y: auto;
}

.session-item-wrapper {
    position: relative;
}

.session-item {
    padding: 16px 24px;
    border-bottom: 1px solid var(--ios-gray-lighter);
    cursor: pointer;
    text-decoration: none;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-item:hover {
    background: var(--ios-bg);
}

.session-item.active {
    background: #e5e5ea;
    color: #1d1d1f;
}

.session-content {
    flex: 1;
    min-width: 0;
}

.session-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-date {
    font-size: 13px;
    color: var(--ios-gray);
}

.session-item.active .session-date {
    color: rgba(255,255,255,0.7);
}

.session-menu-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    opacity: 1; /* Default: Visible (Mobile) */
    transition: opacity 0.2s;
}

/* Desktop Hover */
@media (hover: hover) {
    .session-menu-btn {
        opacity: 0;
    }
    
    .session-item:hover .session-menu-btn {
        opacity: 1;
    }
}

.session-dropdown {
    position: absolute;
    right: 24px;
    top: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s;
}

.session-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-item {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 15px;
}

.dropdown-item:hover {
    background: var(--ios-bg);
}

.dropdown-item.danger {
    color: var(--ios-red);
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    padding: 24px;
    border-bottom: 1px solid var(--ios-gray-lighter);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-size: 20px;
    font-weight: 700;
}

.chat-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.token-counter {
    font-size: 13px;
    padding: 6px 12px;
    background: var(--ios-bg);
    border-radius: 999px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 15px;
}

.btn-secondary {
    background: var(--ios-bg);
    color: #000;
}

.btn-danger {
    background: var(--ios-red);
    color: white;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 70%;
}

.message-user {
    align-self: flex-end;
}

.message-assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
}

.message-user .message-content {
    background: #F4F4F4;
    color: #000000;
    border-bottom-right-radius: 4px;
}

.message-assistant .message-content {
    background: transparent;
    color: #000;
    border-radius: 0;
}

.message-meta {
    font-size: 11px;
    color: var(--ios-gray);
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--ios-gray-lighter);
    border-radius: 16px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--ios-gray);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Input Area - RUNDES EINGABEFELD */
.chat-input-area {
    background: white;
    border-top: 1px solid var(--ios-gray-lighter);
    padding: 16px 24px;
}

.document-preview {
    background: var(--ios-bg);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-remove {
    background: var(--ios-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--ios-gray-lighter);
    border-radius: 24px;
    padding: 8px 12px;
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper textarea {
    flex: 1;
    resize: none;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 17px;
    font-family: inherit;
    color: #000;
    max-height: 120px;
    line-height: 1.4;
}

.input-wrapper textarea:focus {
    outline: none;
}

.btn-send {
    background: #333333;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
    background: #1a1a1a;
    transform: scale(1.05);
}

.btn-send:disabled {
    opacity: 0.5;
}

/* Empty State */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.chat-empty h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.chat-empty p {
    color: var(--ios-gray);
    margin-bottom: 32px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.modal h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal p {
    color: var(--ios-gray);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 16px;
}

.modal-actions .btn {
    flex: 1;
}

.no-sessions {
    padding: 32px;
    text-align: center;
    color: var(--ios-gray);
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Entrance Animations (Super Fancy)
   ============================================ */

/* Card Entrance with a bit of pop */
@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
        filter: blur(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Content Slide Up Staggered */
@keyframes contentSlideUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroBlurIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes inputSlideUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animations only in empty state AND animate-entrance (New Chat / Login) */
.chat-interface-wrapper.empty-state.animate-entrance .chat-title {
    animation: heroBlurIn 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    will-change: transform, opacity, filter;
    
    /* Fancy Text Gradient */
    background: linear-gradient(135deg, #000000 0%, #434343 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-interface-wrapper.empty-state.animate-entrance .input-area-wrapper {
    animation: inputSlideUp 1s cubic-bezier(0.19, 1, 0.22, 1) 0.2s forwards; /* 0.2s delay */
    opacity: 0; /* Hidden initially for the delay */
    will-change: transform, opacity;
}

/* Ensure visibility in non-empty state */
.input-area-wrapper {
    opacity: 1;
}

/* ============================================
   Login Background Animation
   ============================================ */
@keyframes fogPulse {
    0% {
        background-size: 130% 130%;
        background-position: 50% 50%;
    }
    100% {
        background-size: 160% 160%;
        background-position: 50% 55%;
    }
}

/* ============================================
   Mobile Responsive Adjustments
   ============================================ */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px;
        border-radius: 20px;
    }
    
    .auth-card h1 {
        font-size: 20px; /* Smaller font to fit title in one line */
        letter-spacing: -0.3px;
        white-space: normal; /* Allow wrapping on mobile */
        overflow: visible;
        text-overflow: clip;
    }
    
    .auth-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .form-container-inner {
        padding: 16px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS input focus (needs 16px+) */
    }
    
/* Auth Alerts auf Mobile - sicherstellen dass sie sichtbar sind */
    .auth-container .alert {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 12px 0;
        margin-bottom: 16px;
        font-size: 13px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .auth-container .alert-error {
        color: #dc2626 !important;
    }

    .auth-container .alert-success {
        color: #059669 !important;
    }
    
    .auth-container .alert svg {
        width: 18px;
        height: 18px;
        min-width: 18px;
        flex-shrink: 0;
    }
    
    .auth-container .alert span {
        flex: 1;
        min-width: 0;
        color: inherit !important;
        display: block; /* Ensure it takes up space */
    }
    
    /* Error message auf Mobile */
    .error-message {
        font-size: 13px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Sicherstellen dass Alerts immer sichtbar sind wenn no-animation aktiv */
.auth-container.no-animation .alert,
.auth-container.no-animation .error-message {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.auth-container.no-animation .form-container-inner {
    opacity: 1 !important;
    animation: none !important;
}

.auth-container.no-animation .auth-header {
    opacity: 1 !important;
    animation: none !important;
}

/* Alerts immer sichtbar - unabhängig von Animation */
.auth-container .alert {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Mobile: Animationen aktiviert lassen, nur Layout-Anpassungen */
@media (max-width: 768px) {
    /* Alerts sicherstellen */
    .auth-container .alert {
        display: flex !important;
        visibility: visible !important;
        position: relative !important;
    }
    
    .auth-container .error-message {
        display: flex !important;
        visibility: visible !important;
    }
}

/* ============================================
   Global Scrollbar Styling
   ============================================ */
/* Webkit Scrollbars (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Firefox Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ============================================
   DARK MODE STYLES
   ============================================ */

/* Body Dark Mode Base */
body.dark-mode {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Auth Container Dark Mode */
body.dark-mode .auth-container {
    background-color: #1C1C1E;
    background-image: radial-gradient(circle at center, #2C2C2E 0%, #1C1C1E 50%, #000000 100%);
}

body.dark-mode .auth-card.elia-gpt-style {
    background: #2C2C2E;
    box-shadow: 
        0 20px 40px -10px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

body.dark-mode .auth-card h1 {
    color: #FFFFFF;
}

body.dark-mode .auth-subtitle {
    color: #8E8E93;
}

body.dark-mode .form-container-inner {
    background: #3A3A3C;
}

body.dark-mode .static-label {
    color: #EBEBF5;
}

body.dark-mode .form-input {
    background: #2C2C2E;
    border-color: #48484A;
    color: #FFFFFF;
}

body.dark-mode .form-input:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.25);
}

body.dark-mode .form-input::placeholder {
    color: #636366;
}

body.dark-mode .password-toggle-btn {
    color: #8E8E93;
}

body.dark-mode .remember-me-label {
    color: #EBEBF5;
}

body.dark-mode .remember-me-slider {
    background-color: #48484A;
}

body.dark-mode .password-requirements {
    background: #2C2C2E;
    border-color: #48484A;
}

body.dark-mode .requirement-item {
    color: #8E8E93;
}

body.dark-mode .forgot-password-link {
    color: #818cf8;
}

body.dark-mode .forgot-password-link:hover {
    color: #a5b4fc;
}

body.dark-mode .logo-text {
    color: #FFFFFF;
}

body.dark-mode .logo-icon {
    color: #FFFFFF;
}

/* Navbar Dark Mode */
body.dark-mode .navbar {
    background: rgba(28, 28, 30, 0.9);
    border-bottom-color: var(--border-color);
}

body.dark-mode .navbar-brand a {
    color: var(--text-primary);
}

body.dark-mode .navbar-link {
    color: var(--text-secondary);
}

/* Chat Elements Dark Mode */
body.dark-mode .chat-container {
    background: var(--bg-primary);
}

body.dark-mode .chat-sidebar {
    background: var(--bg-secondary);
    border-right-color: var(--border-color);
}

body.dark-mode .chat-main {
    background: var(--bg-primary);
}

body.dark-mode .chat-header {
    border-bottom-color: var(--border-color);
}

body.dark-mode .chat-title {
    color: var(--text-primary);
}

body.dark-mode .chat-messages {
    background: var(--bg-primary);
}

body.dark-mode .message-content {
    color: var(--text-primary);
}

body.dark-mode .message-user .message-content {
    background: #3A3A3C;
    color: #FFFFFF;
}

body.dark-mode .message-assistant .message-content {
    background: transparent;
    color: #FFFFFF;
}

body.dark-mode .message-meta {
    color: var(--text-tertiary);
}

/* Chat Input Dark Mode */
body.dark-mode .chat-input-area {
    background: var(--bg-primary);
    border-top-color: var(--border-color);
}

body.dark-mode .input-wrapper {
    background: var(--bg-tertiary);
}

body.dark-mode .input-wrapper textarea {
    color: var(--text-primary);
}

body.dark-mode .input-wrapper textarea::placeholder {
    color: var(--text-placeholder);
}

body.dark-mode .btn-send {
    background: #FFFFFF;
    color: #000000;
}

body.dark-mode .btn-send:hover:not(:disabled) {
    background: #E5E5E5;
}

/* Document Preview Dark Mode */
body.dark-mode .document-preview {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Token Counter Dark Mode */
body.dark-mode .token-counter {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Buttons Dark Mode */
body.dark-mode .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Session Items Dark Mode */
body.dark-mode .session-item {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

body.dark-mode .session-item:hover {
    background: var(--bg-tertiary);
}

body.dark-mode .session-item.active {
    background: #3A3A3C;
    color: #FFFFFF;
}

body.dark-mode .session-date {
    color: var(--text-tertiary);
}

body.dark-mode .session-dropdown {
    background: var(--bg-secondary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .dropdown-item {
    color: var(--text-primary);
}

body.dark-mode .dropdown-item:hover {
    background: var(--bg-tertiary);
}

/* Modal Dark Mode */
body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

body.dark-mode .modal {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .modal h3 {
    color: var(--text-primary);
}

body.dark-mode .modal p {
    color: var(--text-secondary);
}

/* Empty State Dark Mode */
body.dark-mode .chat-empty h2 {
    color: var(--text-primary);
}

body.dark-mode .chat-empty p {
    color: var(--text-tertiary);
}

body.dark-mode .no-sessions {
    color: var(--text-tertiary);
}

/* Typing Indicator Dark Mode */
body.dark-mode .typing-indicator {
    background: var(--bg-tertiary);
}

body.dark-mode .typing-dot {
    background: var(--text-tertiary);
}

/* Alert Dark Mode */
body.dark-mode .alert-warning {
    background: #78350f;
    color: #fde68a;
}

/* Dark Mode Title Gradient */
body.dark-mode .chat-interface-wrapper.empty-state.animate-entrance .chat-title {
    background: linear-gradient(135deg, #FFFFFF 0%, #A0A0A0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* PWA Install Button Dark Mode */
body.dark-mode .pwa-install-btn {
    background: #FFFFFF;
    color: #000000;
}

body.dark-mode .pwa-install-btn:hover {
    background: #E5E5E5;
}

body.dark-mode .ios-install-banner {
    background: #2C2C2E;
}

body.dark-mode .ios-install-banner-title {
    color: #FFFFFF;
}

body.dark-mode .ios-install-banner-desc {
    color: #8E8E93;
}

body.dark-mode .ios-install-banner-close {
    background: #3A3A3C;
    color: #8E8E93;
}

body.dark-mode .ios-install-banner-close:hover {
    background: #48484A;
}

body.dark-mode .ios-install-banner-icon {
    background: #3A3A3C;
}
