/* Natega 2026 Modern Design System */

@font-face {
    font-family: 'KOMediaBlack';
    src: url('alfont_com_KOMedia-Black.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    font-family: 'KOMediaBlack', 'Cairo', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', system-ui, sans-serif;
}

:root {
    --font-primary: 'KOMediaBlack', 'Cairo', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', system-ui, -apple-system, sans-serif;
    --font-numeric: 'KOMediaBlack', 'Outfit', 'Cairo', sans-serif;
    
    /* Dark Theme Palette (Coffee & Beige) */
    --bg-dark: #16100c;
    --bg-card: rgba(38, 27, 20, 0.88);
    --bg-card-border: rgba(212, 163, 115, 0.22);
    --text-main: #fefae0;
    --text-muted: #d4c3b3;
    
    /* Accent Colors (Coffee Gold & Warm Latte) */
    --primary: #d4a373;
    --primary-hover: #bc8a5f;
    --primary-glow: rgba(212, 163, 115, 0.35);
    --emerald: #588157;
    --emerald-glow: rgba(88, 129, 87, 0.3);
    --gold: #e6c594;
    --gold-glow: rgba(230, 197, 148, 0.3);
    --crimson: #ddb892;
    --blue: #d4a373;
    
    /* Glassmorphism */
    --glass-blur: blur(20px);
    --shadow-subtle: 0 12px 40px rgba(0, 0, 0, 0.45);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
    --bg-dark: #faf6f0;
    --bg-card: rgba(245, 239, 230, 0.92);
    --bg-card-border: rgba(188, 138, 95, 0.22);
    --text-main: #271d15;
    --text-muted: #6c584c;
    --shadow-subtle: 0 12px 40px rgba(108, 88, 76, 0.12);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Background Glowing Blobs */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
}

.blob-1 {
    top: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: #d4a373;
}

.blob-2 {
    bottom: -15%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: #a3b18a;
}

.blob-3 {
    top: 40%;
    left: 30%;
    width: 400px;
    height: 400px;
    background: #cb997e;
}

/* Header */
.main-header {
    padding: 18px 0;
    border-bottom: 1px solid var(--bg-card-border);
    backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #d4a373, #9c6638);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 8px 20px var(--primary-glow);
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.logo-text h1 span {
    color: var(--primary);
    font-family: var(--font-numeric);
}

.logo-text .subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--bg-card-border);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.icon-btn:hover {
    transform: scale(1.08);
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px var(--primary-glow);
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Search Hero Section */
.search-section {
    padding: 30px 0;
}

.search-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
    box-shadow: var(--shadow-subtle);
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 30px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
}

.search-card h2 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 8px;
}

.search-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--bg-card-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.light-theme .tab-btn {
    background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto 16px;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 46px 14px 40px;
    border-radius: var(--radius-md);
    border: 2px solid var(--bg-card-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.light-theme .input-wrapper input {
    background: rgba(255, 255, 255, 0.9);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.clear-btn {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.btn-search {
    padding: 14px 28px;
    font-size: 15px;
    white-space: nowrap;
}

.search-tips {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 6px;
    align-items: center;
}

/* Stats Bar Grid */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: var(--glass-blur);
    padding: 18px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-subtle);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.gold {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
}

.stat-icon.blue {
    background: rgba(6, 182, 212, 0.15);
    color: var(--blue);
}

.stat-info h3 {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-numeric);
    line-height: 1.2;
}

.stat-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Results Display Card */
.results-section {
    margin-bottom: 40px;
    animation: fadeInUp 0.4s ease-out;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-subtle);
    position: relative;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bg-card-border);
    flex-wrap: wrap;
    gap: 12px;
}

.student-status-badge {
    padding: 6px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald);
    border: 1px solid var(--emerald);
}

.header-tools {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary);
    color: #fff;
}

.student-main-info {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.avatar-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 8px 20px var(--primary-glow);
    flex-shrink: 0;
}

.name-block h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.meta-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    font-size: 13px;
    color: var(--text-muted);
}

.tag strong {
    color: var(--text-main);
    font-family: var(--font-numeric);
}

/* Score Display Grid */
.score-display-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.score-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-card-border);
    padding: 20px 16px;
    border-radius: var(--radius-md);
    text-align: center;
}

.light-theme .score-card {
    background: rgba(255, 255, 255, 0.6);
}

.score-card .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.big-score {
    font-size: 36px;
    font-weight: 900;
    font-family: var(--font-numeric);
    color: var(--emerald);
}

.max-score {
    font-size: 16px;
    color: var(--text-muted);
    font-family: var(--font-numeric);
}

.big-percent {
    font-size: 32px;
    font-weight: 900;
    font-family: var(--font-numeric);
    color: var(--primary);
}

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

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--emerald));
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.grade-badge {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold);
    margin-top: 6px;
}

.card-footer {
    text-align: center;
    border-top: 1px dashed var(--bg-card-border);
    padding-top: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

/* List Results Table */
.list-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    box-shadow: var(--shadow-subtle);
}

.list-header {
    margin-bottom: 16px;
}

.list-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 500px;
}

.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: right;
    border-bottom: 1px solid var(--bg-card-border);
    font-size: 13px;
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 700;
}

.data-table tr:hover {
    background: rgba(99, 102, 241, 0.08);
    cursor: pointer;
}

/* Error / Not Found */
.error-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 36px 20px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    color: var(--crimson);
    margin-bottom: 12px;
}

/* Top Section */
.top-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.section-title {
    text-align: center;
    margin-bottom: 24px;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 900;
}

.gold-icon {
    color: var(--gold);
}

.top-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.top-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: var(--glass-blur);
    padding: 18px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}

.top-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.rank-badge {
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #9c6638);
    color: #fefae0;
    font-weight: 800;
    font-size: 13px;
    font-family: var(--font-numeric);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
    flex-shrink: 0;
}

.top-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.top-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.top-score {
    margin-right: auto;
    font-size: 18px;
    font-weight: 900;
    font-family: var(--font-numeric);
    color: var(--emerald);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 900px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }
    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .logo-text h1 {
        font-size: 16px;
    }
    .logo-text .subtitle {
        font-size: 10px;
    }
    .search-card {
        padding: 20px 14px;
        border-radius: var(--radius-md);
    }
    .search-card h2 {
        font-size: 20px;
    }
    .search-tabs {
        width: 100%;
    }
    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
        font-size: 12px;
        min-height: 44px;
    }
    .search-box {
        flex-direction: column;
        gap: 10px;
    }
    .search-input-wrapper input {
        min-height: 48px;
        font-size: 15px;
    }
    .btn-search {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
        justify-content: center;
    }
    .rank-stat-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .rank-box, .percentile-box {
        padding: 14px 16px;
    }
    .chart-box {
        padding: 14px 10px;
    }
    .canvas-wrapper {
        width: 100%;
        overflow-x: hidden;
    }
    #bellCurveCanvas {
        width: 100% !important;
        height: auto !important;
    }
    .subject-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tansiq-grid {
        grid-template-columns: 1fr;
    }
    .top-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }
    .logo-text h1 {
        font-size: 14px;
    }
    .tab-btn {
        font-size: 11px;
        padding: 8px 4px;
    }
    .rank-info h4, .percentile-info h4 {
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .main-header, .search-section, .stats-bar, .top-section, .main-footer, .header-tools, .glow-bg {
        display: none !important;
    }
    .result-card {
        border: 2px solid #000 !important;
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
        padding: 40px !important;
    }
    .big-score, .big-percent {
        color: #000 !important;
    }
}

/* Subject Breakdown Section */
.subject-breakdown-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--bg-card-border);
}

.section-subtitle {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.subjects-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.subjects-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 12px 14px;
    text-align: right;
    font-weight: 700;
    border-bottom: 2px solid var(--bg-card-border);
}

.light-theme .subjects-table th {
    background: rgba(0, 0, 0, 0.03);
}

.subjects-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--bg-card-border);
    color: var(--text-main);
}

.subjects-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.subj-score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    font-family: var(--font-numeric);
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rank-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    font-family: var(--font-numeric);
}

.branch-pill {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.nation-pill {
    background: rgba(6, 182, 212, 0.15);
    color: var(--blue);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Analytics Card & Bell Curve Section */
.analytics-card-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--bg-card-border);
}

.rank-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 640px) {
    .rank-stat-grid {
        grid-template-columns: 1fr;
    }
}

.rank-box, .percentile-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bg-card-border);
    padding: 18px 20px;
    border-radius: var(--radius-md);
}

.light-theme .rank-box, .light-theme .percentile-box {
    background: rgba(255, 255, 255, 0.7);
}

.rank-icon, .percentile-icon {
    font-size: 32px;
    color: var(--amber);
    flex-shrink: 0;
}

.percentile-icon {
    color: #8b5cf6;
}

.rank-info span, .percentile-info span {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
}

.rank-info h4, .percentile-info h4 {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    margin: 4px 0 2px 0;
}

.light-theme .rank-info h4, .light-theme .percentile-info h4 {
    color: #4a2810;
}

.rank-info p, .percentile-info p {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    opacity: 0.95;
}

/* Bell Curve Box */
.chart-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.light-theme .chart-box {
    background: rgba(255, 255, 255, 0.8);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-header h5 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.canvas-wrapper {
    width: 100%;
    overflow-x: auto;
}

#bellCurveCanvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Branch Track Tabs for Top Performers */
.top-track-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.top-tab-btn {
    padding: 10px 18px;
    border-radius: 30px;
    border: 1px solid var(--bg-card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.light-theme .top-tab-btn {
    background: rgba(0, 0, 0, 0.03);
}

.top-tab-btn:hover {
    color: var(--text-main);
    border-color: var(--primary);
}

.top-tab-btn.active {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px var(--primary-glow);
}

/* Tansiq Predictor Section */
.tansiq-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--bg-card-border);
}

.tansiq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.tansiq-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tansiq-badge {
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 12px;
    font-weight: 800;
}

.tansiq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.tansiq-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.light-theme .tansiq-card {
    background: rgba(255, 255, 255, 0.7);
}

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

.tcard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tcard-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.prob-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-numeric);
}

.prob-high {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.prob-med {
    background: rgba(245, 158, 11, 0.2);
    color: var(--gold);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.prob-low {
    background: rgba(239, 68, 68, 0.15);
    color: var(--crimson);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tcard-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.prob-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.prob-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease-in-out;
}

/* Footer */
.main-footer {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    font-size: 13px;
}


/* ==========================================================================
   Mobile Performance & Lightweight Responsive Optimization (60 FPS Mobile)
   ========================================================================== */

/* Remove GPU-heavy backdrop-blur and keyframe animations on mobile screens for instant scrolling */
@media (max-width: 768px) {
    :root {
        --glass-blur: none !important;
    }

    /* Disable heavy blurred background blobs on mobile */
    .glow-bg, .blob {
        display: none !important;
    }

    /* Use crisp, fast solid-opaque backgrounds for cards */
    .bg-card, .search-card, .result-card, .total-card, .pf-card, 
    .band-card, .compare-card, .tansiq-card, .calc-card, .dir-controls, 
    .table-wrap, .main-header, .rank-box, .percentile-box, .chart-box {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body {
        background-color: var(--bg-dark);
        /* Simple lightweight static gradient fallback */
        background-image: radial-gradient(circle at top right, rgba(212, 163, 115, 0.08), transparent 60%);
    }

    /* Prevent iOS auto-zoom on input focus by enforcing 16px font-size */
    input[type="text"], input[type="number"], select, .styled-input, .styled-select {
        font-size: 16px !important;
    }

    /* Touch-friendly header & compact navigation */
    .main-header {
        padding: 10px 0;
    }

    .header-content {
        gap: 8px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .logo-text h1 {
        font-size: 15px;
    }

    .logo-text .subtitle {
        font-size: 9px;
    }

    .header-actions {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .header-actions .btn {
        padding: 6px 10px;
        font-size: 11px !important;
        border-radius: 20px;
    }

    .visitor-badge {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }

    /* Search & Calc Hero Tweaks */
    .pred-hero, .analytics-hero, .search-section {
        padding: 1.2rem 0 1rem;
    }

    .pred-hero h2, .analytics-hero h2, .search-card h2 {
        font-size: 1.35rem;
    }

    .pred-hero p, .analytics-hero p, .search-desc {
        font-size: 0.82rem;
    }

    /* Calculator & Form Controls */
    .calc-card {
        padding: 1.2rem;
        margin: 1rem 0 1.5rem;
    }

    .calc-header {
        margin-bottom: 0.8rem;
    }

    .calc-icon {
        font-size: 1.5rem;
    }

    .calc-title {
        font-size: 1rem;
    }

    .mode-toggle-btn {
        font-size: 0.72rem;
        padding: 4px 10px;
        width: 100%;
        text-align: center;
    }

    .calc-form {
        grid-template-columns: 1fr !important;
        gap: 0.6rem;
    }

    .calc-btn {
        height: 42px;
        font-size: 0.88rem;
    }

    /* Responsive Directory Controls */
    .dir-controls {
        padding: 0.9rem;
    }

    .dir-search-row {
        grid-template-columns: 1fr !important;
        gap: 0.6rem;
    }

    .track-pills {
        gap: 0.35rem;
    }

    .pill-btn {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    /* Table Mobile Optimizations */
    .pred-table th, .pred-table td {
        padding: 10px 8px;
        font-size: 0.78rem;
    }

    .score-val {
        font-size: 0.88rem;
    }

    .trend-badge {
        font-size: 0.68rem;
        padding: 1px 5px;
    }

    /* Pagination Mobile */
    .pagination-wrap {
        font-size: 0.78rem;
        justify-content: center;
        text-align: center;
    }

    /* Disclaimer Note Mobile */
    .disclaimer-note {
        font-size: 0.72rem !important;
        padding: 0 10px;
    }
}

/* Fast hardware rendering hints for smooth scrolling */
.result-card, .top-card, .tansiq-card, .total-card, .pf-card, .band-card {
    content-visibility: auto;
    contain-intrinsic-size: 100px;
}
