/* ========================================
   FROST COSMIC DESIGN SYSTEM
   Version 2.0 - Futuristic Neon Neo-Retro Minimalist Glassmorphic
   HyperKnowledge 3000 (hk3k)
   ======================================== */

/* ========== CSS Variables ========== */
:root {
    /* Frost Cosmic Color Palette */
    --deep-blue: #0D1B2A;
    --rich-blue: #1B2A41;
    --brand-blue: #2E4F7E;

    --vibrant-cyan: #00E5FF;
    --electric-cyan: #33EBFF;
    --glow-cyan: #66F0FF;
    --purple: #A78BFA;
    --royal-blue: #3B82F6;

    --white: #FFFFFF;
    --light-grey: #E8E8E8;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Universal Border Radius = 0 (Zero Compromise Geometry) */
    --border-radius: 0;

    /* Glassmorphism */
    --glass-fill: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-strong: rgba(255, 255, 255, 0.2);
    --cyan-glass-border: rgba(0, 229, 255, 0.15);
    --cyan-glass-border-strong: rgba(0, 229, 255, 0.3);

    /* Typography - Montserrat Required */
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-small: 0.875rem;
    --font-size-body: 0.9375rem;
    --font-size-heading: 1.125rem;

    /* Neon Glow System */
    --shadow-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.3);
    --shadow-glow-cyan-strong: 0 0 30px rgba(0, 229, 255, 0.6);
    --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.6);
    --shadow-glow-purple-strong: 0 0 40px rgba(139, 92, 246, 0.8);

    /* Transitions - Arcade Speed (0.15s for instant feedback) */
    --transition: all 0.15s ease;
    --transition-slow: all 0.3s ease;

    /* Z-Index Hierarchy */
    --z-header: 30;
    --z-sidebar: 20;
    --z-overlay: 15;
    --z-floating: 10;
    --z-content: 1;
}

/* ========== Base Styles ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--deep-blue);
    color: var(--white);
    font-size: var(--font-size-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Animations ========== */
@keyframes futuristicShimmer {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(200%) skewX(-15deg); }
}

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

@keyframes futuristicGlowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.6); }
    50% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.9); }
}

@keyframes arcadeButtonPress {
    0% { transform: translateY(-3px) scale(1.02); }
    40% { transform: translateY(2px) scale(0.95); }
    60% { transform: translateY(0) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
    }
    50% {
        box-shadow:
            0 0 30px rgba(167, 139, 250, 0.7),
            0 0 60px rgba(167, 139, 250, 0.3);
    }
}

/* ========== Buttons ========== */
.btn {
    padding: 0.75rem 1.5rem;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: var(--font-size-body);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    border-radius: 0;
    box-sizing: border-box; /* Border INSIDE, not centered */
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    transform: translateX(-100%) skewX(-15deg);
    z-index: -1;
    pointer-events: none;
}

.btn:hover::before {
    animation: futuristicShimmer 2s ease-in-out 1;
}

/* ========== AAA PRIMARY BUTTON - Top Tier Design ========== */
.btn-primary {
    /* AAA Sizing - Premium feel */
    height: 56px;
    padding: 14px 24px;
    min-width: 180px;
    box-sizing: border-box; /* Border INSIDE, not centered */

    /* AAA Typography - Bold and confident */
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
    text-transform: none;
    text-decoration: none; /* No underlines on button text */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* Frost Cosmic Purple base */
    background: var(--purple);
    border: 2px solid var(--purple);
    color: var(--white);

    /* Arcade glow - always pulsing */
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.6);
    animation: glowPulse 3s ease-in-out infinite;

    /* Instant arcade feedback */
    cursor: pointer;
    transition: all 0.1s linear;
    position: relative;
    overflow: hidden;
}

/* Arcade hover - INSTANT gradient explosion */
.btn-primary:hover {
    background: linear-gradient(135deg, #A78BFA 0%, #00E5FF 100%);
    border-color: #00E5FF;
    color: var(--deep-blue);
    text-decoration: none; /* Ensure no underlines on hover */
    box-shadow:
        0 0 30px rgba(0, 229, 255, 0.8),
        0 0 60px rgba(167, 139, 250, 0.4);
    transform: scale(1.05);
    animation: none; /* Stop pulse on hover */
}

/* Arcade press - satisfying feedback */
.btn-primary:active {
    transform: scale(0.98) translateY(2px);
    border-width: 3px;
    box-shadow: 0 0 40px rgba(0, 229, 255, 1.0);
    transition: all 0.05s linear; /* Even faster on press */
}

/* Keyboard focus - WCAG AAA */
.btn-primary:focus {
    outline: 3px dashed #00E5FF;
    outline-offset: 4px;
}

/* Disabled state */
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    animation: none;
}

/* ========== ARCADE LOADING STATE ========== */
.btn-primary.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-primary.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: arcadeSpinner 0.6s linear infinite;
}

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

/* Loading pulse effect */
.btn-primary.loading {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(167, 139, 250, 0.6); }
    50% { box-shadow: 0 0 40px rgba(0, 229, 255, 0.8); }
}

/* ========== AAA SECONDARY BUTTON - Glassmorphic Elegance ========== */
.btn-secondary {
    /* AAA Sizing - SAME HEIGHT as primary for consistency */
    height: 56px;
    padding: 14px 24px;
    min-width: 180px;
    box-sizing: border-box; /* Border INSIDE, not centered */

    /* AAA Typography - SemiBold confidence */
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.02em;
    text-decoration: none; /* No underlines on button text */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* Frost Cosmic glassmorphic base - nearly transparent cyan fill */
    background: rgba(0, 229, 255, 0.05);
    border: 2px solid rgba(0, 229, 255, 0.5);
    color: var(--white);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);

    /* Instant arcade feedback */
    cursor: pointer;
    transition: all 0.1s linear;
    position: relative;
    overflow: hidden;
}

/* Glassmorphic hover with scanline effect */
.btn-secondary:hover {
    background: rgba(0, 229, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid #00E5FF;
    color: #00E5FF;
    text-decoration: none; /* Ensure no underlines on hover */
    box-shadow:
        0 0 20px rgba(0, 229, 255, 0.5),
        0 0 40px rgba(0, 229, 255, 0.2);
    transform: scale(1.03);
}

/* Scanline sweep effect on hover */
.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 229, 255, 0.3) 50%, transparent 100%);
    transition: left 0.3s ease-out;
    pointer-events: none;
}

.btn-secondary:hover::after {
    left: 100%;
}

/* Arcade press */
.btn-secondary:active {
    transform: scale(0.98) translateY(2px);
    border-width: 3px;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.8);
    transition: all 0.05s linear;
}

/* Keyboard focus */
.btn-secondary:focus {
    outline: 3px dashed #00E5FF;
    outline-offset: 4px;
}

/* Disabled state */
.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Danger Button - Red Outline */
.btn-danger {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    box-sizing: border-box; /* Border INSIDE, not centered */
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #F87171;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px) scale(1.02);
}

.btn-danger:active {
    transform: translateY(0) scale(0.98);
}

/* Icon Button - Square Cyan Border */
.btn-icon {
    background: transparent;
    border: 2px solid var(--vibrant-cyan);
    color: var(--vibrant-cyan);
    border-radius: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    box-sizing: border-box; /* Border INSIDE, not centered */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--white);
    box-shadow: var(--shadow-glow-cyan);
}

/* Disabled State */
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== Inputs ========== */
.input-text,
.input-textarea,
.input-select,
.input-field {
    background: var(--glass-fill);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 0;
    color: var(--white);
    padding: 0.75rem 1rem;
    font-family: var(--font-family);
    font-weight: 400;
    font-size: var(--font-size-body);
    width: 100%;
    transition: var(--transition);
}

.input-text::placeholder,
.input-textarea::placeholder,
.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-text:focus,
.input-textarea:focus,
.input-select:focus,
.input-field:focus {
    outline: none;
    border-color: var(--vibrant-cyan);
    box-shadow: var(--shadow-glow-cyan), inset 0 0 30px rgba(0, 229, 255, 0.05);
}

.input-textarea {
    min-height: 120px;
    resize: vertical;
}

.input-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2300E5FF'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* ========== Cards ========== */
.card {
    background: var(--glass-fill);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 0;
    padding: 1.5rem;
    transition: var(--transition-slow);
}

.card:hover {
    border-color: var(--glass-border-strong);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========== Messages ========== */
.message {
    padding: 1rem 1.25rem;
    font-size: var(--font-size-body);
    line-height: 1.6;
    max-width: 650px;
    animation: fadeIn 0.3s ease-out;
    position: relative;
    border-radius: 0;
}

/* User Message - Cyan Theme */
.message-user {
    background: rgba(0, 229, 255, 0.15);
    color: var(--white);
    border: 2px solid var(--cyan-glass-border-strong);
    box-shadow: var(--shadow-glow-cyan), inset 0 0 30px rgba(0, 229, 255, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.message-user::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 229, 255, 0.4) 50%, transparent 100%);
    transform: translateX(-100%) skewX(-15deg);
    z-index: -1;
    pointer-events: none;
}

.message-user:hover::before {
    animation: futuristicShimmer 2s ease-in-out 1;
}

.message-user:hover {
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.6), inset 0 0 40px rgba(0, 229, 255, 0.15);
    transform: scale(1.02);
}

/* AI Message - Purple Theme */
.message-ai {
    background: rgba(15, 60, 100, 0.475);
    color: #E8F4FF;
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-glow-purple), inset 0 0 30px rgba(139, 92, 246, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.message-ai::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(139, 92, 246, 0.3) 50%, transparent 100%);
    transform: translateX(-100%) skewX(-15deg);
    z-index: -1;
    pointer-events: none;
}

.message-ai:hover::before {
    animation: futuristicShimmer 2s ease-in-out 1;
}

.message-ai:hover {
    box-shadow: 0 0 35px rgba(139, 92, 246, 0.4), inset 0 0 30px rgba(139, 92, 246, 0.1);
}

/* ========== Tags & Badges ========== */
.tag-chip {
    display: inline-block;
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid var(--cyan-glass-border-strong);
    border-radius: 0;
    padding: 0.25rem 0.75rem;
    font-size: var(--font-size-small);
    font-weight: 500;
    color: var(--vibrant-cyan);
    cursor: pointer;
    transition: var(--transition);
}

.tag-chip:hover {
    background: rgba(0, 229, 255, 0.25);
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.tag-chip.active {
    background: rgba(0, 229, 255, 0.3);
    border: 2px solid rgba(0, 229, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--font-size-small);
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 0;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger);
}

/* ========== Loading Indicators ========== */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 1s linear infinite, futuristicGlowPulse 2s ease-in-out infinite;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple) 0%, var(--vibrant-cyan) 100%);
    transition: width 0.3s ease;
    box-shadow: var(--shadow-glow-purple);
}

/* ========== Advanced Components ========== */

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
    border-radius: 0;
    transition: var(--transition);
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10B981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.status-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #F59E0B;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #EF4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.status-info {
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.5);
    color: #00E5FF;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.status-badge:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Metric Cards */
.metric-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B5CF6 0%, #00E5FF 100%);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.4));
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00E5FF;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.metric-trend {
    font-size: 0.875rem;
    font-weight: 600;
}

.trend-up { color: #10B981; }
.trend-down { color: #EF4444; }

/* Data Table */
.table-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(0, 229, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #00E5FF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0, 229, 255, 0.3);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.data-table tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: rgba(0, 229, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.2);
}

.data-table tbody tr.selected {
    background: rgba(139, 92, 246, 0.15);
    box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.4);
}

.data-table tbody tr.selected td {
    color: #FFFFFF;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 0;
    color: #FFFFFF;
    padding: 8px 16px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.pagination-btn.active {
    background: rgba(0, 229, 255, 0.2);
    border-color: #00E5FF;
    color: #00E5FF;
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    padding: 0.75rem 0;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-item {
    transition: color 0.15s ease;
}

.breadcrumb-item:not(.active) {
    cursor: pointer;
}

.breadcrumb-item:not(.active):hover {
    color: #00E5FF;
}

.breadcrumb-item.active {
    color: #FFFFFF;
    font-weight: 600;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.3));
    animation: float 3s ease-in-out infinite;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 0.5rem 0;
}

.empty-message {
    font-size: 1rem;
    margin: 0 0 2rem 0;
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 1rem 1.5rem;
    border-left: 4px solid;
    border-radius: 0;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
}

.alert-error {
    border-left-color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.alert-warning {
    border-left-color: #F59E0B;
    background: rgba(245, 158, 11, 0.1);
}

.alert-success {
    border-left-color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.alert-info {
    border-left-color: #00E5FF;
    background: rgba(0, 229, 255, 0.1);
}

.alert-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert-error .alert-icon { color: #EF4444; }
.alert-warning .alert-icon { color: #F59E0B; }
.alert-success .alert-icon { color: #10B981; }
.alert-info .alert-icon { color: #00E5FF; }

.alert-content {
    flex: 1;
}

.alert-title {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #FFFFFF;
}

.alert-message {
    margin: 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
}

.alert-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.alert-close:hover {
    color: #FFFFFF;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    border: 2px solid rgba(0, 229, 255, 0.5);
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 16px;
    max-width: 360px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 10000;
}

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

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    width: 24px;
    height: 24px;
    color: #00E5FF;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
    flex-shrink: 0;
}

.notification-text strong {
    display: block;
    color: #FFFFFF;
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin: 0;
}

.notification-text kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    padding: 2px 6px;
    font-family: 'Montserrat', monospace;
    font-size: 0.75rem;
}

.notification-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    color: #FFFFFF;
}

/* Tab Navigation */
.tab-group {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    background: rgba(13, 27, 42, 0.5);
}

.tab-item {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.6);
    padding: 12px 20px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: var(--transition);
    position: relative;
}

.tab-item:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 229, 255, 0.05);
}

.tab-item.active {
    background: rgba(0, 229, 255, 0.1);
    border-bottom-color: #00E5FF;
    color: #00E5FF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 229, 255, 0.5);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-input:checked + .checkmark {
    background: #00E5FF;
    border-color: #00E5FF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.checkbox-input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid #0D1B2A;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container:hover .checkmark {
    border-color: #00E5FF;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.checkbox-label {
    color: #FFFFFF;
    font-size: 0.9375rem;
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    border: 2px solid rgba(0, 229, 255, 0.5);
    border-radius: 0;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    transition: var(--transition);
}

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

.modal-body {
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 229, 255, 0.2);
}

/* System Health Indicators */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.health-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.health-status {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.health-healthy {
    background: #10B981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.health-warning {
    background: #F59E0B;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
    animation: pulse 2s infinite;
}

.health-critical {
    background: #EF4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    animation: pulse 1s infinite;
}

.health-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.health-label {
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 0.25rem;
}

.health-uptime {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Collapsible Card */
.collapsible-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.collapsible-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.expand-icon {
    width: 16px;
    color: #00E5FF;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.card-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.card-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.card-content {
    display: none;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.card-content.expanded {
    display: block;
}

.card-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Filter Panel */
.filter-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    cursor: pointer;
}

.filter-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #00E5FF;
    margin: 0;
}

.filter-toggle {
    background: transparent;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 0;
    color: #00E5FF;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: var(--transition);
}

.filter-toggle:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
}

.filter-content {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-panel:not(.show) .filter-content {
    display: none;
}

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

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

/* ========== AAA FEATURE CARD - Arcade Corner Brackets ========== */
.feature-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    padding: 2rem;
    transition: all 0.15s linear; /* Arcade speed */
    text-align: center;
    position: relative;
}

/* Corner brackets - hidden by default */
.feature-card::before,
.feature-card::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #00E5FF;
    opacity: 0;
    transition: all 0.15s linear;
}

/* Top-left bracket */
.feature-card::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

/* Bottom-right bracket */
.feature-card::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

/* Arcade hover - INSTANT cyan explosion + corner brackets */
.feature-card:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: #00E5FF;
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 0 30px rgba(0, 229, 255, 0.4),
        0 0 60px rgba(0, 229, 255, 0.2);
}

.feature-card:hover::before,
.feature-card:hover::after {
    opacity: 1;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

/* Add remaining corners with pseudo-elements on child */
.feature-card > :first-child::before,
.feature-card > :first-child::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #00E5FF;
    opacity: 0;
    transition: all 0.15s linear;
    pointer-events: none;
}

/* Top-right bracket */
.feature-card > :first-child::before {
    top: -1px;
    right: -1px;
    border-left: none;
    border-bottom: none;
}

/* Bottom-left bracket */
.feature-card > :first-child::after {
    bottom: -1px;
    left: -1px;
    border-right: none;
    border-top: none;
}

.feature-card:hover > :first-child::before,
.feature-card:hover > :first-child::after {
    opacity: 1;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

/* Featured card (Customized AI Search) - Rotating gradient border */
.feature-card.featured {
    background: rgba(167, 139, 250, 0.08);
    border: 2px solid var(--purple);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
    animation: glowPulse 3s ease-in-out infinite;
}

.feature-card.featured:hover {
    border-color: #A78BFA;
    background: rgba(167, 139, 250, 0.12);
    box-shadow:
        0 0 40px rgba(167, 139, 250, 0.6),
        0 0 80px rgba(0, 229, 255, 0.3);
    transform: translateY(-6px) scale(1.03);
}

.feature-card.featured::before,
.feature-card.featured::after,
.feature-card.featured > :first-child::before,
.feature-card.featured > :first-child::after {
    border-color: #A78BFA;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.4));
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 0.75rem 0;
}

.feature-description {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

/* Chart Container */
.chart-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.chart-export-btn {
    background: transparent;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 0;
    color: #00E5FF;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.chart-export-btn:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
}

/* ========== Utility Classes ========== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.text-center { text-align: center; }
.text-small { font-size: var(--font-size-small); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.text-glow-cyan {
    color: var(--vibrant-cyan);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.text-glow-purple {
    color: var(--purple);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    /* Performance optimization: reduce blur on mobile */
    .card,
    .glass-card,
    .feature-card,
    .modal-content,
    .barnaby-script-message {
        backdrop-filter: blur(12px) saturate(150%);
        -webkit-backdrop-filter: blur(12px) saturate(150%);
    }

    .component-grid {
        grid-template-columns: 1fr;
    }

    .health-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-content {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   BARNABY AI SYSTEM COMPONENTS
   ======================================== */

/* Barnaby Script Message Container */
.barnaby-script-message {
    background: rgba(27, 42, 65, 0.95);
    border-left: 3px solid var(--purple);
    border-radius: 0;
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--shadow-glow-purple), 0 2px 8px rgba(0, 0, 0, 0.3);
    font-family: var(--font-family);
}

/* Barnaby Header with Avatar and Name */
.barnaby-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--purple);
}

.barnaby-avatar {
    font-size: 1.5rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
}

.barnaby-name {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Barnaby Message Content */
.barnaby-content {
    color: var(--white);
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Legacy Class Name Support */
.barnaby-script-content {
    color: var(--white);
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Barnaby Buttons Container */
.barnaby-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    margin-bottom: 24px;
    justify-content: flex-start;
    width: 100%;
}

/* Individual Barnaby Button - Neon Frost Cosmic Style */
.barnaby-button {
    position: relative;
    background: rgba(0, 229, 255, 0.1);
    color: var(--vibrant-cyan);
    border: 2px solid rgba(0, 229, 255, 0.4);
    border-radius: 0;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2), inset 0 1px 0 rgba(0, 229, 255, 0.1);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    letter-spacing: 0.5px;
    overflow: hidden;
}

.barnaby-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 229, 255, 0.2) 50%, transparent 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.barnaby-button:hover::before {
    left: 100%;
}

.barnaby-button:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.6);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-cyan-strong), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(0, 229, 255, 0.2);
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
}

.barnaby-button:active {
    transform: translateY(0);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3), inset 0 1px 0 rgba(0, 229, 255, 0.1);
}

.barnaby-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    border-color: rgba(0, 229, 255, 0.2);
}

/* User Response to Barnaby */
.barnaby-user-response {
    background: rgba(27, 42, 65, 0.6);
    border-left: 3px solid rgba(0, 229, 255, 0.5);
    border-radius: 0;
    padding: 12px 16px;
    margin: 12px 0;
    color: var(--white);
    font-size: 0.95rem;
    font-style: italic;
}

/* AI Response to Barnaby Interaction */
.barnaby-ai-response {
    background: rgba(27, 42, 65, 0.8);
    border-left: 3px solid var(--purple);
    border-radius: 0;
    padding: 16px;
    margin: 16px 0;
    line-height: 1.6;
    color: var(--white);
}

/* Barnaby Script Title */
.barnaby-script-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--purple);
    margin-bottom: 12px;
}

/* Barnaby Message Wrapper */
.barnaby-message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
    align-self: flex-start;
    width: 100%;
    max-width: 650px;
}

/* Barnaby Proactive Message Positioning */
.barnaby-message-wrapper.barnaby-proactive {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 700px;
    margin-bottom: 0;
    align-items: flex-start;
    padding: 0 1rem;
    z-index: 100;
    transition: opacity 0.2s ease;
}

/* Barnaby Label with Avatar and Name */
.barnaby-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vibrant-cyan);
    text-shadow: var(--shadow-glow-cyan);
}

.barnaby-label .barnaby-avatar {
    font-size: 1.2rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
}

.barnaby-label .barnaby-name {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

/* Barnaby Message Bubble - Matches AI Message Styling */
.message.barnaby {
    align-self: flex-start;
    background: rgba(15, 60, 100, 0.475);
    color: #E8F4FF;
    padding: 1rem 1.25rem;
    border-radius: 0;
    border: 2px solid rgba(0, 229, 255, 0.3);
    box-shadow: var(--shadow-glow-cyan), inset 0 0 30px rgba(0, 229, 255, 0.05);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    max-width: 650px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* ========================================
   AI RESPONSE TYPOGRAPHY & FORMATTING
   ======================================== */

/* Base Typography for AI Content */
.ai-response-content,
.message.ai,
.formatted-content,
.markdown-content {
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Paragraph Spacing */
.ai-response-content p,
.message.ai p,
.formatted-content p,
.markdown-content p {
    margin-top: 0;
    margin-bottom: 1em;
}

.ai-response-content p + p,
.message.ai p + p,
.formatted-content p + p,
.markdown-content p + p {
    margin-top: 1em;
}

/* Header Spacing - 3:2 Ratio */
.ai-response-content h1,
.ai-response-content h2,
.ai-response-content h3,
.ai-response-content h4,
.ai-response-content h5,
.ai-response-content h6,
.message.ai h1,
.message.ai h2,
.message.ai h3,
.message.ai h4,
.message.ai h5,
.message.ai h6,
.formatted-content h1,
.formatted-content h2,
.formatted-content h3,
.formatted-content h4,
.formatted-content h5,
.formatted-content h6,
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    font-weight: 600;
    color: var(--white);
}

/* Remove Extra Margins from First/Last Elements */
.ai-response-content > :first-child,
.message.ai > :first-child,
.formatted-content > :first-child,
.markdown-content > :first-child {
    margin-top: 0;
}

.ai-response-content > :last-child,
.message.ai > :last-child,
.formatted-content > :last-child,
.markdown-content > :last-child {
    margin-bottom: 0;
}

/* No Double Spacing After Headers */
.ai-response-content h1 + p,
.ai-response-content h2 + p,
.ai-response-content h3 + p,
.ai-response-content h4 + p,
.ai-response-content h5 + p,
.ai-response-content h6 + p,
.message.ai h1 + p,
.message.ai h2 + p,
.message.ai h3 + p,
.message.ai h4 + p,
.message.ai h5 + p,
.message.ai h6 + p,
.formatted-content h1 + p,
.formatted-content h2 + p,
.formatted-content h3 + p,
.formatted-content h4 + p,
.formatted-content h5 + p,
.formatted-content h6 + p,
.markdown-content h1 + p,
.markdown-content h2 + p,
.markdown-content h3 + p,
.markdown-content h4 + p,
.markdown-content h5 + p,
.markdown-content h6 + p {
    margin-top: 0;
}

/* List Spacing */
.ai-response-content ul,
.ai-response-content ol,
.message.ai ul,
.message.ai ol,
.formatted-content ul,
.formatted-content ol,
.markdown-content ul,
.markdown-content ol {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 2em;
}

.ai-response-content li,
.message.ai li,
.formatted-content li,
.markdown-content li {
    margin-bottom: 0.25em;
}

/* Nested List Spacing */
.ai-response-content li > ul,
.ai-response-content li > ol,
.message.ai li > ul,
.message.ai li > ol,
.formatted-content li > ul,
.formatted-content li > ol,
.markdown-content li > ul,
.markdown-content li > ol {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
}

/* Code Blocks */
.ai-response-content pre,
.message.ai pre,
.formatted-content pre,
.markdown-content pre {
    margin: 1em 0;
    padding: 1em;
    overflow-x: auto;
    background: rgba(13, 27, 42, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* Inline Code */
.ai-response-content code,
.message.ai code,
.formatted-content code,
.markdown-content code {
    padding: 0.2em 0.4em;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    font-size: 0.9em;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: var(--vibrant-cyan);
}

/* Don't Double-Style Code Inside Pre */
.ai-response-content pre code,
.message.ai pre code,
.formatted-content pre code,
.markdown-content pre code {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

/* Blockquotes */
.ai-response-content blockquote,
.message.ai blockquote,
.formatted-content blockquote,
.markdown-content blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 4px solid var(--vibrant-cyan);
    color: var(--light-grey);
}

/* Links */
.ai-response-content a,
.message.ai a,
.formatted-content a,
.markdown-content a {
    color: var(--vibrant-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: var(--transition);
}

.ai-response-content a:hover,
.message.ai a:hover,
.formatted-content a:hover,
.markdown-content a:hover {
    text-decoration-thickness: 2px;
    text-shadow: var(--shadow-glow-cyan);
}

/* Strong/Bold */
.ai-response-content strong,
.ai-response-content b,
.message.ai strong,
.message.ai b,
.formatted-content strong,
.formatted-content b,
.markdown-content strong,
.markdown-content b {
    font-weight: 600;
    color: var(--white);
}

/* Emphasis/Italic */
.ai-response-content em,
.ai-response-content i,
.message.ai em,
.message.ai i,
.formatted-content em,
.formatted-content i,
.markdown-content em,
.markdown-content i {
    font-style: italic;
}

/* Horizontal Rules */
.ai-response-content hr,
.message.ai hr,
.formatted-content hr,
.markdown-content hr {
    margin: 2em 0;
    border: none;
    border-top: 1px solid rgba(0, 229, 255, 0.2);
}

/* ========================================
   SETTINGS PAGE COMPONENTS
   ======================================== */

/* Settings Section Container */
.settings-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(27, 42, 65, 0.95);
    border: 1px solid var(--cyan-glass-border);
    border-radius: 0;
    box-shadow: var(--shadow-glow-cyan);
}

/* Danger Zone Container */
.danger-zone {
    border: 2px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 1.5rem;
    border-radius: 0;
}

/* Warning Text */
.warning-text {
    color: var(--warning);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Warning Box */
.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: 0;
    padding: 1rem;
    margin: 1rem 0;
}

.warning-box ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Confirmation Input */
#confirmation-input {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid var(--cyan-glass-border);
    border-radius: 0;
    background: rgba(13, 27, 42, 0.8);
    color: var(--white);
    font-family: var(--font-family);
}

#confirmation-input:focus {
    outline: none;
    border-color: var(--vibrant-cyan);
    box-shadow: var(--shadow-glow-cyan);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Settings Row */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--cyan-glass-border);
}

.settings-row:last-child {
    border-bottom: none;
}

/* Settings Label */
.settings-label {
    font-weight: 500;
    color: var(--white);
}

/* Reset Results Container */
.reset-results {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 0;
    color: var(--white);
}

/* ========== MENUS & DROPDOWNS ========== */

/* Profile Menu Container */
.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 2px solid var(--vibrant-cyan);
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.4),
                0 8px 32px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.15s ease;
}

.profile-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Menu Header */
.menu-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(0, 229, 255, 0.05) 100%);
}

.menu-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.menu-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--vibrant-cyan);
    background: rgba(0, 229, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vibrant-cyan);
    font-size: 20px;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.menu-user-name {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.menu-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

.menu-status-badge.online .menu-status-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.menu-auth-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 0;
    margin-top: 12px;
}

.menu-auth-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--foreground);
}

.menu-auth-icon {
    color: var(--vibrant-cyan);
    font-size: 16px;
}

.menu-sign-in-btn {
    background: transparent;
    border: 2px solid var(--vibrant-cyan);
    color: var(--vibrant-cyan);
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.menu-sign-in-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--white);
    color: var(--white);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

/* Menu Actions */
.menu-actions {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.menu-action-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(0, 229, 255, 0.15);
    border: 2px solid rgba(0, 229, 255, 0.4);
    border-radius: 0;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.menu-action-btn:hover {
    background: rgba(0, 229, 255, 0.25);
    border-color: var(--vibrant-cyan);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
    transform: translateX(4px);
}

.menu-action-btn.primary {
    background: linear-gradient(135deg, #8B5CF6 0%, #8B5CF6 60%, #00E5FF 100%);
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.menu-action-btn.primary:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

.menu-action-btn.secondary {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.menu-action-btn.secondary:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--purple);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.4);
}

/* Menu Sections */
.menu-section {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
}

.menu-section:last-child {
    border-bottom: none;
}

.menu-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--vibrant-cyan);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    color: var(--foreground);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.3) 0%, transparent 100%);
    transition: width 0.15s ease;
}

.menu-item:hover {
    background: rgba(0, 229, 255, 0.05);
    border-color: rgba(0, 229, 255, 0.2);
    color: var(--white);
    transform: translateX(4px);
}

.menu-item:hover::before {
    width: 4px;
}

.menu-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vibrant-cyan);
    font-size: 18px;
}

.menu-item:hover .menu-item-icon {
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
}

.menu-item-text {
    flex: 1;
}

.menu-item-shortcut {
    font-size: 11px;
    color: var(--foreground-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Montserrat', monospace;
    letter-spacing: 0.5px;
}

.menu-item:hover .menu-item-shortcut {
    background: rgba(0, 229, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.3);
    color: var(--vibrant-cyan);
}

/* Dropdown Menus (generic) */
.dropdown-menu {
    position: absolute;
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 2px solid var(--vibrant-cyan);
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.4),
                0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    min-width: 200px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.15s ease;
}

.dropdown-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-item {
    padding: 12px 16px;
    color: var(--foreground);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--white);
    border-left-color: var(--vibrant-cyan);
}

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

/* Context Menu */
.context-menu {
    position: fixed;
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 2px solid var(--vibrant-cyan);
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.4),
                0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    min-width: 180px;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    transition: all 0.15s ease;
}

.context-menu.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

/* ========== Print Styles ========== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .btn,
    .modal-overlay,
    .toast-notification {
        display: none !important;
    }
}
