/**
 * AI Vision - Main Stylesheet
 * Modern Glassmorphism + Neon Accent Design — 2026
 */

/* ===== CSS Variables ===== */
:root {
    /* Colors — deeper, richer palette */
    --bg-primary: #080810;
    --bg-secondary: #0e0e1a;
    --bg-tertiary: #161628;
    --bg-card: linear-gradient(135deg, rgba(22,22,42,0.8) 0%, rgba(16,16,38,0.9) 100%);
    --bg-glass: rgba(16,16,36,0.6);
    
    /* Neon Colors — refined */
    --neon-cyan: #00e5ff;
    --neon-pink: #e040fb;
    --neon-purple: #7c4dff;
    --neon-blue: #448aff;
    --neon-green: #00e676;
    --neon-yellow: #ffd740;
    --neon-red: #ff5252;
    
    /* Text Colors */
    --text-primary: #f0f0f5;
    --text-secondary: #a8adc0;
    --text-muted: #5c6380;
    
    /* Border */
    --border-color: rgba(0, 229, 255, 0.12);
    --border-glow: rgba(0, 229, 255, 0.35);
    
    /* Shadows — layered depth */
    --shadow-neon: 0 0 30px rgba(0, 229, 255, 0.15), 0 0 60px rgba(0, 229, 255, 0.05);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 229, 255, 0.08);
    
    /* Spacing */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background — subtle animated grain + grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(ellipse at 20% 50%, rgba(0, 229, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(224, 64, 251, 0.03) 0%, transparent 50%),
        linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 60px 60px, 60px 60px;
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 12px rgba(224, 64, 251, 0.5);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2.25rem;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, #fff 40%, var(--neon-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 280px;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 70px;
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

@media (max-width: 1024px) {
    .header {
        left: 0;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
    }
}

/* ===== Sidebar — Glassmorphism ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(14, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 200;
    transition: var(--transition-normal);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-logo .logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.3);
}

.sidebar-logo .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.375rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    font-size: 0.9375rem;
    font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(0, 229, 255, 0.08);
    color: var(--neon-cyan);
    text-shadow: none;
}

.sidebar-nav a.active {
    border-left: 3px solid var(--neon-cyan);
    box-shadow: inset 4px 0 12px rgba(0, 229, 255, 0.05);
}

.sidebar-nav .nav-icon {
    width: 20px;
    text-align: center;
}

.sidebar-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ===== Cards — Glassmorphism ===== */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-card);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-elevated);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    color: var(--text-secondary);
}

/* ===== Stats Cards — Enhanced depth ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
}

.stat-card.green::before {
    background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
}

.stat-card.pink::before {
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple));
}

.stat-card.yellow::before {
    background: linear-gradient(90deg, var(--neon-yellow), var(--neon-pink));
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: rgba(0, 229, 255, 0.08);
    color: var(--neon-cyan);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.4);
    color: var(--bg-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
}

.btn-secondary:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
}

.btn-danger {
    background: linear-gradient(135deg, var(--neon-red), #dc2626);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--neon-green), #10b981);
    color: var(--bg-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.form-error {
    color: var(--neon-red);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ===== Tables ===== */
.table-responsive {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(0, 255, 255, 0.05);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--neon-green);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--neon-yellow);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--neon-red);
}

.badge-info {
    background: rgba(0, 255, 255, 0.15);
    color: var(--neon-cyan);
}

.badge-pro {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    color: white;
}

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--neon-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--neon-red);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--neon-yellow);
}

.alert-info {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--neon-cyan);
}

/* ===== Progress Bars ===== */
.progress {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 9999px;
    transition: width var(--transition-slow);
}

/* ===== Score Circle ===== */
.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-circle-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.score-circle-progress {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease;
}

.score-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Analysis Card ===== */
.analysis-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition-normal);
}

.analysis-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.analysis-domain {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.analysis-scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.analysis-score-item {
    text-align: center;
}

.analysis-score-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

.analysis-score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Model Results ===== */
.model-result {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.model-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.model-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-sentiment {
    font-size: 0.8125rem;
}

.model-response {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.model-response.expanded {
    max-height: none;
}

.model-response-toggle {
    background: none;
    border: none;
    color: var(--neon-cyan);
    font-size: 0.8125rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

/* ===== Auth Pages ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-neon);
}

.auth-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    color: var(--bg-primary);
}

/* ===== User Dropdown ===== */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-fast);
    z-index: 100;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.user-dropdown-menu a:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
    text-shadow: none;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-secondary);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 9999;
}

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

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.5rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    color: var(--bg-primary);
}

/* ===== Charts Container ===== */
.chart-container {
    height: 300px;
    position: relative;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-fast);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--neon-red);
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-cyan { color: var(--neon-cyan); }
.text-pink { color: var(--neon-pink); }
.text-green { color: var(--neon-green); }
.text-red { color: var(--neon-red); }
.text-yellow { color: var(--neon-yellow); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .analysis-scores {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    /* Admin responsive fixes */
    .card-body .table {
        font-size: 0.8125rem;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .card-body .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .d-flex.gap-1 {
        gap: 0.25rem !important;
    }
    
    /* Hide some columns on mobile */
    .table .hide-mobile {
        display: none;
    }
    
    /* Stack form rows */
    .card-body form .d-flex {
        flex-direction: column;
    }
    
    .card-body form .d-flex .form-control {
        max-width: 100% !important;
    }
    
    /* Grid layouts */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem 0.75rem;
        padding-top: 80px;
    }
    
    .card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    /* Admin table mobile view */
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    /* Sidebar overlay for mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 150;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Admin specific responsive */
@media (max-width: 1200px) {
    .admin-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    div[style*="grid-template-columns:1fr 1fr"] {
        display: block !important;
    }
    
    div[style*="grid-template-columns:1fr 1fr"] > * {
        margin-bottom: 1.5rem;
    }
}
