@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --secondary: #0ea5e9;
    --accent: #38bdf8;
    --bg-base: #f8fafc;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.7);
    --border: rgba(15, 23, 42, 0.08);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --secondary: #0ea5e9;
    --accent: #0284c7;
    --bg-base: #0f172a;
    --surface: #1e293b;
    --surface-glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #f87171;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.12) 0px, transparent 50%),
        radial-gradient(at 98% 20%, rgba(6, 182, 212, 0.08) 0px, transparent 40%),
        radial-gradient(at 50% 80%, rgba(236, 72, 153, 0.08) 0px, transparent 45%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

input, button, select, textarea {
    font-family: inherit;
}

/* Material Icons Helper */
.material-symbols-rounded {
    vertical-align: middle;
    font-size: 20px;
}

/* ========== CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========== ANIMATED HEADER ========== */
.gradient-header {
    background: linear-gradient(-45deg, #090d16, #0f172a, #0c4a6e, #0369a1, #1e1b4b, #312e81, #0e7490);
    background-size: 500% 500%;
    animation: gradientBG 18s ease infinite;
    padding: 2.25rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: var(--shadow-lg);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-header::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    top: -25%;
    left: -25%;
    animation: pulse 10s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(5%, 5%); }
}

.header-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px;
    object-fit: contain;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.header-logo:hover {
    transform: translateY(-5px) rotate(5deg);
}

.header-text {
    z-index: 1;
    text-align: left;
}

.header-text h1 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(90deg, #ffffff 0%, #a5b4fc 30%, #67e8f9 60%, #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    animation: shimmerText 4s ease-in-out infinite;
}

@keyframes shimmerText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header-text p {
    margin-top: 0.25rem;
    color: rgba(203, 213, 225, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
    letter-spacing: 0.3px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    z-index: 2;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* ========== MAIN LAYOUT ========== */
.main-container {
    max-width: 1380px;
    margin: -1.5rem auto 2rem auto;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

/* ========== SEGMENTED TABS ========== */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glass);
    overflow-x: auto;
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    border: none;
    background: transparent;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    font-weight: 600;
}

/* ========== SMART FILTER SECTION ========== */
.filter-section {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    transition: var(--transition);
}

.filter-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.filter-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.filter-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.filter-header h3 .material-symbols-rounded {
    color: var(--primary);
}

#filterIcon {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.filter-content {
    display: none;
    padding: 0 1.5rem 1.5rem 1.5rem;
    animation: slideDown 0.3s ease forwards;
}

.filter-content.open {
    display: block;
}

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

.search-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.search-group.main-search input {
    font-size: 1.1rem;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
}



.search-group.main-search .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 24px;
}

.autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.autocomplete-suggestions.active {
    display: block;
}
.suggestion-item {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.suggestion-item:last-child {
    border-bottom: none;
}
.suggestion-item:hover {
    background: var(--bg-base);
    color: var(--primary);
}
.suggestion-item .material-symbols-rounded {
    font-size: 18px;
    color: #94a3b8;
}

.search-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-group input, .search-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-glass);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.search-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.search-group input:focus, .search-group select:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

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

/* ========== DATA TABLE ========== */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glass), inset 0 1px 2px rgba(0, 0, 0, 0.02);
    overflow: auto;
    position: relative;
    max-height: 700px;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-base) 100%);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.8px;
    padding: 0.85rem 1.15rem;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

td {
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    transition: var(--transition);
    font-size: 0.92rem;
}

.col-wrap {
    white-space: normal !important;
    word-break: break-word !important;
    min-width: 200px;
    max-width: 350px;
}

.col-school {
    white-space: normal !important;
    word-break: break-word !important;
    min-width: 150px;
    max-width: 250px;
}

.col-short {
    white-space: normal !important;
    min-width: 100px;
    max-width: 140px;
}

.col-default {
    white-space: normal !important;
    min-width: 120px;
    max-width: 220px;
}

tr {
    background: var(--surface);
    transition: all 0.25s ease;
    cursor: pointer;
}

tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tr:hover {
    background: rgba(2, 132, 199, 0.05) !important;
    box-shadow: inset 4px 0 0 var(--primary), 0 2px 8px rgba(2, 132, 199, 0.06);
}

.col-index {
    color: var(--text-muted);
    font-weight: 500;
    width: 50px;
    text-align: center;
    background: var(--surface-glass);
    border-right: 1px dashed var(--border);
}

tr:hover .col-index {
    background: var(--bg-base);
    color: var(--primary);
}

/* ========== LOADING & ERROR ========== */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--primary);
    font-weight: 500;
    background: var(--surface-glass);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(79, 70, 229, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin: 0 auto 1rem auto;
}

.error-msg {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

/* ========== FLOATING AI CHAT ========== */
.chat-bubble-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
    z-index: 9999;
    transition: var(--transition);
}

.chat-bubble-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.5);
}

.chat-bubble-btn .material-symbols-rounded {
    font-size: 32px;
}

/* ========== INLINE AI SPINNER ========== */
@keyframes inline-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.inline-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(2, 132, 199, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: inline-spin 0.8s linear infinite;
    display: inline-block;
}

.chat-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass), 0 20px 40px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    border: 1px solid var(--border);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
}

.chat-container.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-header {
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.close-chat {
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.close-chat:hover {
    color: white;
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: transparent;
}

.msg {
    max-width: 85%;
    padding: 0.85rem 1.15rem;
    border-radius: 1.25rem;
    line-height: 1.5;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

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

.msg.bot {
    background: var(--surface);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.msg.bot p {
    margin-bottom: 0.5rem;
}
.msg.bot p:last-child {
    margin-bottom: 0;
}

.msg.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.typing-indicator {
    display: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 1.25rem 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

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

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
}

.chat-input-area input {
    flex: 1;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    outline: none;
    font-size: 0.95rem;
    background: var(--bg-base);
    transition: var(--transition);
}

.chat-input-area input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chat-input-area button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-input-area button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* ========== DETAILS MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.modal.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    background: var(--bg-base);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-header-text h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.close-modal {
    background: rgba(0,0,0,0.05);
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-modal:hover {
    background: #fee2e2;
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.badge {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge.type { background: rgba(236, 72, 153, 0.1); color: var(--secondary); border-color: rgba(236, 72, 153, 0.2); }
.badge.source { background: rgba(14, 165, 233, 0.1); color: var(--accent); border-color: rgba(14, 165, 233, 0.2); }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.detail-item {
    background: var(--bg-base);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.detail-item:hover {
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: var(--shadow-sm);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label .material-symbols-rounded {
    font-size: 18px;
    color: var(--primary);
}

.detail-value {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 500;
}

@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .header-text h1 { font-size: 1.75rem; }
    .chat-container { width: calc(100% - 40px); right: 20px; bottom: 100px; height: 500px;}
}

/* ========== METRICS DASHBOARD ========== */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.smart-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
.smart-metric-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background-size: 200% 100%;
    animation: metricBorderShimmer 3s ease infinite;
}
@keyframes metricBorderShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.smart-metric-card:hover {
    transform: translateY(-6px) scale(1.02);
}

/* Hover glowing shadows */
.metric-blue:hover {
    box-shadow: 0 12px 24px -6px rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.4);
}
.metric-amber:hover {
    box-shadow: 0 12px 24px -6px rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.4);
}
.metric-rose:hover {
    box-shadow: 0 12px 24px -6px rgba(244, 63, 94, 0.25);
    border-color: rgba(244, 63, 94, 0.4);
}
.metric-violet:hover {
    box-shadow: 0 12px 24px -6px rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.4);
}

.metric-blue::before { background: linear-gradient(90deg, #0099ff, #38bdf8); }
.metric-blue .smart-metric-icon { background: rgba(56, 189, 248, 0.1); color: #0077cc; border-color: rgba(56, 189, 248, 0.2); }
.metric-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.metric-amber .smart-metric-icon { background: rgba(245, 158, 11, 0.1); color: #d97706; border-color: rgba(245, 158, 11, 0.2); }
.metric-rose::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.metric-rose .smart-metric-icon { background: rgba(244, 63, 94, 0.1); color: #e11d48; border-color: rgba(244, 63, 94, 0.2); }
.metric-violet::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.metric-violet .smart-metric-icon { background: rgba(139, 92, 246, 0.1); color: #7c3aed; border-color: rgba(139, 92, 246, 0.2); }

.smart-metric-icon { font-size: 1.8rem; width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; border: 1px solid; flex-shrink: 0; }
.smart-metric-data { display: flex; flex-direction: column; }
.smart-metric-label { font-size: 0.82rem; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }
.smart-metric-value { font-size: 1.85rem; font-weight: 800; color: #0f172a; line-height: 1.1; }

[data-theme="dark"] .smart-metric-card {
    background: var(--surface);
    border-color: var(--border);
}
[data-theme="dark"] .smart-metric-value {
    color: #f8fafc;
}

/* ========== FILTER CHIPS ========== */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -12px; margin-bottom: 20px; }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ========== VIEW TOGGLE & STATS ========== */
.view-toggle-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 12px; }
.table-header-bar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px solid #f1f5f9; }
.table-header-bar h3 { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 8px; margin: 0; }
.table-stats { display: flex; gap: 12px; }
.table-stat-badge { padding: 5px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; }
.stat-total { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1d4ed8; border: 1px solid #bfdbfe; }
.stat-filtered { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #16a34a; border: 1px solid #bbf7d0; }

.radio-toggle { display: flex; gap: 4px; background: #ffffff; padding: 4px; border-radius: 12px; border: 1px solid #e2e8f0; }
.radio-toggle label { padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: all 0.2s ease; display: inline-block;}
.radio-toggle input { display: none; }
.radio-toggle label.active { background: linear-gradient(135deg, #0077cc, #0099ff); color: white; box-shadow: 0 4px 12px rgba(0,119,204,0.25); }

/* ========== SCHOOL CARDS GRID ========== */
.school-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 16px; margin-top: 12px; }
.school-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 22px; position: relative; overflow: hidden; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.school-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #0099ff, #38bdf8); }
.school-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px -8px rgba(0,80,180,0.15); border-color: #93c5fd; }
.school-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.school-card-name { font-size: 1.1rem; font-weight: 700; line-height: 1.3; margin-right: 10px; }
.top-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.top-1 { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border: 1px solid #fcd34d; }
.top-2 { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #3730a3; border: 1px solid #a5b4fc; }
.top-other { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }

.school-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.meta-chip { padding: 3px 10px; border-radius: 8px; font-size: 0.78rem; font-weight: 500; background: #f8fafc; color: #64748b; border: 1px solid #f1f5f9; }
.school-card-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-info-item { display: flex; flex-direction: column; gap: 2px; }
.card-info-label { font-size: 0.72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; }
.card-info-value { font-size: 0.88rem; color: #334155; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.school-card-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; }
.card-fee { font-size: 0.92rem; font-weight: 700; color: #0077cc; }
.btn-detail { padding: 6px 12px; border-radius: 8px; background: #f0f9ff; color: #0077cc; border: 1px solid #bae6fd; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; outline: none; }
.btn-detail:hover { background: #0077cc; color: #fff; }

.table-hint { font-size: 0.82rem; color: #94a3b8; font-style: italic; margin-top: 10px; text-align: center; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp 0.5s ease-out forwards; }
.fade-in-delay-1 { animation: fadeInUp 0.5s ease-out 0.1s forwards; opacity: 0; }
.fade-in-delay-2 { animation: fadeInUp 0.5s ease-out 0.2s forwards; opacity: 0; }
.fade-in-delay-3 { animation: fadeInUp 0.5s ease-out 0.3s forwards; opacity: 0; }
.fade-in-delay-4 { animation: fadeInUp 0.5s ease-out 0.4s forwards; opacity: 0; }

/* AI Suggested Prompts */
.suggested-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 1.25rem 15px 1.25rem; }
.prompt-chip { padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; background: #f1f5f9; color: #475569; cursor: pointer; transition: all 0.2s; border: 1px solid #e2e8f0; font-weight: 500; }
.prompt-chip:hover { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }

/* Pagination */
.pagination-bar { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 24px; font-weight: 600; font-size: 0.9rem; margin-bottom: 24px; flex-wrap: wrap; }
.page-btn { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-muted); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-sm); }
.page-btn:hover { background: var(--bg-base); color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.page-btn.active { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border-color: transparent; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25); transform: translateY(-1px); }

/* ========== TOGGLE SWITCH (DARK MODE) ========== */
.switch-theme { position: relative; display: inline-block; width: 60px; height: 34px; z-index: 2; }
.switch-theme input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.2); transition: .4s; backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.4); display: flex; align-items: center; justify-content: space-between; padding: 0 5px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.slider.round { border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 2; }
.switch-theme input:checked + .slider { background-color: rgba(0, 0, 0, 0.4); border-color: rgba(0,0,0,0.6); }
.switch-theme input:checked + .slider:before { transform: translateX(26px); background-color: #1e293b; box-shadow: inset 0 1px 3px rgba(255,255,255,0.3); }
.icon-sun { color: #fde047; font-size: 16px; z-index: 1; }
.icon-moon { color: #cbd5e1; font-size: 16px; z-index: 1; }

/* ========== ACTION BUTTONS & COMPARE CHECKBOX ========== */
.action-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0.75rem 1.25rem; border-radius: var(--radius-lg); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); outline: none; border: 1px solid transparent; position: relative; overflow: hidden; }
.export-btn { background: linear-gradient(135deg, #10b981, #059669); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25); }
.export-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(16, 185, 129, 0.35); }
.map-btn { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25); }
.map-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(245, 158, 11, 0.35); }

.compare-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.col-compare { width: 40px; text-align: center; }

/* ========== FLOATING COMPARE BAR ========== */
.compare-bar { position: fixed; bottom: -80px; left: 50%; transform: translateX(-50%); background: var(--surface); padding: 15px 30px; border-radius: 40px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 20px; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 9900; border: 1px solid var(--border); }
.compare-bar.show { bottom: 30px; }
.compare-bar span { font-weight: 500; color: var(--text-main); font-size: 1rem; }
.compare-bar strong { color: var(--primary); font-size: 1.2rem; }
.compare-actions { display: flex; gap: 10px; }
.btn-cancel { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-base); color: var(--text-muted); font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-cancel:hover { background: #f1f5f9; color: var(--text-main); }
.btn-compare { padding: 8px 20px; border-radius: 20px; border: none; background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); transition: 0.2s; }
.btn-compare:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4); }

/* ========== COMPARE TABLE ========== */
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.compare-table th { background: var(--bg-base); position: sticky; top: 0; z-index: 2; padding: 15px; font-weight: 700; color: var(--text-main); text-align: left; border-bottom: 2px solid var(--border); border-right: 1px solid var(--border); }
.compare-table th:first-child { background: var(--surface); border-right: 2px solid var(--border); z-index: 3; left: 0; width: 180px; }
.compare-table td { padding: 15px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); color: var(--text-main); vertical-align: top; }
.compare-table td:first-child { background: var(--surface); font-weight: 600; color: var(--text-muted); position: sticky; left: 0; z-index: 1; border-right: 2px solid var(--border); }
.compare-table tr:hover td:not(:first-child) { background: rgba(79, 70, 229, 0.02); }

/* Diagnostic Console Overlay */
.diagnostic-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}
.diagnostic-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}
.diagnostic-panel {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.diagnostic-panel.open {
    display: flex;
}
.diagnostic-header {
    background: var(--primary);
    color: white;
    padding: 10px 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.diagnostic-content {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    font-family: monospace;
    font-size: 11px;
    background: #0f172a;
    color: #e2e8f0;
}
.diagnostic-content div {
    margin-bottom: 5px;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 3px;
    word-break: break-all;
    white-space: pre-wrap;
}
.log-error { color: #f87171; }
.log-warn { color: #fbbf24; }
.log-log { color: #38bdf8; }

/* ========== HEADER AI SEARCH BOX ========== */
.header-search-box {
    flex: 1;
    max-width: 480px;
    margin: 0 2rem;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 2px 4px 2px 14px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.header-search-box:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(0, 119, 204, 0.25);
    transform: translateY(-1px);
}
.header-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    padding: 8px 0;
    width: 100%;
}
.header-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.header-search-box button {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    border: none;
    outline: none;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.header-search-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

@media (max-width: 768px) {
    .gradient-header {
        flex-direction: column;
        align-items: stretch;
        padding: 2rem 1.5rem;
    }
    .header-search-box {
        margin: 1rem 0;
        max-width: none;
    }
}

/* ========== SKELETON LOADING EFFECTS ========== */
.skeleton-pulse {
    background: linear-gradient(-90deg, var(--border) 0%, var(--bg-base) 50%, var(--border) 100%);
    background-size: 400% 400%;
    animation: pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
    display: inline-block;
}
@keyframes pulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.skeleton-row-tr td {
    padding: 18px 12px;
}
.skeleton-card-item {
    border: 1px dashed var(--border) !important;
    background: var(--surface) !important;
    pointer-events: none;
}

/* ========== COMPLEMENTARY BUTTON EFFECTS ========== */
.excel-btn:hover {
    background: #059669 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.excel-btn:active {
    transform: translateY(0);
}
.inline-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(2, 132, 199, 0.1);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: inline-spin 0.8s linear infinite;
}
@keyframes inline-spin {
    to { transform: rotate(360deg); }
}

.bar-group rect:hover {
    opacity: 1 !important;
    filter: brightness(1.1);
}
.sync-btn:hover {
    border-color: var(--primary) !important;
    background: rgba(2, 132, 199, 0.04) !important;
}
.filter-chip:hover {
    background: var(--surface) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* ========== HIERARCHICAL MINDMAP LAYOUT (Đối Ngoại Redesign) ========== */
.category-card-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 992px) {
    .category-card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .category-card-container {
        grid-template-columns: 1fr;
    }
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Hardware acceleration */
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.02) perspective(1000px) rotateX(2deg) rotateY(2deg);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(2, 132, 199, 0.1);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:active {
    transform: translateY(-1px) scale(0.98);
}



.category-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.category-card-bg-icon {
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 5rem;
    color: rgba(2, 132, 199, 0.04);
    transform: rotate(-15deg);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.category-card:hover .category-card-bg-icon {
    transform: rotate(0deg) scale(1.15) translateY(-5px);
    color: rgba(2, 132, 199, 0.08);
}

/* Category Card Icon & Background Theme colors matching diagram */
.category-card.cat-all .category-card-icon {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}
.category-card.cat-d4 .category-card-icon {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}
.category-card.cat-d2 .category-card-icon {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
.category-card.cat-transfer .category-card-icon {
    background: rgba(29, 78, 216, 0.1);
    color: #1d4ed8;
}

/* Category Card ACTIVE states (Glowing Premium Gradients) */
.category-card.active {
    border-color: transparent;
}

.category-card.active .category-card-title {
    color: #ffffff !important;
}

.category-card.active .category-card-subtitle {
    color: rgba(255, 255, 255, 0.8) !important;
}

.category-card.active .category-card-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Specific gradients for active cards */
.category-card.cat-all.active {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    box-shadow: 0 12px 20px -8px rgba(100, 116, 139, 0.4);
}

.category-card.cat-d4.active {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 12px 20px -8px rgba(217, 119, 6, 0.4);
}

.category-card.cat-d2.active {
    background: linear-gradient(135deg, #dc2626 0%, #f43f5e 100%);
    box-shadow: 0 12px 20px -8px rgba(220, 38, 38, 0.4);
}

.category-card.cat-transfer.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    box-shadow: 0 12px 20px -8px rgba(29, 78, 216, 0.4);
}

.category-card-info {
    flex: 1;
}

.category-card-title {
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.category-card-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

/* Sub-tabs styles (Horizontal Scrollable Chips) */
.sub-tabs-container {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    margin-bottom: 14px;
    padding: 8px 10px;
    background: var(--surface-glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.sub-tabs-container::-webkit-scrollbar {
    display: none;
}

/* Scroll fade hints */
.sub-tabs-wrapper {
    position: relative;
}

.sub-tabs-wrapper::before,
.sub-tabs-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sub-tabs-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-base), transparent);
}

.sub-tabs-wrapper::after {
    right: 130px; /* Account for sync button */
    background: linear-gradient(to left, var(--bg-base), transparent);
}

.sub-tabs-wrapper.scroll-left::before {
    opacity: 1;
}

.sub-tabs-wrapper.scroll-right::after {
    opacity: 1;
}

.sub-tab-pill {
    padding: 5px 12px;
    border-radius: 30px;
    background: #f1f5f9;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
[data-theme="dark"] .sub-tab-pill {
    background: #1e293b;
    color: #cbd5e1;
}

.sub-tab-pill:hover {
    background: rgba(2, 132, 199, 0.08);
    color: var(--primary);
    transform: translateY(-1px);
}

.sub-tab-pill.active {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

/* Tree layouts for the school details */
.tree-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 15px;
}

.tree-branch {
    border-left: 2px solid var(--border);
    margin-left: 12px;
    padding-left: 18px;
    position: relative;
    opacity: 0;
    transform: translateX(-15px);
    animation: slideInBranch 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInBranch {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tree-branch:nth-child(1) { animation-delay: 0.05s; }
.tree-branch:nth-child(2) { animation-delay: 0.12s; }
.tree-branch:nth-child(3) { animation-delay: 0.19s; }
.tree-branch:nth-child(4) { animation-delay: 0.26s; }
.tree-branch:nth-child(5) { animation-delay: 0.33s; }
.tree-branch:nth-child(6) { animation-delay: 0.4s; }

.tree-branch::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 24px;
    width: 14px;
    height: 2px;
    background: var(--border);
}

.tree-branch-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.tree-grid-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.tree-leaf {
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: var(--transition);
}
[data-theme="dark"] .tree-leaf {
    background: rgba(255, 255, 255, 0.01);
}

.tree-leaf-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tree-leaf-value {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line;
}

.tree-sub-leaf {
    border-top: 1px dashed var(--border);
    margin-top: 10px;
    padding-top: 8px;
}

.badge.top1-badge { background: rgba(217, 119, 6, 0.1); color: #b45309; }
.badge.top2-badge { background: rgba(2, 132, 199, 0.1); color: #0369a1; }
.badge.top3-badge { background: rgba(100, 116, 139, 0.1); color: #475569; }

/* ========== ADVANCED FUTURISTIC AI SEARCH BAR ========== */
.ai-search-group {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(6, 182, 212, 0.04) 100%);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.03);
    transition: var(--transition);
}
[data-theme="dark"] .ai-search-group {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

.ai-search-group:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.08);
}

.ai-search-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.ai-search-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.05) inset;
}

.ai-search-fields-container {
    flex: 1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.ai-search-input-field {
    flex: 1;
    min-width: 250px;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 0.92rem;
    outline: none;
    background: var(--surface);
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.ai-search-input-field:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.ai-search-submit-btn {
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-search-submit-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.ai-search-submit-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ========== SCROLL TO TOP PROGRESS BUTTON ========== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.scroll-to-top.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.scroll-to-top:hover {
    transform: scale(1.08) translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(2, 132, 199, 0.2);
}

.scroll-to-top:active {
    transform: scale(0.95);
}

.progress-ring {
    position: absolute;
    top: 4px;
    left: 4px;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.1s;
    stroke-dasharray: 100.53; /* 2 * PI * r = 2 * 3.14159 * 16 = 100.53 */
    stroke-dashoffset: 100.53;
}

.scroll-to-top .arrow-icon {
    font-size: 20px;
    color: var(--text-main);
    transition: var(--transition);
    z-index: 2;
}

.scroll-to-top:hover .arrow-icon {
    color: var(--primary);
    transform: translateY(-2px);
}

/* ========== RESPONSIVE MOBILE OPTIMIZATIONS ========== */
.sub-tabs-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 16px;
    width: 100%;
}

.sync-btn {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.sync-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .sub-tabs-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .sub-tabs-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding: 10px !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .sub-tabs-container::-webkit-scrollbar {
        display: none;
    }
    
    .sub-tab-pill {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .sync-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Responsive Stats Header Overhaul */
    .view-toggle-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }
    
    .table-header-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        border-bottom: 1px solid var(--border) !important;
        padding-bottom: 12px !important;
    }
    
    .table-header-bar > div:first-child {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .table-stats {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .table-stat-badge {
        text-align: center !important;
        padding: 6px 10px !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }
    
    .radio-toggle {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }
    
    .radio-toggle label {
        flex: 1 !important;
        text-align: center !important;
    }
    
    .radio-toggle .map-btn {
        flex: 1 !important;
        justify-content: center !important;
    }

    /* Prevent filter form squishing */
    .filter-section .filter-content .search-and-tools {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .filter-section .filter-content .search-group.main-search,
    .filter-section .filter-content .tool-group,
    .filter-section .filter-content select {
        width: 100% !important;
        flex: none !important;
    }
    .filter-section .filter-content > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .filter-section .filter-content > div[style*="display: flex"] > div {
        width: 100% !important;
        flex: none !important;
        margin-bottom: 10px !important;
    }
    
    /* Futuristic AI Search Box mobile stacking */
    .ai-search-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .ai-search-icon-wrapper {
        display: none !important;
    }
    
    .ai-search-fields-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .ai-search-input-field {
        min-width: 0 !important;
        width: 100% !important;
        border-radius: var(--radius-sm) !important;
        font-size: 0.88rem !important;
        padding: 10px 14px !important;
    }
    
    .ai-search-submit-btn {
        width: 100% !important;
        justify-content: center !important;
        border-radius: var(--radius-sm) !important;
        padding: 10px 20px !important;
    }
    
    /* Mobile Floating Compare Bar */
    .compare-bar {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        width: calc(100% - 20px) !important;
        transform: none !important;
        padding: 12px 16px !important;
        flex-direction: column !important;
        gap: 12px !important;
        border-radius: var(--radius-md) !important;
    }
    
    .compare-bar.show {
        bottom: 10px !important;
    }
    
    .compare-bar span {
        font-size: 0.9rem !important;
        text-align: center;
    }
    
    .compare-actions {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }
    
    .compare-actions button {
        flex: 1 !important;
        justify-content: center !important;
        padding: 8px 12px !important;
    }

    /* Shift scroll to top button above compare bar when active */
    .scroll-to-top {
        bottom: 20px !important;
        right: 20px !important;
    }
    .compare-bar.show ~ .scroll-to-top {
        bottom: 120px !important;
    }

    /* Header & Main Container mobile optimizations */
    .gradient-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 2.25rem 1.25rem !important;
        gap: 1.25rem !important;
    }
    .gradient-header > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .header-logo {
        width: 54px !important;
        height: 54px !important;
    }
    .header-text h1 {
        font-size: 1.5rem !important;
    }
    .header-text p {
        font-size: 0.8rem !important;
    }
    .switch-theme {
        position: absolute !important;
        top: 2.25rem !important;
        right: 1.25rem !important;
    }
    .main-container {
        padding: 0 12px !important;
        margin-top: -1.75rem !important;
    }
    
    /* Category Card mobile paddings */
    .category-card {
        padding: 14px 16px !important;
        gap: 12px !important;
    }
    .category-card-title {
        font-size: 0.95rem !important;
    }
    .category-card-subtitle {
        font-size: 0.78rem !important;
    }

    /* Fullscreen Modals on mobile to avoid overflows */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    .modal-body {
        padding: 16px 12px !important;
        height: calc(100% - 64px) !important;
    }
}

/* ========== INLINE PROMPT CHIPS (AI) ========== */
.inline-prompt-chip {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.06);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: var(--transition);
    white-space: nowrap;
}
.inline-prompt-chip:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* ========== Leaflet Premium Popups Overwrite ========== */
.premium-map-popup .leaflet-popup-content-wrapper {
    background: var(--surface) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 8px !important;
}
.premium-map-popup .leaflet-popup-tip {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
}
.premium-map-popup .leaflet-popup-close-button {
    color: var(--text-muted) !important;
    font-size: 16px !important;
    top: 8px !important;
    right: 8px !important;
}
.premium-map-popup .leaflet-popup-content {
    margin: 8px 12px !important;
    color: var(--text-main) !important;
}

/* ========================================================================
   🚀 PREMIUM UI ENHANCEMENTS - Floating Orbs, Particles, Animations
   ======================================================================== */

/* ========== FLOATING AMBIENT ORBS ========== */
.ambient-orbs {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: floatOrb 20s ease-in-out infinite;
}

.ambient-orb:nth-child(1) {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -10%; left: -5%;
    animation-duration: 22s;
    animation-delay: 0s;
}

.ambient-orb:nth-child(2) {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
    top: 40%; right: -8%;
    animation-duration: 25s;
    animation-delay: -5s;
}

.ambient-orb:nth-child(3) {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
    bottom: -5%; left: 20%;
    animation-duration: 28s;
    animation-delay: -10s;
}

.ambient-orb:nth-child(4) {
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    top: 20%; left: 50%;
    animation-duration: 30s;
    animation-delay: -15s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

[data-theme="dark"] .ambient-orb {
    opacity: 0.2;
}

/* ========== HEADER PARTICLE DOTS ========== */
.header-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle-dot {
    position: absolute;
    width: 3px; height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: particleFloat 8s ease-in-out infinite;
}

.particle-dot:nth-child(1) { top: 15%; left: 10%; animation-duration: 7s; animation-delay: 0s; width: 4px; height: 4px; }
.particle-dot:nth-child(2) { top: 60%; left: 25%; animation-duration: 9s; animation-delay: -2s; }
.particle-dot:nth-child(3) { top: 30%; left: 50%; animation-duration: 6s; animation-delay: -4s; width: 5px; height: 5px; }
.particle-dot:nth-child(4) { top: 70%; left: 70%; animation-duration: 10s; animation-delay: -1s; }
.particle-dot:nth-child(5) { top: 20%; left: 85%; animation-duration: 8s; animation-delay: -3s; width: 4px; height: 4px; }
.particle-dot:nth-child(6) { top: 50%; left: 40%; animation-duration: 11s; animation-delay: -6s; }
.particle-dot:nth-child(7) { top: 80%; left: 60%; animation-duration: 7.5s; animation-delay: -2s; width: 3px; height: 3px; }
.particle-dot:nth-child(8) { top: 10%; left: 65%; animation-duration: 9.5s; animation-delay: -5s; }

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    25% { transform: translate(15px, -20px) scale(1.5); opacity: 0.7; }
    50% { transform: translate(-10px, 10px) scale(0.8); opacity: 0.4; }
    75% { transform: translate(20px, 15px) scale(1.2); opacity: 0.6; }
}

/* ========== BUTTON RIPPLE & PRESS EFFECTS ========== */
.action-btn,
.ai-search-submit-btn,
.btn-detail,
.btn-compare,
.sync-btn,
.sub-tab-pill,
.category-card {
    position: relative;
    overflow: hidden;
}

.action-btn:active,
.ai-search-submit-btn:active,
.btn-detail:active,
.btn-compare:active,
.sync-btn:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s ease !important;
}

/* Ripple effect via pseudo-element on click */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========== SCROLL REVEAL ANIMATION ========== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== STAGGER ROW ANIMATION ========== */
@keyframes staggerRowIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stagger-row {
    animation: staggerRowIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ========== STAGGER CARD ANIMATION ========== */
@keyframes staggerCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stagger-card {
    animation: staggerCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ========== ANIMATED COUNTER ========== */
.metric-counting {
    display: inline-block;
    transition: transform 0.1s ease;
}

.metric-counting.tick {
    transform: scale(1.15);
}

/* ========== PREMIUM FOOTER ========== */
.premium-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: rgba(255, 255, 255, 0.7);
    padding: 2.5rem 2rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.premium-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #06b6d4, #f59e0b, #ec4899, #6366f1);
    background-size: 300% 100%;
    animation: footerBorderFlow 5s linear infinite;
}

@keyframes footerBorderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-brand img {
    width: 42px; height: 42px;
    border-radius: 10px;
    opacity: 0.9;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
}

.footer-brand-tagline {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.footer-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
}

.footer-info-item:hover {
    color: rgba(255, 255, 255, 0.9);
}

.footer-info-item .material-symbols-rounded {
    font-size: 18px;
    color: #6366f1;
}

.footer-copyright {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    .footer-info {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ========== ENHANCED FOCUS RING ========== */
.search-group.main-search input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12), 0 0 20px rgba(2, 132, 199, 0.08) !important;
}

.ai-search-input-field:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), 0 0 20px rgba(99, 102, 241, 0.06) !important;
}

/* ========== ENHANCED DARK MODE GLOWS ========== */
[data-theme="dark"] .smart-metric-card:hover {
    box-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .school-card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .school-card:hover {
    box-shadow: 0 12px 32px -8px rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .filter-section {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .category-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .radio-toggle {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .page-btn {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}

[data-theme="dark"] .premium-footer {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
}

/* ========== SECTION HEADER ENHANCEMENT ========== */
.section-header h3 {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
}

.section-header h3::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 3px;
    margin-left: 10px;
    vertical-align: middle;
}

/* ========== NOISE TEXTURE OVERLAY ========== */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

[data-theme="dark"] .noise-overlay {
    opacity: 0.03;
}

/* ========== SMOOTH TAB TRANSITION ========== */
.tab-transition-out {
    animation: tabFadeOut 0.2s ease forwards;
}

.tab-transition-in {
    animation: tabFadeIn 0.3s ease forwards;
}

@keyframes tabFadeOut {
    to { opacity: 0; transform: translateY(8px); }
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== LOADING SKELETON SHIMMER UPGRADE ========== */
.skeleton-pulse {
    background: linear-gradient(-90deg, var(--border) 0%, var(--bg-base) 40%, var(--border) 80%);
    background-size: 400% 400%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

@keyframes skeletonShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== TOOLTIP ENHANCEMENT ========== */
[title]:hover::after {
    /* Using browser native tooltips - no custom needed */
}

/* ========== PRINT STYLES ========== */
@media print {
    .ambient-orbs,
    .noise-overlay,
    .header-particles,
    .scroll-to-top,
    .compare-bar,
    .diagnostic-panel,
    .premium-footer::before {
        display: none !important;
    }
}

/* ========================================================= */
/* 💎 ULTRA-PREMIUM GLASSMORPHISM & NEON OVERRIDES 💎 */
/* ========================================================= */

/* 1. Global Background (Mesh Gradient & Vignette) */
body {
    background: 
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(167, 139, 250, 0.15), transparent 25%),
        radial-gradient(circle at 50% 100%, rgba(251, 146, 60, 0.15), transparent 25%),
        linear-gradient(135deg, #f8fafc, #e2e8f0, #f1f5f9) !important;
    background-size: 200% 200% !important;
    animation: premiumMesh 15s ease infinite !important;
    color: #0f172a;
}

[data-theme="dark"] body {
    background: 
        radial-gradient(circle at 15% 50%, rgba(125, 211, 252, 0.3), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(192, 132, 252, 0.3), transparent 25%),
        radial-gradient(circle at 50% 100%, rgba(56, 189, 248, 0.3), transparent 25%),
        linear-gradient(135deg, #09090b, #171717, #0f172a) !important;
    color: #f8fafc;
}

@keyframes premiumMesh {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 2. Glassmorphism Panels (Cards, Filters, Metrics) */
.category-card:not(.active), 
.smart-metric-card, 
.filter-content, 
.sub-tabs-container, 
.table-container {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05), inset 0 1px 1px rgba(255,255,255,0.8) !important;
}

[data-theme="dark"] .category-card:not(.active), 
[data-theme="dark"] .smart-metric-card, 
[data-theme="dark"] .filter-content, 
[data-theme="dark"] .sub-tabs-container, 
[data-theme="dark"] .table-container {
    background: rgba(20, 20, 25, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255,255,255,0.05) !important;
}

/* 3. Neon Highlights on Hover */
.category-card:hover {
    border-color: rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2), inset 0 0 10px rgba(56, 189, 248, 0.05) !important;
}

[data-theme="dark"] .category-card:hover {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(56, 189, 248, 0.1) !important;
}

/* 4. Table Overhaul: Premium Unified Glass Table */
.table-container {
    border-radius: 16px;
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
}
[data-theme="dark"] .table-container {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    padding: 0;
    width: 100%;
    table-layout: auto;
}

th {
    background: rgba(248, 250, 252, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 2px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important;
    padding: 14px 16px !important;
    letter-spacing: 0.5px;
    color: #475569 !important;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
}

[data-theme="dark"] th {
    background: rgba(15, 23, 42, 0.8) !important;
    border-bottom: 2px solid rgba(255,255,255,0.08) !important;
    color: #cbd5e1 !important;
}

tr {
    background: transparent !important;
    box-shadow: none !important;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
}
tr:nth-child(even) {
    background: rgba(241, 245, 249, 0.4) !important;
}
[data-theme="dark"] tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.3) !important;
}

td {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04) !important;
    padding: 1rem 1rem !important;
    box-shadow: none !important;
    font-size: 0.92rem;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.6;
    vertical-align: middle;
    color: #1e293b;
}

[data-theme="dark"] td {
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    color: #f8fafc;
}

/* Subtle styling for long text columns */
.col-wrap {
    color: #475569;
    font-size: 0.88rem;
}
[data-theme="dark"] .col-wrap {
    color: #94a3b8;
}

tr:hover {
    border-left: 3px solid var(--primary);
    background: rgba(2, 132, 199, 0.04) !important;
}
tr:hover td {
    background: transparent !important;
    border-color: rgba(2, 132, 199, 0.1) !important;
}

[data-theme="dark"] tr:hover {
    border-left: 3px solid #38bdf8;
    background: rgba(56, 189, 248, 0.08) !important;
}
[data-theme="dark"] tr:hover td {
    border-color: rgba(56, 189, 248, 0.15) !important;
}

/* Fix col-index border */
.col-index { border-right: none !important; background: transparent !important; }
tr:hover .col-index { background: transparent !important; }

/* 5. Glowing Typography & Metrics */
.smart-metric-value {
    font-family: var(--font-heading);
    letter-spacing: -1px;
}

[data-theme="dark"] .smart-metric-value {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* 6. Neon Buttons */
.action-btn, .btn-compare {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .action-btn, [data-theme="dark"] .btn-compare {
    border-color: rgba(255,255,255,0.1) !important;
}

.action-btn:hover, .btn-compare:hover {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4) !important;
}

/* 7. Header Refinements */
.gradient-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 4px 30px rgba(0,0,0,0.03) !important;
}

[data-theme="dark"] .gradient-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 30px rgba(0,0,0,0.2) !important;
}

.gradient-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(241,245,249,0.3));
    z-index: -1;
}

[data-theme="dark"] .gradient-header::before {
    background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(12,74,110,0.5));
}

.header-text h1, .header-text p {
    color: #0f172a !important;
}
[data-theme="dark"] .header-text h1, [data-theme="dark"] .header-text p {
    color: #f8fafc !important;
}

.header-text h1 span.shimmer-text {
    background: linear-gradient(90deg, #0284c7, #4f46e5, #0ea5e9, #0284c7);
    -webkit-background-clip: text;
    background-size: 200% auto;
}
[data-theme="dark"] .header-text h1 span.shimmer-text {
    background: linear-gradient(90deg, #38bdf8, #818cf8, #38bdf8);
    -webkit-background-clip: text;
}

/* ========================================================= */
/* 🛸 COMMAND CENTER HERO SEARCH 🛸 */
/* ========================================================= */
.command-center-wrapper {
    display: flex;
    justify-content: center;
    position: relative;
    margin-top: -20px;
    margin-bottom: 30px;
    z-index: 1000;
}

.focus-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}

.focus-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.command-center {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 15px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255,255,255,0.8);
    position: relative;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .command-center {
    background: rgba(20, 20, 25, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255,255,255,0.05);
}

.command-center.focused {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 15px 50px rgba(56, 189, 248, 0.3), 0 0 0 2px rgba(56, 189, 248, 0.5);
}

[data-theme="dark"] .command-center.focused {
    box-shadow: 0 15px 50px rgba(56, 189, 248, 0.2), 0 0 0 2px rgba(56, 189, 248, 0.6);
}

.command-center .ai-search-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.spark-icon {
    font-size: 28px;
    color: var(--primary);
    animation: pulse 2s infinite;
}

[data-theme="dark"] .spark-icon {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 15px var(--primary); }
    100% { transform: scale(1); opacity: 0.8; }
}

.command-center .ai-search-input-field {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.15rem;
    color: var(--text-main);
    outline: none;
    font-weight: 500;
}
.command-center .ai-search-input-field::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.7;
}

.command-center .ai-search-submit-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

.command-center .ai-search-submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.inline-ai-prompts {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}
[data-theme="dark"] .inline-ai-prompts {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Response Container */
.ai-response-header {
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    margin-top: 15px;
}
[data-theme="dark"] .ai-response-header {
    color: #38bdf8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.close-ai-response-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.close-ai-response-btn:hover {
    background: rgba(0,0,0,0.05);
}
[data-theme="dark"] .close-ai-response-btn:hover {
    background: rgba(255,255,255,0.1);
}

.ai-loading-state {
    display: flex; align-items: center; gap: 10px; color: var(--text-muted); padding: 10px 0;
}
