/* ==========================================
   PREMIUM UI UPGRADE
   ========================================== */

/* 1. REMOVED SLIDING DRAWER (User requested centered popup) */

/* 2. ENHANCED DASHBOARD METRIC CARDS */
.metric-card, .quick-overview > div {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

[data-theme="dark"] .metric-card, [data-theme="dark"] .quick-overview > div {
    background: rgba(30, 41, 59, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
}

.metric-card:hover, .quick-overview > div:hover {
    transform: translateY(-6px) scale(1.02) !important;
    box-shadow: 0 20px 40px -5px rgba(2, 132, 199, 0.15) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
}

[data-theme="dark"] .metric-card:hover, [data-theme="dark"] .quick-overview > div:hover {
    box-shadow: 0 20px 40px -5px rgba(56, 189, 248, 0.2) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
}

/* 3. TABLE ROW STAGGERED FADE-IN */
@keyframes rowFadeIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

.table-row-animate {
    animation: rowFadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

/* 4. PREMIUM BADGES */
.table-stat-badge {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(2, 132, 199, 0.15)) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    color: var(--primary) !important;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.05) !important;
}

[data-theme="dark"] .table-stat-badge {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(2, 132, 199, 0.1)) !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    color: #7dd3fc !important;
}

/* Modern Hover Action Buttons */
.btn-compare, .btn-primary {
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}

.btn-compare:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
}

.btn-compare:active, .btn-primary:active {
    transform: translateY(1px);
}

/* 5. ULTRA PREMIUM TABLE STYLING */
.table-container {
    background: var(--surface) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px -6px rgba(15, 23, 42, 0.08), 0 0 1px rgba(15, 23, 42, 0.1) !important;
    border: none !important;
    overflow: auto;
    margin-top: 1rem;
}

[data-theme="dark"] .table-container {
    background: var(--surface) !important;
    box-shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100%;
}

th {
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    backdrop-filter: blur(8px) !important;
    text-align: left;
}

[data-theme="dark"] th {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid #334155 !important;
}

tr {
    transition: all 0.2s ease !important;
    background: transparent !important;
}

/* Remove old zebra striping */
tr:nth-child(even) {
    background: transparent !important;
}
[data-theme="dark"] tr:nth-child(even) {
    background: transparent !important;
}

td {
    padding: 18px 20px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #334155 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    vertical-align: middle !important;
}

[data-theme="dark"] td {
    border-bottom: 1px solid #1e293b !important;
    color: #e2e8f0 !important;
}

/* Thêm hiệu ứng hover cao cấp */
tr:hover {
    background: #f8fafc !important;
    cursor: pointer;
}
[data-theme="dark"] tr:hover {
    background: #0f172a !important;
}

tr:hover td {
    border-color: #e2e8f0 !important;
}
[data-theme="dark"] tr:hover td {
    border-color: #334155 !important;
}

/* Tinh chỉnh typography trong ô */
.col-school {
    font-weight: 700 !important;
    color: #0f172a !important;
    font-size: 1.05rem !important;
}
[data-theme="dark"] .col-school {
    color: #f8fafc !important;
}

.col-wrap {
    color: #64748b !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
}
[data-theme="dark"] .col-wrap {
    color: #94a3b8 !important;
}

/* SMART COLUMN TRUNCATION */
.col-short { white-space: nowrap !important; min-width: 140px !important; }
.clamp-text { display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; text-overflow: ellipsis !important; max-width: 250px !important; }
td.col-school { min-width: 220px !important; }

/* 6. SMART BADGES */
.smart-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; box-shadow: 0 2px 4px rgba(0,0,0,0.05); white-space: normal; word-break: break-word; margin: 2px; line-height: 1.4; }
.badge-top1 { background: #fef08a; color: #854d0e; border: 1px solid #fde047; }
.badge-top2 { background: #e2e8f0; color: #475569; border: 1px solid #cbd5e1; }
.badge-top3 { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.badge-cert { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-d4 { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.badge-d2 { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.badge-seoul { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }
.badge-busan { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-default { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }

[data-theme="dark"] .badge-top1 { background: rgba(234, 179, 8, 0.2); color: #fde047; border-color: rgba(234, 179, 8, 0.4); }
[data-theme="dark"] .badge-top2 { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.4); }
[data-theme="dark"] .badge-top3 { background: rgba(249, 115, 22, 0.2); color: #fdba74; border-color: rgba(249, 115, 22, 0.4); }
[data-theme="dark"] .badge-cert { background: rgba(34, 197, 94, 0.2); color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
[data-theme="dark"] .badge-d4 { background: rgba(14, 165, 233, 0.2); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.4); }
[data-theme="dark"] .badge-d2 { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.4); }
[data-theme="dark"] .badge-seoul { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; border-color: rgba(236, 72, 153, 0.4); }
[data-theme="dark"] .badge-busan { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.4); }
[data-theme="dark"] .badge-default { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; border-color: rgba(100, 116, 139, 0.4); }

/* Fix overflow wrap for short columns */
.col-short { min-width: 150px !important; max-width: 220px !important; white-space: normal !important; word-break: break-word !important; }

/* 7. CUSTOM SMART SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.15);
    border-radius: 10px;
    transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.4);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* Ensure the table wrapper has smooth scrolling */
.table-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.15) transparent;
}
[data-theme="dark"] .table-container {
    scrollbar-color: rgba(148, 163, 184, 0.15) transparent;
}

/* ==========================================
   8. MOBILE RESPONSIVE OPTIMIZATIONS
   ========================================== */
@media (max-width: 768px) {
    /* 1. Header & Tabs */
    .header-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }
    
    .tabs-container {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        scrollbar-width: none; /* Firefox */
    }
    .tabs-container::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .tabs {
        display: inline-flex;
        flex-wrap: nowrap !important;
    }

    /* 2. Metrics Dashboard */
    .quick-overview {
        grid-template-columns: 1fr 1fr !important; /* 2 columns on mobile instead of 4 */
        gap: 10px !important;
    }
    .metric-card {
        padding: 15px !important;
    }
    .metric-card h3 {
        font-size: 0.85rem !important;
    }
    .metric-card .metric-val {
        font-size: 1.5rem !important;
    }

    /* 3. Table Adjustments */
    .table-container {
        border-radius: 8px !important;
        margin-top: 0.5rem;
    }
    th, td {
        padding: 12px 10px !important;
        font-size: 0.85rem !important;
    }
    .col-short {
        min-width: 120px !important;
    }
    td.col-school {
        min-width: 160px !important;
        font-size: 0.95rem !important;
    }
    .clamp-text {
        max-width: 200px !important;
    }

    /* 4. Center Modal Adjustments */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh !important;
        margin: 10px !important;
        border-radius: 12px !important;
    }
    .modal-header {
        padding: 1rem 1.25rem !important;
    }
    .modal-header-text h2 {
        font-size: 1.25rem !important;
    }
    .modal-body {
        padding: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    /* Super small phones */
    .quick-overview {
        grid-template-columns: 1fr !important; /* Stack vertically on very small screens */
    }
}

/* ==========================================
   9. EXTRA PREMIUM STYLING & ANIMATIONS
   ========================================== */

/* Enhanced Sub Tab Pills */
.sub-tab-pill {
    padding: 8px 16px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.02em !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.sub-tab-pill .tab-emoji {
    font-size: 1rem !important;
    transition: transform 0.3s ease !important;
}

.sub-tab-pill:hover .tab-emoji {
    transform: scale(1.2) rotate(10deg);
}

.sub-tab-pill:hover {
    background: rgba(2, 132, 199, 0.08) !important;
    color: var(--primary) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(2, 132, 199, 0.08) !important;
}

[data-theme="dark"] .sub-tab-pill:hover {
    background: rgba(56, 189, 248, 0.1) !important;
    color: #7dd3fc !important;
    box-shadow: 0 4px 8px rgba(56, 189, 248, 0.1) !important;
}

.sub-tab-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
    border-color: transparent !important;
}

/* Compare Modal Overhaul */
.compare-table {
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
    border: 1px solid var(--border) !important;
}

.compare-table th {
    background: #f8fafc !important;
    padding: 18px 15px !important;
    font-size: 0.95rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

[data-theme="dark"] .compare-table th {
    background: #1e293b !important;
    border-bottom: 2px solid #334155 !important;
}

.compare-table td {
    padding: 16px 15px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

[data-theme="dark"] .compare-table td {
    border-bottom: 1px solid #334155 !important;
}

/* Autocomplete Suggestion Glowing Panel */
.autocomplete-suggestions {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15) !important;
    padding: 8px !important;
}

[data-theme="dark"] .autocomplete-suggestions {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5) !important;
}

.suggestion-item {
    border-radius: 8px !important;
    border-bottom: none !important;
    padding: 12px 16px !important;
    transition: var(--transition) !important;
    margin-bottom: 2px !important;
}

.suggestion-item:hover {
    background: rgba(2, 132, 199, 0.08) !important;
    color: var(--primary) !important;
    padding-left: 20px !important;
}

[data-theme="dark"] .suggestion-item:hover {
    background: rgba(56, 189, 248, 0.1) !important;
    color: #7dd3fc !important;
}

/* Golden Glow on Top 1 Badges */
.badge-top1 {
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.25) !important;
    animation: goldGlow 3s infinite alternate !important;
}

@keyframes goldGlow {
    0% { box-shadow: 0 0 4px rgba(234, 179, 8, 0.15); }
    100% { box-shadow: 0 0 12px rgba(234, 179, 8, 0.45); }
}

/* Futuristic search highlight overlay */
.focus-overlay {
    backdrop-filter: blur(4px) !important;
    background: rgba(15, 23, 42, 0.15) !important;
    transition: all 0.4s ease !important;
}

[data-theme="dark"] .focus-overlay {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* 10. DRAG TO SCROLL STYLES */
.sub-tabs-container {
    cursor: grab !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}
.sub-tabs-container:active {
    cursor: grabbing !important;
}

/* 11. PERSISTENT FILTER STYLES */
.filter-header {
    cursor: default !important;
}
.filter-header:hover {
    background: transparent !important;
}

/* 12. SYNC BUTTON & TAB SCROLL WRAPPER FIXES */
.sync-btn {
    flex-shrink: 0 !important;
    width: 170px !important;
    justify-content: center !important;
}
.sub-tabs-container {
    flex: 1 !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
}
.sub-tabs-wrapper::after {
    right: 186px !important; /* Width of sync-btn (170px) + Gap (16px) */
}

/* ==========================================
   13. PREMIUM DETAIL MODAL OVERHAUL
   ========================================== */
.tree-leaf {
    background: var(--surface) !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
    padding: 14px 16px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-theme="dark"] .tree-leaf {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.tree-leaf:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.08) !important;
    border-color: rgba(2, 132, 199, 0.2) !important;
}

[data-theme="dark"] .tree-leaf:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
}

.tree-branch {
    border-left: 2px solid rgba(2, 132, 199, 0.15) !important;
}

.tree-branch::before {
    background: rgba(2, 132, 199, 0.15) !important;
}

.tree-branch-header {
    font-size: 1.05rem !important;
    color: var(--text-main) !important;
    border-bottom: 2px solid rgba(2, 132, 199, 0.1) !important;
    padding-bottom: 6px !important;
    margin-bottom: 16px !important;
}

.tree-branch-header span {
    color: var(--primary) !important;
}

.badge-container .badge {
    border-radius: 8px !important;
    padding: 6px 12px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}

/* 14. EMPTY PLACEHOLDER STYLING */
.value-empty {
    color: var(--text-muted) !important;
    font-style: italic !important;
    font-weight: 400 !important;
    opacity: 0.65 !important;
}

/* ==========================================
   15. NEXT-LEVEL COLLAPSIBLE DETAILS & HIGHLIGHTS
   ========================================== */

/* Gradient Branch Connectors */
.tree-branch {
    border-left: 2px solid transparent !important;
    border-image: linear-gradient(to bottom, #0ea5e9, #ec4899) 1 100% !important;
}

/* Collapsible Header Styling */
.tree-branch-header {
    cursor: pointer !important;
    user-select: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: color 0.3s ease !important;
}

.tree-branch-header:hover {
    color: var(--primary-hover) !important;
}

.tree-branch-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.tree-branch-chevron {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    color: var(--text-muted) !important;
    font-size: 20px !important;
}

.tree-branch.collapsed .tree-branch-chevron {
    transform: rotate(-90deg) !important;
}

/* Collapsible Transition */
.tree-grid-row {
    max-height: 2000px !important;
    opacity: 1 !important;
    overflow: hidden !important;
    transition: max-height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease !important;
}

.tree-branch.collapsed .tree-grid-row {
    max-height: 0px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin-top: 0 !important;
}

/* Smart Currency Highlighting */
.money-highlight {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #059669 !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    display: inline-block !important;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.05) !important;
    font-family: var(--font-heading) !important;
}

[data-theme="dark"] .money-highlight {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

/* ==========================================
   16. ULTRA PREMIUM HOMEPAGE REDESIGN
   ========================================== */

:root {
    --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif !important;
    --font-heading: 'Outfit', system-ui, -apple-system, sans-serif !important;
}

body {
    font-family: var(--font-sans);
    transition: background-color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
}

/* Glow Background Orbs Movement */
.ambient-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    mix-blend-mode: plus-lighter;
    animation: floatOrb 25s infinite alternate ease-in-out;
}

.ambient-orb:nth-child(1) {
    top: -10%;
    left: 10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #38bdf8, #0369a1);
    animation-delay: 0s;
}

.ambient-orb:nth-child(2) {
    bottom: 10%;
    right: 5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #f472b6, #db2777);
    animation-delay: -5s;
    animation-duration: 30s;
}

.ambient-orb:nth-child(3) {
    top: 40%;
    left: 45%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #818cf8, #4f46e5);
    animation-delay: -10s;
    animation-duration: 22s;
}

.ambient-orb:nth-child(4) {
    bottom: -5%;
    left: 5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #34d399, #059669);
    animation-delay: -15s;
    animation-duration: 28s;
}

[data-theme="dark"] .ambient-orb {
    opacity: 0.18;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.1); }
    100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Header/Hero Section Styling */
.gradient-header {
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 3rem 2rem 4rem 2rem !important;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    border-radius: 0 0 40px 40px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
    margin-bottom: -30px;
    z-index: 10;
}

.gradient-header > div {
    flex-direction: column !important;
    gap: 15px !important;
}

.header-logo {
    width: 90px !important;
    height: 90px !important;
    border-radius: 24px !important;
    border: 2px solid rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.25) !important;
    animation: logoPulse 4s infinite ease-in-out !important;
    background: #fff;
    padding: 8px;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 30px rgba(56, 189, 248, 0.25); }
    50% { transform: scale(1.04); box-shadow: 0 12px 40px rgba(56, 189, 248, 0.45); border-color: rgba(244, 114, 182, 0.5); }
}

.header-text {
    text-align: center !important;
}

.header-text h1 {
    font-size: 2.8rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #38bdf8, #818cf8, #f472b6, #34d399) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    margin-bottom: 8px !important;
    letter-spacing: -0.03em !important;
    display: inline-block;
}

.header-text p {
    font-size: 1.1rem !important;
    color: rgba(248, 250, 252, 0.75) !important;
    font-weight: 500 !important;
}

/* Command Center Glow Search */
.command-center-wrapper {
    margin-top: -35px !important;
    position: relative;
    z-index: 20;
    max-width: 800px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 20px;
}

.command-center {
    background: var(--surface) !important;
    border-radius: 24px !important;
    padding: 10px !important;
    border: 1px solid transparent !important;
    background-image: linear-gradient(var(--surface), var(--surface)) padding-box, 
                      linear-gradient(135deg, rgba(56,189,248,0.4), rgba(129,140,248,0.4), rgba(244,114,182,0.4)) border-box !important;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15), 0 0 1px rgba(15, 23, 42, 0.2) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1) !important;
}

[data-theme="dark"] .command-center {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

.command-center:focus-within {
    transform: translateY(-4px) scale(1.01) !important;
    background-image: linear-gradient(var(--surface), var(--surface)) padding-box, 
                      linear-gradient(135deg, #38bdf8, #818cf8, #f472b6) border-box !important;
    box-shadow: 0 30px 60px -15px rgba(2, 132, 199, 0.25) !important;
}

.ai-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px !important;
}

.ai-search-icon-wrapper {
    background: linear-gradient(135deg, #0ea5e9, #6366f1) !important;
    color: #fff !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

.ai-search-fields-container {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
}

.ai-search-input-field {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: var(--text-main) !important;
    width: 100%;
}

.ai-search-submit-btn {
    background: linear-gradient(135deg, #0ea5e9, #6366f1) !important;
    border-radius: 14px !important;
    width: 44px !important;
    height: 44px !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
    transition: var(--transition) !important;
}

.ai-search-submit-btn:hover {
    transform: scale(1.05) rotate(5deg) !important;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4) !important;
}

/* Inline AI prompts */
.inline-ai-prompts {
    padding: 10px 12px 6px 12px !important;
    border-top: 1px solid var(--border) !important;
    margin-top: 8px !important;
}

.inline-prompt-chip {
    background: rgba(100, 116, 139, 0.06) !important;
    border: 1px solid rgba(100, 116, 139, 0.1) !important;
    color: var(--text-muted) !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: var(--transition) !important;
}

.inline-prompt-chip:hover {
    background: rgba(14, 165, 233, 0.08) !important;
    color: var(--primary) !important;
    border-color: rgba(14, 165, 233, 0.2) !important;
    transform: translateY(-2px) !important;
}

/* Category Selector Cards */
.category-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 3.5rem !important;
    margin-bottom: 2.5rem !important;
}

.category-card {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 24px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04) !important;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08) !important;
    border-color: rgba(14, 165, 233, 0.25) !important;
}

.category-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(99, 102, 241, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    box-shadow: inset 0 0 12px rgba(14, 165, 233, 0.08);
    transition: var(--transition);
}

.category-card:hover .category-card-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
}

/* Metric Cards Refined */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 1.5rem !important;
    margin-bottom: 2rem !important;
}

.smart-metric-card {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 20px !important;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1) !important;
}

.smart-metric-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06) !important;
}

.smart-metric-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
    background: rgba(14, 165, 233, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    flex-shrink: 0;
}

.metric-blue .smart-metric-icon { background: rgba(14, 165, 233, 0.1) !important; color: #0284c7 !important; }
.metric-amber .smart-metric-icon { background: rgba(245, 158, 11, 0.1) !important; color: #d97706 !important; }
.metric-rose .smart-metric-icon { background: rgba(244, 63, 94, 0.1) !important; color: #e11d48 !important; }
.metric-violet .smart-metric-icon { background: rgba(139, 92, 246, 0.1) !important; color: #7c3aed !important; }

.smart-metric-value {
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    font-family: var(--font-heading) !important;
    color: var(--text-main) !important;
}

/* Smart Glowing Filter Section */
.filter-section {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 24px !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.03) !important;
    padding: 24px !important;
    margin-bottom: 2rem !important;
}

.filter-header h3 {
    font-size: 1.25rem !important;
    color: var(--text-main) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Beautiful View Toggle Bar */
.view-toggle-bar {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 8px 16px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.02) !important;
    margin-bottom: 1.5rem !important;
}

/* Ultra Premium details modal */
.modal-content {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 28px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .modal-content {
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-text h1 {
        font-size: 2.2rem !important;
    }
    .gradient-header {
        padding: 2.5rem 1rem 3.5rem 1rem !important;
        border-radius: 0 0 24px 24px !important;
    }
    .category-card-container {
        grid-template-columns: 1fr !important;
        margin-top: 2.5rem !important;
    }
    .command-center-wrapper {
        margin-top: -30px !important;
    }
}

/* ==========================================
   17. INTEGRATED PORTAL HUB STYLING
   ========================================== */
.portal-selector-container {
    max-width: 1000px;
    width: 100%;
    margin: 3.5rem auto 1rem auto;
    padding: 0 20px;
}

.portal-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
}

.portal-card {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-radius: 28px !important;
    border: 1px solid var(--border) !important;
    padding: 30px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) !important;
}

/* Inner Background Glowing Effect */
.portal-card-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.15;
    pointer-events: none;
    transition: all 0.4s ease;
}

.portal-card-blue .portal-card-glow {
    background: #38bdf8;
    top: -20px;
    right: -20px;
}

.portal-card-purple .portal-card-glow {
    background: #c084fc;
    top: -20px;
    right: -20px;
}

.portal-card:hover .portal-card-glow {
    width: 200px;
    height: 200px;
    opacity: 0.25;
}

/* Card Hover States */
.portal-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08) !important;
}

.portal-card-blue:hover {
    border-color: rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 30px 60px rgba(2, 132, 199, 0.12) !important;
}

.portal-card-purple:hover {
    border-color: rgba(192, 132, 252, 0.4) !important;
    box-shadow: 0 30px 60px rgba(124, 58, 237, 0.12) !important;
}

/* Header & Badges */
.portal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.portal-card-badge {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.15);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.08) !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    color: #8b5cf6 !important;
}

.portal-card-icon {
    font-size: 2.2rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    transition: all 0.4s ease;
}

.portal-card-blue .portal-card-icon {
    background: rgba(14, 165, 233, 0.08);
    color: var(--primary);
}

.portal-card-purple .portal-card-icon {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
}

.portal-card:hover .portal-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.portal-card-blue:hover .portal-card-icon {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
}

.portal-card-purple:hover .portal-card-icon {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
}

/* Body & Typography */
.portal-card-body h3 {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    margin-bottom: 12px !important;
    color: var(--text-main) !important;
}

.portal-card-body p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.portal-card-metrics {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.portal-card-metrics span {
    background: rgba(100, 116, 139, 0.05);
    border: 1px solid rgba(100, 116, 139, 0.08);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Action button inside card footer */
.portal-action-btn {
    border: none;
    outline: none;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
    width: 100%;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-purple {
    background: linear-gradient(135deg, #a855f7, #ec4899) !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.2) !important;
}

.portal-card:hover .portal-action-btn {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.portal-card:hover .btn-purple {
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.35) !important;
}

.portal-action-btn span.material-symbols-rounded {
    transition: transform 0.3s ease;
}

.portal-card:hover .portal-action-btn span.material-symbols-rounded {
    transform: translateX(4px);
}

/* Active State for Cards (when section is visible) */
.portal-card.active {
    background-image: linear-gradient(var(--surface), var(--surface)) padding-box, 
                      linear-gradient(135deg, #38bdf8, #818cf8, #f472b6) border-box !important;
    border-color: transparent !important;
    transform: translateY(-4px) !important;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .portal-cards-grid {
        grid-template-columns: 1fr;
    }
    .portal-card {
        padding: 24px !important;
        min-height: auto;
    }
}
