/* Design Variables */
:root {
    --bg-base: #0a0d18;
    --bg-sidebar: #0f1325;
    --bg-card: rgba(22, 28, 48, 0.45);
    --bg-input: rgba(15, 19, 37, 0.7);
    --bg-modal: rgba(10, 13, 24, 0.95);
    
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-glow: rgba(255, 91, 53, 0.25);
    
    --accent-color: #ff6c4b;
    --accent-glow: rgba(255, 108, 75, 0.4);
    --accent-gradient: linear-gradient(135deg, #ff9254 0%, #ff5230 100%);
    --bg-user-bubble: linear-gradient(135deg, #252e4d 0%, #171d33 100%);
    --bg-assistant-bubble: rgba(22, 28, 48, 0.35);
    
    --text-primary: #f5f6f9;
    --text-secondary: #a0aec0;
    --text-muted: #64748b;
    
    --sidebar-width: 280px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 91, 53, 0.25);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.logo-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 8px;
}

.logo-glow {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    filter: blur(8px);
    left: -2px;
    animation: pulseGlow 3s infinite ease-in-out;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-badge {
    font-size: 11px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    -webkit-text-fill-color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    filter: brightness(1.1);
}

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

.btn-primary i {
    width: 18px;
    height: 18px;
}

/* Chat History List */
.chat-history-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding-left: 12px;
    margin-bottom: 8px;
}

.chats-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.empty-history {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

.chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    color: var(--text-secondary);
    group: hover;
}

.chat-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.chat-item.active {
    background-color: var(--bg-card);
    border-color: rgba(255, 108, 75, 0.15);
    color: var(--text-primary);
    box-shadow: inset 0 0 10px rgba(255, 108, 75, 0.03);
}

.chat-item-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.chat-item-title-wrapper i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.chat-item-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-actions {
    display: none;
    align-items: center;
    gap: 4px;
}

.chat-item:hover .chat-item-actions,
.chat-item.active .chat-item-actions {
    display: flex;
}

.btn-icon-subtle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon-subtle:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-icon-subtle.delete:hover {
    color: #ff4a4a;
    background-color: rgba(255, 74, 74, 0.1);
}

.btn-icon-subtle i {
    width: 14px;
    height: 14px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-dot.disconnected {
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.btn-icon-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    width: 100%;
    transition: var(--transition-fast);
}

.btn-icon-label:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-icon-label i {
    width: 16px;
    height: 16px;
}

/* Main Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    position: relative;
}

/* Top Header Bar */
.chat-header {
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(10, 13, 24, 0.5);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.chat-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-model-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.provider-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 108, 75, 0.12);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 108, 75, 0.2);
}

.provider-badge.moonshot {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.model-name {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
}

/* Messages container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Welcome Screen */
.welcome-screen {
    max-width: 760px;
    margin: auto;
    padding: 0 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.welcome-logo-container {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
}

.welcome-logo {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    box-shadow: var(--shadow-glow);
    z-index: 2;
}

.welcome-logo-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-gradient);
    filter: blur(20px);
    border-radius: 20px;
    opacity: 0.6;
    z-index: 1;
    animation: logoGlow 4s infinite ease-in-out;
}

.welcome-screen h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
}

.suggested-prompts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 680px;
}

.suggest-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.suggest-card:hover {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.suggest-icon {
    background: rgba(255, 108, 75, 0.08);
    color: var(--accent-color);
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.suggest-icon i {
    width: 18px;
    height: 18px;
}

.suggest-content h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.suggest-content p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Chat bubble structures */
.message-row {
    width: 100%;
    display: flex;
    padding: 0 24px;
}

.message-wrapper {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    gap: 16px;
}

.avatar-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.message-row.user .avatar-wrapper {
    background: #2b3558;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message-row.assistant .avatar-wrapper {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 91, 53, 0.2);
}

.message-content-box {
    flex: 1;
    overflow: hidden;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 15px;
    color: var(--text-primary);
    word-break: break-word;
}

.message-row.user .message-bubble {
    background: var(--bg-user-bubble);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: inline-block;
}

.message-row.assistant .message-bubble {
    background: var(--bg-assistant-bubble);
    border: 1px solid var(--border-color);
}

/* Message Formatting inside bubbles */
.message-bubble p {
    margin-bottom: 12px;
}
.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.message-bubble li {
    margin-bottom: 6px;
}

.message-bubble pre {
    background-color: #0f1322 !important;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin: 16px 0;
    padding: 14px;
    overflow-x: auto;
    position: relative;
}

.message-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    background-color: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.message-bubble pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* Copy Code Button */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #161b30;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    padding: 8px 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 16px;
}

.code-header + pre {
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.btn-copy-code {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    transition: var(--transition-fast);
}

.btn-copy-code:hover {
    color: var(--text-primary);
}

.btn-copy-code i {
    width: 12px;
    height: 12px;
}

/* Streaming cursor */
.streaming-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: var(--accent-color);
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 0.8s infinite;
}

/* Chat Input Footer Area */
.chat-input-container {
    padding: 16px 24px 24px;
    background-color: transparent;
}

.chat-input-wrapper {
    max-width: 760px;
    margin: 0 auto;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.chat-input-wrapper:focus-within {
    border-color: rgba(255, 108, 75, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 12px rgba(255, 108, 75, 0.15);
}

.chat-input-wrapper textarea {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    width: 100%;
    max-height: 200px;
    min-height: 24px;
    padding: 8px 8px 4px;
}

.chat-input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

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

.input-info-badge {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.send-button {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    opacity: 0.5;
    pointer-events: none;
}

.send-button.active {
    opacity: 1;
    pointer-events: auto;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 91, 53, 0.3);
}

.send-button i {
    width: 16px;
    height: 16px;
}

/* Modals & Glassmorphism */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-modal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: modalAppear 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--accent-color);
    width: 20px;
    height: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 480px;
    overflow-y: auto;
}

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

.form-group label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
    width: 100%;
}

.form-control:focus {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.form-control-sm {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.form-control-sm:focus {
    border-color: var(--accent-color);
}

.api-key-input-wrapper {
    display: flex;
    gap: 8px;
}

.api-key-input-wrapper input {
    flex: 1;
}

.model-select-wrapper {
    display: flex;
    gap: 8px;
}

.model-select-wrapper select {
    flex: 1;
}

.form-slider {
    width: 100%;
    accent-color: var(--accent-color);
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.slider-label-container {
    display: flex;
    justify-content: space-between;
}

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

.text-area-large {
    resize: vertical;
    min-height: 80px;
}

.help-text {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.help-text a {
    color: var(--accent-color);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-primary-glow {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

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

/* Animations */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

@keyframes logoGlow {
    0%, 100% {
        filter: blur(20px);
        opacity: 0.5;
    }
    50% {
        filter: blur(28px);
        opacity: 0.8;
    }
}

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

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

/* Mobile only helper class */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }
    
    /* Toggle menu button styles */
    #sidebar-toggle-btn {
        margin-right: 12px;
        padding: 8px;
        border-radius: 8px;
    }
    
    /* Mobile Sidebar overlay */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        background-color: rgba(13, 17, 30, 0.96) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Sidebar Backdrop Overlay */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        z-index: 140;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        animation: fadeIn 0.2s ease;
    }
    
    .chat-area {
        width: 100%;
    }
    
    /* Suggested Prompts grid adaptation */
    .suggested-prompts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 100%;
        padding: 0 10px;
    }
    
    /* Welcomes & Logo */
    .welcome-container h1 {
        font-size: 26px;
    }
    
    .welcome-container p {
        font-size: 14px;
        padding: 0 15px;
    }
    
    /* Input Container Mobile styles */
    .input-container-wrapper {
        margin: 10px 15px 15px 15px;
        padding: 10px;
    }
    
    .input-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Modal adaptations */
    .modal-content {
        width: 92% !important;
        margin: 20px auto;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile header adaptations */
    .chat-header {
        padding: 0 12px;
        height: 56px;
        gap: 8px;
    }
    
    .chat-title-container {
        flex: 1;
        min-width: 0;
    }
    
    .chat-title {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    #edit-title-btn {
        flex-shrink: 0;
    }
    
    .header-model-info {
        flex-shrink: 0;
        gap: 6px;
    }
    
    .model-name {
        font-size: 12px;
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .provider-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: rgba(22, 28, 48, 0.9);
    border: 1px solid rgba(255, 108, 75, 0.3);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 200;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.25), opacity 0.3s ease;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 108, 75, 0.1);
}

.toast-notification.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Login Overlay CSS */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(16, 20, 38, 0.95) 0%, rgba(10, 12, 22, 0.98) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    text-align: center;
    animation: modalAppear 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.15) forwards;
}

.login-card h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-logo-container {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 20px auto;
}

.login-logo {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    box-shadow: var(--shadow-glow);
    z-index: 2;
}

.login-logo-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    border-radius: 20px;
    filter: blur(15px);
    opacity: 0.6;
    animation: logoGlow 4s infinite ease-in-out;
    z-index: 1;
}

.login-error-msg {
    color: #ff4a4a;
    font-size: 13px;
    font-weight: 500;
    margin-top: -8px;
    margin-bottom: 16px;
    display: none;
    animation: shake 0.3s ease;
}

.w-100 {
    width: 100%;
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 16px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.password-change-group {
    transition: var(--transition-normal);
}

.security-settings-group {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* System Stats Panel */
.system-stats-panel {
    margin: 5px 12px 10px 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.system-stats-panel:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.stats-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.stats-status-text {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.stats-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 500;
}

.stat-name {
    color: var(--text-secondary);
}

.stat-metrics {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
}

.stat-sep {
    color: rgba(255, 255, 255, 0.15);
}

.progress-bar-container {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
    background: linear-gradient(90deg, #10b981, #3b82f6);
}

.progress-bar.warning {
    background: linear-gradient(90deg, #3b82f6, #f59e0b);
}

.progress-bar.danger {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.icon-inline {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

