:root {
    --bg-color: #0b0b0d;
    --accent-color: #7c4dff;
    --accent-glow: rgba(124, 77, 255, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #9aa0a6;
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: #111114;
    --user-bubble: #2d2d35;
    --ai-bubble: rgba(124, 77, 255, 0.05);
    --hover-bg: rgba(255, 255, 255, 0.03);
    --success-color: #00e676;
}

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-primary);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}


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

/* 3D Animated Background */
#dotted-surface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background-color: #050505; /* Base color now here */
}

#dotted-surface.mobile-bg {
    background: radial-gradient(circle at center, #111114 0%, #050505 100%);
    background-size: cover;
}

/* Updated Layout */
.app-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: row;
    background: transparent;
}

/* Sidebar Styling - Expanded for History */
.side-nav {
    width: 260px;
    height: 100%;
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden; /* Prevent overall sidebar scroll */
}

#sidebar-main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Crucial for nested scroll */
    overflow-y: hidden;
}

#sidebar-placeholder {
    height: 100%;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px 24px 12px;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Libre Baskerville', serif;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.sidebar-logo {
    height: 22px;
    width: auto;
    display: block;
    object-fit: contain;
}

.logo-o {
    height: 1.1em;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0 -0.05em;
    position: relative;
    top: -0.05em;
}

/* Actions Groups */
.top-actions, .nav-groups {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.action-item, .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.action-item:hover, .nav-item:hover {
    background: #212121;
    color: var(--text-primary);
}

.action-item .icon, .nav-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: inherit;
}

/* History/Recents Section */
.history-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    overflow-y: auto;
    scrollbar-width: none;
}

.history-section::-webkit-scrollbar {
    display: none;
}

.section-label {
    font-size: 0.8rem;
    color: #888;
    padding: 8px 12px;
    font-weight: 500;
}

.history-item {
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #ccc;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.history-item .item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.history-item.active {
    background: rgba(124, 77, 255, 0.15);
    color: #b388ff;
    font-weight: 500;
}

.history-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.history-action-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.history-action-btn.delete:hover {
    color: #ff5252;
}

/* Image Upload & Preview Styling */
.input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.left-tools, .right-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.image-preview-container {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
}

.image-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-img-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
}

.remove-img-btn:hover {
    background: #ff5252;
}

.ai-message-img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}



/* Profile Footer */
.profile-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.user-avatar-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.75rem;
    color: #888;
}

.footer-icons {
    display: flex;
    gap: 4px;
}

.icon-btn {
    border: none;
    color: #8e8e8e !important; /* Force premium muted grey */
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure SVG inside uses the color */
.icon-btn svg {
    stroke: currentColor !important;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

/* Collapsed State */
.side-nav.collapsed {
    width: 68px;
    padding: 12px 8px;
}

.side-nav.collapsed .brand-name,
.side-nav.collapsed .label,
.side-nav.collapsed .section-label,
.side-nav.collapsed .user-details,
.side-nav.collapsed .footer-icons {
    display: none;
}

.side-nav.collapsed .sidebar-header {
    justify-content: center;
    padding: 12px 0 24px 0;
}

.side-nav.collapsed .action-item,
.side-nav.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

.side-nav.collapsed .action-item .icon,
.side-nav.collapsed .nav-item .icon {
    width: auto;
    font-size: 1.2rem;
}

.side-nav.collapsed .history-item {
    display: none;
}

.side-nav.collapsed .profile-footer {
    justify-content: center;
    padding: 16px 0;
}


.profile-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Collapsed Support for Guest View */
.side-nav.collapsed #sidebar-guest-view {
    padding: 24px 0;
    display: flex;
    justify-content: center;
}

.side-nav.collapsed .guest-container {
    padding: 12px 4px;
    background: transparent !important;
    border: none !important;
    align-items: center;
    box-shadow: none !important;
}

.side-nav.collapsed .guest-container h3,
.side-nav.collapsed .guest-container p,
.side-nav.collapsed .guest-container .label {
    display: none !important;
}

.side-nav.collapsed .guest-container button {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 8px;
}

.side-nav.collapsed .user-info,
.side-nav.collapsed .settings-btn {
    display: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--hover-bg);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-btn {
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.7;
}

/* Main Content Area */
/* Memory Suggestion UI - Inline Premium */
.memory-suggestion-card {
    background: rgba(44, 44, 46, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 16px;
    margin: 8px 12px 16px 56px; /* Align with AI message bubble */
    max-width: fit-content;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideUpFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    transition: all 0.4s ease;
}

.memory-suggestion-card.saved {
    background: rgba(0, 230, 118, 0.1);
    border-color: rgba(0, 230, 118, 0.3);
    transform: scale(0.98);
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.suggestion-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.memory-suggestion-card.saved .suggestion-icon {
    color: #00e676;
    transform: scale(1.2);
}

.suggestion-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.suggestion-content {
    font-size: 0.95rem;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 12px;
}

.suggestion-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: -8px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.suggestion-actions {
    display: flex;
    gap: 10px;
    transition: all 0.3s ease;
}

.memory-suggestion-card.saved .suggestion-actions {
    display: none;
}

.suggestion-btn {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.suggestion-btn.approve {
    background: var(--accent-color);
    color: #fff;
}

.suggestion-btn.approve:hover {
    background: var(--accent-hover);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.suggestion-btn.dismiss {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
}

.suggestion-btn.dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.saved-state {
    display: none;
    align-items: center;
    gap: 8px;
    color: #00e676;
    font-weight: 600;
    font-size: 0.9rem;
}

.memory-suggestion-card.saved .saved-state {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .memory-suggestion-card {
        margin: 8px 12px 16px 12px;
        max-width: none;
    }
}

.memory-suggestion-container {
    position: fixed;
    bottom: 120px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    pointer-events: none;
}

.memory-suggestion-card.hidden {
    opacity: 0;
    transform: translateX(50px);
    pointer-events: none;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 768px) {
    .memory-suggestion-container {
        left: 16px;
        right: 16px;
        bottom: 100px;
        max-width: none;
    }
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    max-width: none;
    margin: 0;
    padding: 0 40px;
    height: 100%;
    transition: padding 0.3s ease;
    min-width: 0; /* Ensures the flex child can shrink smaller than its content */
}

header {
    width: 100%;
    max-width: 900px;
    padding: 24px 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    z-index: 10;
}

.mobile-only {
    display: none !important;
}

#mobile-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header {
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.sidebar-header span {
    font-weight: 600;
    font-size: 0.9rem;
}

#close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 95;
    animation: fadeIn 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }

    .side-nav {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px !important; /* Force full width on mobile */
        background: #0d0d0f;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        display: flex; /* Ensure it's flex when showing */
        padding: 24px; /* Restore padding */
        z-index: 1000;
    }

    .side-nav.active {
        left: 0;
    }

    /* Force visibility of labels on mobile active state */
    .side-nav.active .brand-name,
    .side-nav.active .label,
    .side-nav.active .section-label,
    .side-nav.active .user-details,
    .side-nav.active .footer-icons {
        display: flex !important;
    }

    .side-nav.active .sidebar-header {
        justify-content: space-between !important;
        padding: 0 0 24px 0 !important;
    }

    .side-nav.active .nav-item {
        justify-content: flex-start !important;
        padding: 12px 16px !important;
    }

    #current-chat-title {
        display: none !important;
    }


    .side-nav.active .history-item {
        display: flex !important;
    }

    .toggle-sidebar {
        display: none; /* Hide desktop toggle on mobile */
    }

    .main-content {
        padding: 0 16px;
    }
    
    header {
        padding: 16px 0;
        justify-content: center !important;
    }

    .header-left {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    #mobile-menu-btn {
        position: absolute !important;
        left: 0;
        z-index: 10;
    }

    .welcome-message h2 { font-size: 2.2rem; }

    footer {
        padding: 0 0 24px 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 24px) !important;
        gap: 8px;
    }

    .input-container {
        padding: 12px;
        margin-bottom: 12px;
    }
}

.logo h1 {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Center Content */
main {
    flex: 1;
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px 0;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
    min-width: 0; /* Prevents overflow from wide children */
}

main::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.welcome-message {
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.welcome-message h2 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    opacity: 0.7;
}

/* New Modern Input System */
footer {
    width: 100%;
    max-width: 768px;
    padding: 0 0 100px 0; /* Further increased for desktop */
    padding-bottom: env(safe-area-inset-bottom, 100px);
    margin-bottom: 30px; /* Added significant margin for spacing */
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    z-index: 10;
}

.input-container {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: border-color 0.3s ease;
}

.input-container:focus-within {
    border-color: rgba(124, 77, 255, 0.5);
}

textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.5;
    padding: 8px 0;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 300px;
}

.input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.tool-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

#send-btn, #stop-btn, #mic-btn {
    background: #1e1e22;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

#send-btn:not(:disabled) {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

#mic-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    transition: all 0.3s ease;
}

#mic-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

#mic-btn.listening {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    animation: pulseRed 1.5s infinite;
}

#mic-btn.listening .bar-1 { animation: waveAnim 1.2s infinite ease-in-out; }
#mic-btn.listening .bar-2 { animation: waveAnim 1.0s infinite ease-in-out 0.2s; }
#mic-btn.listening .bar-3 { animation: waveAnim 0.8s infinite ease-in-out 0.1s; }
#mic-btn.listening .bar-4 { animation: waveAnim 1.4s infinite ease-in-out 0.3s; }

@keyframes waveAnim {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

#mic-btn svg {
    overflow: visible;
}

.wave-bar {
    transform-origin: center;
    transition: transform 0.3s ease;
}

#stop-btn {
    background: #ff5252;
    border-color: #ff5252;
    color: white;
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Model Selector Styles */
.model-selector-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.model-selector-wrapper:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

#current-model-display {
    color: #cecece;
    font-size: 0.85rem;
    font-weight: 500;
}

.select-chevron {
    color: #8e8e8e;
    transition: transform 0.2s;
}

.model-selector-wrapper.active .select-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.model-dropdown {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: rgba(18, 18, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    transform-origin: bottom right;
    animation: dropdownPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.model-dropdown.hidden {
    display: none;
}

.model-item {
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.model-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.model-item.active {
    background: rgba(124, 77, 255, 0.1);
}

.model-info {
    flex: 1;
}

.model-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.model-desc {
    color: #8e8e8e;
    font-size: 0.75rem;
    line-height: 1.2;
}

.check-icon {
    color: #7c4dff;
    opacity: 0;
    transition: opacity 0.2s;
}

.model-item.active .check-icon {
    opacity: 1;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 8px;
}

.extended-thinking-toggle {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.toggle-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.toggle-desc {
    color: #8e8e8e;
    font-size: 0.75rem;
}

/* Modern Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #7c4dff;
}

input:focus + .slider {
    box-shadow: 0 0 1px #7c4dff;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

#send-btn:hover:not(:disabled), #stop-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px var(--accent-glow);
}



/* Message Styles - Centered Column */
#messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 20px;
    width: 100%;
    max-width: 900px;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 95%; /* Increased from 85% to give more room for code */
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.message-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message-wrapper.ai {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.message {
    font-size: 1rem;
    line-height: 1.6;
    animation: fadeIn 0.4s ease-out;
    word-break: break-word; /* Ensure long words wrap */
    overflow-wrap: break-word;
}

.message.user {
    color: var(--text-primary);
    background: linear-gradient(135deg, #4f46e5 0%, #7c4dff 100%);
    padding: 10px 20px;
    border-radius: 20px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.2);
}

.message.ai {
    color: var(--text-primary);
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important; /* Force items to stick to the left */
    gap: 16px;
    width: 100%;
}

/* Claude-Style Code Cards - Rebuilt */
.code-card {
    background: #0d0d0d !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    margin: 12px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    display: block !important;
    text-align: left !important; /* Kill any inherited centering */
}

.code-header {
    background: #1a1a1a !important;
    padding: 0 16px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    height: 38px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.code-lang {
    font-size: 12px !important;
    color: #8e8e8e !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    text-transform: lowercase !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 500 !important;
}

.copy-button {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px !important;
    border-radius: 4px !important;
    transition: background 0.2s !important;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.copy-icon {
    width: 16px !important;
    height: 16px !important;
    stroke: #ffffff !important;
    stroke-width: 2px !important;
    display: block !important;
}

.copy-text {
    display: none !important;
}

.message.ai pre {
    padding: 20px 16px !important;
    margin: 0 !important;
    overflow-x: auto !important;
    font-family: 'SFMono-Regular', Consolas, "Liberation Mono", Menlo, Courier, monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    background: transparent !important;
    color: #e6edf3 !important;
    text-align: left !important;
}

.message-footer {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.footer-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.feedback-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.timestamp {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin: 0 4px;
}

/* Art Generator Specific */
#art-container {
    width: 100%;
    padding-top: 120px;
}

#image-display-area {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Animations */
/* Premium Typing Indicator */
.typing-indicator-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    align-self: flex-start;
    animation: fadeIn 0.3s ease;
    margin-bottom: 20px;
}

.typing-status {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 8px var(--accent-glow);
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

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


/* Auth Overlay System */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(20, 20, 23, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative; /* For absolute close button */
    max-height: 95vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.auth-card::-webkit-scrollbar {
    display: none;
}

.close-overlay-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-overlay-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.auth-header {
    text-align: center;
}

.auth-header h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--accent-color);
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-color);
}

.auth-submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #444;
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.social-btn img {
    width: 20px;
    height: 20px;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.social-btn.loading {
    opacity: 0.8;
    cursor: wait;
}

.close-auth-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.7;
    margin-top: 8px;
}

.close-auth-btn:hover {
    opacity: 1;
    color: white;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
        margin: 16px;
    }
}

/* Sidebar Guest View Styling */
#sidebar-guest-view {
    padding: 24px 8px;
    flex: 1;
}

.guest-container {
    background: rgba(124, 77, 255, 0.03);
    border: 1px solid rgba(124, 77, 255, 0.1);
    border-radius: 20px;
    padding: 32px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(5px);
}

.guest-container h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.guest-container p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    opacity: 0.8;
}

.guest-container .action-item {
    justify-content: center;
    padding: 14px;
    font-size: 0.9rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.guest-container .primary-btn {
    background: var(--accent-color) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 8px 20px var(--accent-glow);
}

.guest-container .primary-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px var(--accent-glow);
}

.guest-container .secondary-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.guest-container .secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-3px);
}

/* Premium Toast System */
.toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 450px;
    background: rgba(18, 18, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transform: translateX(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: scale(0.9) translateY(10px);
    opacity: 0;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.toast.success .toast-icon { color: #00e676; background: rgba(0, 230, 118, 0.1); }
.toast.error .toast-icon { color: #ff5252; background: rgba(255, 82, 82, 0.1); }
.toast.info .toast-icon { color: #40c4ff; background: rgba(64, 196, 255, 0.1); }

.toast-content {
    flex: 1;
    color: #efefef;
    font-size: 0.95rem;
    font-weight: 500;
}

.toast-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Success type accent line */
.toast.success::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #00e676;
    border-radius: 4px 0 0 4px;
}

.toast.error::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #ff5252;
    border-radius: 4px 0 0 4px;
}

/* Modern Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 100%;
    max-width: 400px;
    background: rgba(22, 22, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.modal-message {
    font-size: 0.95rem;
    color: #8e8e8e;
    line-height: 1.6;
    margin-bottom: 28px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 120px;
}

.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-btn.confirm {
    background: #ff5252;
    color: white;
}

.modal-btn.confirm:hover {
    background: #ff1744;
}
/* Recents Page Styles */
#recents-view {
    flex: 1;
    padding: 40px 60px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
    scrollbar-width: none;
}

#recents-view::-webkit-scrollbar { display: none; }

.recents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.recents-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.premium-btn {
    background: white;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.premium-btn:hover { transform: scale(1.05); }

.recents-search-wrapper {
    position: relative;
    margin-bottom: 40px;
}

.recents-search-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#recents-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 14px 14px 48px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

#recents-search-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.recents-container {
    display: flex;
    flex-direction: column;
}

.recent-chat-card {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: opacity 0.2s;
}

.recent-chat-card:hover {
    opacity: 0.8;
}

.recent-chat-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.recent-chat-card .timestamp {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#recents-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
}

/* Bulk Actions Bar */
.recents-bulk-bar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    animation: slideInBottom 0.3s ease;
}

.bulk-info {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.bulk-btns {
    display: flex;
    gap: 12px;
}

.bulk-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-btn.dangerous {
    background: #ff5252;
    color: white;
}

.bulk-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Card Updates */
.recent-chat-card {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 12px !important;
    border-radius: 12px !important;
    margin-bottom: 4px !important;
    transition: background 0.2s !important;
}

.recent-chat-card:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    opacity: 1 !important;
}

.recent-card-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.recent-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    accent-color: var(--accent-color);
}

.recent-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.recent-chat-card:hover .recent-actions {
    opacity: 1;
}

.recent-action-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: transparent;
    color: #8e8e8e;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.recent-action-btn:hover {
    background: white;
    color: black;
    border-color: white;
}

.recent-action-btn.delete:hover {
    background: #ff5252;
    color: white;
    border-color: #ff5252;
}

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

/* Profile Popup Claude-Style */
.profile-popup {
    position: absolute;
    bottom: 85px;
    left: 12px;
    right: 12px;
    background: #1a1a1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: popupFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.popup-header {
    padding: 12px 12px 10px;
}

.popup-email {
    font-size: 0.85rem;
    color: #8e8e8e;
    word-break: break-all;
    font-weight: 500;
}

.popup-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 6px 0;
}

.popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.popup-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.popup-item .icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

.popup-item.logout-trigger:hover {
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
}

#profile-trigger {
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 12px;
}

#profile-trigger:hover {
    background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 768px) {
    #recents-view {
        padding: 20px;
    }
    
    .recents-header h2 {
        font-size: 1.5rem;
    }
    .recent-actions {
        opacity: 1;
    }
}

/* Title Update Animation - Minimal & Smooth */
@keyframes titleFadeUp {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.title-updating {
    animation: titleFadeUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Premium Suggestion Prompt Card */
.suggestion-prompt-card {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: rgba(28, 28, 32, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90%;
    width: fit-content;
}

.suggestion-prompt-card.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.suggestion-prompt-card.hide {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.95);
    pointer-events: none;
}

.suggestion-icon-wrap {
    width: 36px;
    height: 36px;
    background: rgba(124, 77, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    flex-shrink: 0;
}

.suggestion-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestion-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

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

.suggestion-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.suggestion-btn.update {
    background: var(--accent-color);
    color: white;
}

.suggestion-btn.ignore {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.suggestion-btn:hover {
    filter: brightness(1.2);
}

/* Sidebar History Actions Enhancement */
.history-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    background: linear-gradient(to left, rgba(11, 11, 13, 0.9) 70%, transparent);
    padding-left: 10px;
}

.history-item:hover .history-actions {
    opacity: 1;
}

/* Claude-style Logo Typing Indicator */
.typing-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
}

.dots {
    display: inline-block;
    animation: dots-pulse 1.5s infinite;
}

@keyframes dots-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.typing-indicator {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    align-self: flex-start; /* Stick to the left within the messages container */
    padding: 20px 0; /* Align with AI message start padding */
    margin: 10px 0;
    animation: titleFadeUp 0.4s ease-out;
    width: 100%;
}

/* Chat Footer & Input Container Rebuild */
footer {
    width: 100%;
    max-width: 850px;
    padding: 0 0 24px 0;
    padding-bottom: env(safe-area-inset-bottom, 24px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
    flex-shrink: 0;
}

.input-container {
    background: #111114;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease;
}

.input-container:focus-within {
    border-color: rgba(124, 77, 255, 0.5);
}

.input-wrapper {
    display: flex;
    width: 100%;
}

textarea#user-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #cecece;
    font-size: 1.05rem;
    line-height: 1.5;
    padding: 8px 0;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 300px;
}

textarea#user-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.left-tools, .right-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

.tool-btn:hover {
    color: #fff;
}

#send-btn, #stop-btn {
    background: #1e1e22;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 16px;
    border-radius: 14px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#send-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.1);
}

#mic-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

#mic-btn:hover {
    color: #fff;
}

/* Voice Animation Classes */
#mic-btn.listening {
    color: #ef4444 !important;
}
#mic-btn.listening .bar-1 { animation: waveAnim 1.2s infinite ease-in-out; }
#mic-btn.listening .bar-2 { animation: waveAnim 1.0s infinite ease-in-out 0.2s; }
#mic-btn.listening .bar-3 { animation: waveAnim 0.8s infinite ease-in-out 0.1s; }
#mic-btn.listening .bar-4 { animation: waveAnim 1.4s infinite ease-in-out 0.3s; }

@keyframes waveAnim {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

#mic-btn svg {
    overflow: visible;
}

.wave-bar {
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* Settings Modal System */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.settings-container {
    width: 95%;
    max-width: 1000px;
    height: 700px;
    background: #0b0b0d !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-sidebar {
    width: 240px;
    background: #0d0d0f;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 32px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 16px;
    margin-bottom: 8px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.settings-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.settings-nav-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.settings-content {
    flex: 1;
    padding: 48px 60px;
    overflow-y: auto;
    position: relative;
    background: #0b0b0d;
}

.close-settings-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-settings-btn:hover {
    color: white;
}

.settings-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    max-width: 800px;
}

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

.settings-tab-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    background: #121214 !important; /* Force dark background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: white !important; /* Force white text */
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

/* Fix browser autofill changing input colors */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover, 
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #121214 inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-group select option {
    background-color: #0b0b0d;
    color: white;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.required {
    color: #ef4444;
}

/* Setting Items */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.setting-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.setting-info {
    flex: 1;
}

.setting-title {
    font-size: 1rem;
    font-weight: 500;
    color: white;
}

.setting-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 2px;
}

.settings-save-btn {
    background: white;
    color: black;
    border: none;
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

.settings-save-btn:hover {
    transform: scale(1.02);
}

.settings-action-btn {
    background: #1a1a1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-action-btn:hover {
    background: #2a2a2c;
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-action-btn.dangerous {
    color: #fff;
    background: #1a1a1c;
}

.settings-action-btn.dangerous:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* Table Style */
.sessions-table-wrapper {
    width: 100%;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sessions-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sessions-table td {
    padding: 14px 16px;
    color: #cecece;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.session-badge {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Privacy Card */
.privacy-intro-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.intro-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.intro-header svg {
    color: var(--text-secondary);
}

.intro-text {
    display: flex;
    flex-direction: column;
}

.intro-text strong {
    color: white;
}

.intro-text span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Billing & Demo Cards */
.plan-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.plan-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.plan-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.plan-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.plan-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #cecece;
}

.plan-features li svg {
    color: var(--accent-color);
}

.memory-card {
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
}

.memory-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.memory-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* App Loading Overlay */
.app-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 15px;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.app-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #262626 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text:last-child {
    width: 70%;
}

/* Radio Items */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.radio-item input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--accent-color);
}

.radio-title {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.radio-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .settings-container {
        flex-direction: column;
        height: 90vh;
    }
    .settings-sidebar {
        width: 100%;
        padding: 16px;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        gap: 8px;
    }
    .settings-header {
        display: none;
    }
    .settings-nav {
        flex-direction: row;
    }
    .settings-nav-item span {
        display: none;
    }
    .settings-nav-item {
        padding: 8px 12px;
    }
    .settings-content {
        padding: 16px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .memory-preview-list {
        max-height: 320px !important;
    }
    .memory-item-card {
        padding: 12px !important;
    }
    .memory-item-content {
        font-size: 0.9rem !important;
    }
    .memory-command-wrapper {
        margin-top: 12px !important;
        gap: 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .command-submit-btn,
    .settings-action-btn {
        width: 100% !important;
        height: 48px !important;
        display: flex !important;
        justify-content: center !important;
    }
    .setting-item-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 16px 0 !important;
    }
    .settings-tab-content h2 {
        font-size: 1.4rem !important;
        margin-bottom: 24px !important;
    }
    .section-title {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }
}

/* Memory Preview Styles */
.memory-preview-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 8px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.memory-preview-list::-webkit-scrollbar {
    width: 5px;
}

.memory-preview-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.memory-scroll-sentinel {
    display: flex;
    justify-content: center;
    padding: 16px;
}

.memory-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.memory-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(124, 77, 255, 0.3);
    transform: translateY(-2px);
}

.memory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memory-type-badge {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(124, 77, 255, 0.1);
    color: #7c4dff;
}

.memory-type-badge.identity { background: rgba(0, 230, 118, 0.1); color: #00e676; }
.memory-type-badge.project { background: rgba(33, 150, 243, 0.1); color: #2196f3; }
.memory-type-badge.preference { background: rgba(255, 171, 0, 0.1); color: #ffab00; }
.memory-type-badge.behavior { background: rgba(244, 67, 54, 0.1); color: #f44336; }

.memory-item-content {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.memory-empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

/* Memory Command UI */
.memory-command-wrapper {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
    align-items: center;
}

#memory-command-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

#memory-command-input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.1);
}

.command-submit-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    position: relative;
}

.command-submit-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

.command-submit-btn:active {
    transform: scale(0.95);
}

.command-submit-btn .loader-spinner {
    position: absolute;
}

.command-submit-btn.loading svg {
    opacity: 0;
}

/* ==========================================
   Memory Import Modal - Premium UI
   ========================================== */
.memory-import-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.memory-import-modal.hidden {
    display: none;
}

.import-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.import-modal-container {
    width: 90%;
    max-width: 600px;
    background: #0d0d0f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.import-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.import-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.import-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.import-close-btn:hover {
    color: white;
}

.import-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.import-step {
    display: flex;
    gap: 20px;
}

.step-num {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.prompt-box {
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    position: relative;
}

#export-prompt-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.6;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 40px;
}

.copy-prompt-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-prompt-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.copy-prompt-btn.copied {
    background: rgba(0, 230, 118, 0.1);
    border-color: #00e676;
    color: #00e676;
}

#memory-import-textarea {
    width: 100%;
    min-height: 180px;
    background: #09090b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    color: white;
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
    transition: all 0.2s;
    resize: none;
}

#memory-import-textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.1);
}

.import-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #0d0d0f;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.import-action-btn {
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.import-action-btn.cancel {
    background: transparent;
    color: var(--text-secondary);
}

.import-action-btn.cancel:hover {
    color: white;
}

.import-action-btn.primary {
    background: var(--accent-color);
    color: white;
}

.import-action-btn.primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.import-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .import-modal-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .import-modal-footer {
        border-radius: 0;
        position: sticky;
        bottom: 0;
    }
    .import-modal-body {
        padding: 20px;
    }
}

/* ==========================================
   Memory Summary Panel - Intelligence Profile
   ========================================== */
.memory-summary-panel {
    background: #0d0d0f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    margin: 24px 0;
    animation: fadeIn 0.4s ease;
}

.memory-summary-panel.hidden {
    display: none;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.summary-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-title-row svg {
    color: var(--accent-color);
}

.summary-title-row h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.summary-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

#summary-timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(30deg);
}

.refresh-btn.loading svg {
    animation: rotate 1s linear infinite;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s;
}

.summary-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Outdated State */
.memory-summary-panel.outdated {
    border-color: rgba(124, 77, 255, 0.4);
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.05);
}

@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .memory-summary-panel {
        padding: 16px;
        margin: 16px 0;
    }
    .summary-card {
        padding: 16px;
    }
    .summary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .summary-meta {
        width: 100%;
        justify-content: space-between;
    }
    #memory-import-textarea {
        min-height: 140px;
    }
    .import-modal-header {
        padding: 16px 20px;
    }
    .import-modal-body {
        padding: 16px 20px;
        gap: 24px;
    }
    .import-step {
        gap: 12px;
    }
    #export-prompt-text {
        font-size: 0.75rem;
        margin-bottom: 50px; /* Space for copy button */
    }
}

/* Export Data Styling */
.export-status-container {
    margin-top: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    animation: fadeIn 0.4s ease;
}

.export-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#export-status-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

#export-status-percent {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    font-variant-numeric: tabular-nums;
}

.export-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.export-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #b388ff);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-glow);
}

.export-status-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#export-stage-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

#export-timer-text {
    font-size: 0.8rem;
    color: #ffb74d;
    font-weight: 500;
}

.export-download-wrapper {
    margin-top: 20px;
    text-align: center;
    animation: slideUpFade 0.4s ease;
}

.export-download-wrapper .expiry-note {
    font-size: 0.75rem;
    color: #888;
    margin-top: 10px;
}

.settings-action-btn.primary {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.settings-action-btn.primary:hover {
    background: #6200ea !important;
    box-shadow: 0 4px 15px var(--accent-glow);
    transform: translateY(-1px);
}


/* --- LITE MODE (MOBILE OPTIMIZATION) --- */
.lite-mode * {
    transition-duration: 0.01s !important;
    animation-duration: 0.01s !important;
}

.lite-mode .side-nav,
.lite-mode .memory-suggestion-card,
.lite-mode .modal-overlay,
.lite-mode .search-overlay,
.lite-mode .profile-popup,
.lite-mode .model-dropdown {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: #0b0b0d !important;
    box-shadow: none !important;
}

.lite-mode .message.ai,
.lite-mode .recent-chat-card,
.lite-mode .history-item {
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.lite-mode .ai-thinking-logo {
    animation: none !important;
}

/* --- SKELETON UI (MOBILE OPTIMIZED) --- */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    width: 100%;
}

.skeleton-bubble {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}

.skeleton-bubble.s1 { width: 140px; height: 38px; }
.skeleton-bubble.s2 { width: 200px; height: 44px; align-self: flex-end; opacity: 0.6; }
.skeleton-bubble.s3 { width: 70%; height: 60px; }

.skeleton-bubble::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: skeleton-pulse 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes skeleton-pulse {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- MOBILE BACKGROUND FALLBACK --- */
.lite-mode #dotted-surface {
    background: radial-gradient(circle at center, rgba(124, 77, 255, 0.05) 0%, transparent 70%),
                var(--bg-color);
    background-size: cover;
}

.lite-mode .app-loader {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* --- Search Overlay (Command Palette) --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    padding-top: 15vh;
    animation: fadeIn 0.2s ease-out;
}

.search-modal {
    width: 100%;
    max-width: 650px;
    height: fit-content;
    max-height: 70vh;
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: searchFadeDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchFadeDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 1.1rem !important;
    outline: none !important;
    padding: 0 !important;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.6);
}

.search-result-item .icon {
    width: 20px;
    height: 20px;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-item:hover, .search-result-item.selected {
    background: rgba(124, 77, 255, 0.1);
    color: #fff;
}

.search-result-item.selected .icon {
    opacity: 1;
    color: #7c4dff;
}

.search-result-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-top: 2px;
}

.search-empty {
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.search-footer {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 20px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

.search-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    margin-right: 4px;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
    .search-overlay {
        padding: 0;
        align-items: flex-start;
    }
    .search-modal {
        max-width: none;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
}

/* --- Search Refinements --- */
.search-overlay {
    padding-top: 10vh !important; /* Move higher but still centered-ish */
}

.search-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }
    .search-footer {
        justify-content: center;
        padding: 16px;
    }
    .search-input-wrapper {
        padding: 12px 16px;
    }
}

/* --- Search perfection --- */
.search-overlay {
    padding-top: 0 !important;
    padding: 20px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important; /* PERFECT VERTICAL CENTER */
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important; /* Ensure it's on top of EVERYTHING */
}

.search-modal {
    margin-top: 0 !important; /* Remove any top margin */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

/* --- STRICT SEARCH REDESIGN --- */
.search-modal {
    max-width: 680px !important;
    background: #111113 !important; /* Slightly darker as per screenshot */
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.search-input-wrapper {
    padding: 18px 24px 8px 24px !important; /* Tightened bottom */
    gap: 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.search-input {
    font-size: 1.1rem !important;
    font-weight: 400 !important;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px !important; /* Reduced top gap */
    display: flex;
    flex-direction: column;
    gap: 2px !important;
}

.search-result-item {
    padding: 14px 24px !important;
    gap: 16px !important;
    border-radius: 14px !important;
}

.search-result-item .icon {
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
}

.search-result-item:hover, .search-result-item.selected {
    background: rgba(255, 255, 255, 0.05) !important;
}

.search-result-item.selected .icon {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.search-result-title {
    font-size: 1.05rem !important;
    font-weight: 600 !important; /* STRICT BOLD */
    color: #fff !important;
}

.search-result-meta {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
    margin-top: 4px !important;
}

.search-footer {
    padding: 16px 24px !important;
}

.search-hint kbd {
    background: #222 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* --- RECENTS PAGE --- */
.recents-page-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.recents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.recents-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.new-chat-btn.secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px; /* Fully rounded premium look */
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.new-chat-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.recents-search-wrapper {
    position: relative;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px; /* Consistent height */
}

.recents-search-wrapper .search-icon {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    color: #888;
}

.recents-search-input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    outline: none;
    font-size: 1rem;
    padding-left: 36px; /* Added padding to prevent icon overlap */
}

.selection-banner {
    background: #1a1a1c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.selection-count {
    font-weight: 600;
}

.selection-actions {
    display: flex;
    gap: 12px;
}

.bulk-delete-btn {
    background: #ff4b4b;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.cancel-selection-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.recents-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    position: relative;
}

.recents-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.recents-row.selected {
    background: rgba(124, 77, 255, 0.05);
}

.row-checkbox {
    margin-right: 20px;
}

.row-checkbox input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.row-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.row-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.row-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.row-actions {
    display: none;
    gap: 12px;
}

.recents-row:hover .row-actions {
    display: flex;
}

.row-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.row-action-btn.delete:hover {
    background: #ff4b4b;
    border-color: #ff4b4b;
}

.rename-input {
    background: var(--input-bg);
    border: 1px solid var(--accent-color);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1.1rem;
    width: 300px;
}

/* --- PREMIUM RECENTS UPGRADES --- */
.recents-page-container {
    position: relative;
    padding-top: 20px;
}

.selection-banner {
    position: sticky;
    top: 20px;
    z-index: 100;
    backdrop-filter: blur(16px);
    background: rgba(26, 26, 28, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease;
}

/* Custom Checkbox */
.row-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.row-checkbox input[type="checkbox"]:checked {
    background: #7c4dff;
    border-color: #7c4dff;
}

.row-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.row-checkbox input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* Loading Indicator */
.recents-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    gap: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #7c4dff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alignment Fixes */
.recents-row {
    border: 1px solid transparent;
}

.recents-row:hover {
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.04) !important;
}

.row-title {
    color: #fff;
    letter-spacing: -0.01em;
}

.row-meta {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* --- PREMIUM SETTINGS UPGRADE --- */
.settings-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
}

.settings-container {
    width: 90%;
    max-width: 1100px;
    height: 85vh;
    background: #0b0b0d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    display: flex;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.settings-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.settings-close-btn:hover {
    color: #fff;
}

.settings-layout {
    display: flex;
    width: 100%;
}

/* --- SETTINGS SIDEBAR --- */
.settings-sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
}

.sidebar-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 32px;
    padding-left: 12px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.settings-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.settings-nav .nav-item.active {
    background: rgba(124, 77, 255, 0.1);
    color: #7c4dff;
}

.settings-nav .nav-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- MAIN PANEL --- */
.settings-main {
    flex: 1;
    overflow-y: auto;
    padding: 48px 64px;
    background: transparent;
}

.settings-view h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.settings-section {
    margin-bottom: 48px;
}

.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

.form-group label .required {
    color: #ff4b4b;
}

.form-group input, .form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #7c4dff;
    background: rgba(255, 255, 255, 0.05);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}

/* --- BUTTONS --- */
.settings-btn-primary {
    background: #fff;
    color: #000;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.settings-btn-primary:hover:not(:disabled) {
    transform: scale(1.05);
}

.settings-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    cursor: pointer;
}

.settings-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-btn-danger {
    background: transparent;
    color: #ff4b4b;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 75, 75, 0.2);
    font-weight: 600;
    cursor: pointer;
}

.settings-btn-danger:hover {
    background: rgba(255, 75, 75, 0.1);
}

/* --- TOGGLES --- */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.toggle-info .description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #7c4dff;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* --- CARDS & TABLES --- */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
}

.sessions-table-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sessions-table th {
    text-align: left;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.sessions-table td {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.empty-table {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    padding: 40px !important;
}

.intelligence-profile .profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.intelligence-profile .meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.summary-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-card span {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    display: block;
}

.summary-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}

.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 32px 0;
}
