/* CSS Reset and Theming */
        :root {
            --primary-blue: #0066cc;
            --primary-accent: #ffc107;
            --bg-main: #f7f9fc;
            --bg-card: #ffffff;
            --text-primary: #1d2d3f;
            --text-secondary: #5a6b7d;
            --border-color: #e3e9f0;
            --gradient: linear-gradient(135deg, var(--primary-blue), #007bff);
            --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.05);
            --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.08);
            --font-sans: 'Poppins', sans-serif;
        }

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

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

        body {
            font-family: var(--font-sans);
            background-color: var(--bg-main);
            color: var(--text-primary);
            line-height: 1.7;
        }

        /* Main Container and Section Styling */
        .container {
            max-width: 1200px;
            margin: auto;
            padding: 2rem;
        }

        .results-category {
            margin-bottom: 5rem;
            animation: fadeIn 0.6s ease-out forwards;
        }

        .category-header {
            text-align: center;
            margin-bottom: 3rem;
        }

        .section-title {
            font-size: clamp(2.5rem, 5vw, 3.5rem);
            font-weight: 800;
            color: var(--text-primary);
            margin-bottom: 1rem;
            line-height: 1.2;
        }

        .section-title span {
            color: var(--primary-blue);
            position: relative;
        }
        
        .section-subtitle, .category-description {
            font-size: 1.1rem;
            color: var(--text-secondary);
            max-width: 650px;
            margin: 0 auto;
        }

        .category-title {
            font-size: 2.25rem;
            font-weight: 700;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 0.5rem;
        }

        .category-title i {
            color: var(--primary-blue);
            font-size: 1.8rem;
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1.5rem;
        }

        .stat-card {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 2rem;
            text-align: center;
            border: 1px solid var(--border-color);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            box-shadow: var(--shadow-light);
        }

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

        .stat-number {
            font-size: 3.5rem;
            font-weight: 700;
            background: var(--gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 0.25rem;
            line-height: 1;
        }

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

        /* Class Tabs */
        .class-tabs {
            display: flex;
            justify-content: center;
            gap: 1rem;
            flex-wrap: wrap;
            margin-bottom: 3rem;
        }

        .tab-button {
            padding: 0.75rem 1.75rem;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            border-radius: 50px;
            color: var(--text-secondary);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.95rem;
        }

        .tab-button.active {
            background: var(--primary-blue);
            color: #fff;
            border-color: var(--primary-blue);
            box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
        }

        .tab-button:hover:not(.active) {
            border-color: var(--primary-blue);
            color: var(--primary-blue);
        }

        .results-content { display: none; }
        .results-content.active { display: block; }

        /* Topper Results Grid */
        .results-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
        }

        .result-card {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 1.5rem;
            box-shadow: var(--shadow-medium);
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
            text-align: center;
        }
        
        .result-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 12px 30px rgba(0,0,0,0.1);
        }

        .highlight-card {
            border: 2px solid var(--primary-accent);
            box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
        }

        .result-image {
            width: 130px;
            height: 130px;
            border-radius: 50%;
            border: 4px solid var(--primary-blue);
            margin: 0 auto 1.5rem auto;
            position: relative;
            box-shadow: 0 5px 15px rgba(0, 102, 204, 0.15);
        }

        .result-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .result-badge {
            position: absolute;
            top: -10px;
            right: -10px;
            background: var(--primary-accent);
            color: var(--text-primary);
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1rem;
            border: 3px solid var(--bg-card);
        }

        .result-content h4 {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            color: var(--text-primary);
        }

        .class-info {
            font-size: 1rem;
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
        }

        .result-score span {
            font-size: 2rem;
            font-weight: 700;
            color: var(--primary-blue);
            display: block;
            margin-bottom: 0.75rem;
        }

        .progress-bar {
            height: 8px;
            background: #e9ecef;
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: var(--gradient);
            border-radius: 4px;
        }
        
        /* Result Improvement Section */
        .improvement-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 1.5rem;
        }

        .improvement-card {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 2rem;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-light);
            text-align: center;
            transition: all 0.3s ease;
        }

        .improvement-card:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-medium);
        }

        .improvement-student h4 {
            font-size: 1.4rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .improvement-student p {
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
        }

        .improvement-scores {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .score-box {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            width: 120px;
        }

        .score-box.before {
            background: #f1f5f9;
        }

        .score-box.after {
            background: #e0f2fe;
        }

        .score-label {
            display: block;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .score-box.before .score-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-secondary);
        }

        .score-box.after .score-value {
            font-size: 1.8rem;
            font-weight: 800;
            color: var(--primary-blue);
        }

        .score-arrow {
            font-size: 2rem;
            color: var(--primary-blue);
        }

        .improvement-badge {
            display: inline-block;
            background: var(--primary-accent);
            color: var(--text-primary);
            padding: 0.5rem 1.25rem;
            border-radius: 50px;
            font-weight: 700;
        }

        /* Section Divider */
        .section-divider {
            height: 1px;
            background: var(--border-color);
            margin: 0 0 5rem 0;
            position: relative;
        }

        .section-divider::before {
            content: '\f005'; /* Font Awesome star icon */
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--bg-main);
            padding: 0 1rem;
            color: var(--primary-accent);
            font-size: 1.5rem;
        }

        /* Legacy Achievers Section */
        .legacy-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 1.5rem;
        }

        .legacy-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1.5rem;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-light);
        }

        .legacy-card:hover {
            transform: scale(1.03);
            box-shadow: var(--shadow-medium);
        }

        .legacy-image {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            flex-shrink: 0;
            overflow: hidden;
            border: 3px solid var(--text-secondary);
            opacity: 0.8;
        }

        .legacy-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .legacy-info h4 {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.1rem;
        }

        .legacy-info .legacy-details {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
        }

        .legacy-info .legacy-score {
            font-size: 1rem;
            font-weight: 700;
            color: var(--primary-blue);
        }

        /* All Achievers List */
        .leaderboard-top3-grid {
            display: grid;
            grid-template-columns: 1fr 1.2fr 1fr;
            gap: 1.5rem;
            align-items: flex-end;
            margin-bottom: 3rem;
        }

        .leaderboard-card {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 2rem 1.5rem;
            text-align: center;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-medium);
            position: relative;
            transition: all 0.3s ease;
        }
        .leaderboard-card:hover {
            transform: translateY(-10px);
        }

        .leaderboard-card .student-image {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 4px solid var(--border-color);
            margin: 0 auto 1rem;
        }
        .leaderboard-card .student-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }
        .leaderboard-card h4 {
            font-size: 1.4rem;
            font-weight: 600;
            margin-bottom: 0.2rem;
        }
        .leaderboard-card p {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 1rem;
        }
        .leaderboard-card .score-value {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--primary-blue);
        }
        .leaderboard-rank {
            position: absolute;
            top: 1rem;
            left: 1rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--bg-main);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--text-secondary);
        }
        .leaderboard-card.rank-1 {
            padding-top: 3rem;
            border-color: var(--primary-accent);
        }
        .leaderboard-card.rank-1 .leaderboard-rank {
            background: var(--primary-accent);
            color: var(--text-primary);
            transform: scale(1.2);
            top: 1.5rem;
        }
        .leaderboard-card.rank-1 .student-image {
            width: 120px;
            height: 120px;
            border-color: var(--primary-accent);
        }

        .all-results-container {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 1rem;
            box-shadow: var(--shadow-medium);
            border: 1px solid var(--border-color);
        }
        .all-results-container.hidden-list {
            display: none;
        }

        .result-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            transition: background-color 0.3s ease;
        }

        .result-item:last-of-type { border-bottom: none; }
        .result-item:hover { background-color: var(--bg-main); }

        .student-info {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            flex-grow: 1;
        }

        .student-image {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            border: 3px solid var(--primary-blue);
            flex-shrink: 0;
        }

        .student-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .student-details h4 {
            font-size: 1.1rem;
            font-weight: 600;
            margin: 0 0 0.1rem 0;
            color: var(--text-primary);
        }

        .student-details p {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin: 0;
        }

        .student-score {
            width: 200px;
            text-align: right;
            flex-shrink: 0;
        }

        .score-value {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--primary-blue);
            margin-bottom: 0.25rem;
        }

        /* Buttons */
        .view-more { text-align: center; margin-top: 2rem; }
        .btn {
            padding: 0.85rem 2rem;
            border-radius: 50px;
            font-weight: 600;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            transition: all 0.3s ease;
            font-size: 1rem;
            border: 2px solid transparent;
            cursor: pointer;
        }
        .btn-primary {
            background: var(--primary-blue);
            color: #fff;
        }
        .btn-primary:hover {
            background: #0056b3;
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0,102,204,0.25);
        }
        .btn-secondary {
            background: transparent;
            color: var(--primary-blue);
            border-color: var(--primary-blue);
        }
        .btn-secondary:hover {
            background: var(--primary-blue);
            color: #fff;
            transform: translateY(-2px);
        }
        .btn-accent {
            background: var(--primary-accent);
            color: var(--text-primary);
        }
        .btn-accent:hover {
            background: #ffcd39;
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(255,193,7,0.3);
        }

        /* Final CTA - Updated Design */
        .final-cta {
            background: var(--bg-card);
            border-radius: 24px;
            padding: 3rem;
            margin-top: 4rem;
            display: grid;
            grid-template-columns: 1fr 2fr;
            align-items: center;
            gap: 3rem;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-medium);
        }

        .cta-placeholder {
            width: 220px;
            height: 220px;
            border-radius: 50%;
            background-color: var(--bg-main);
            border: 4px dashed var(--primary-blue);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            margin: auto;
        }
        .cta-placeholder i {
            font-size: 4rem;
            color: var(--primary-blue);
            opacity: 0.7;
            margin-bottom: 0.5rem;
        }
        .cta-placeholder-text {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--primary-blue);
        }

        .cta-content {
            text-align: left;
        }

        .cta-content h3 {
            font-size: 2.5rem;
            font-weight: 800;
            line-height: 1.2;
            margin-bottom: 1rem;
            color: var(--text-primary);
        }
        .cta-content h3 span {
            color: var(--primary-blue);
        }

        .cta-content p {
            font-size: 1.1rem;
            color: var(--text-secondary);
            margin-bottom: 2rem;
            max-width: 500px;
        }

        .cta-buttons {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        /* Responsive Styles */
        @media (max-width: 900px) {
            .final-cta {
                grid-template-columns: 1fr;
                text-align: center;
            }
            .cta-content {
                text-align: center;
            }
            .cta-content p {
                margin-left: auto;
                margin-right: auto;
            }
            .cta-buttons {
                justify-content: center;
            }
        }

        @media (max-width: 768px) {
            .container { padding: 1.5rem; }
            .leaderboard-top3-grid {
                grid-template-columns: 1fr;
                align-items: stretch;
                gap: 2rem;
            }
            .leaderboard-card.rank-1 {
                order: -1; /* Puts the 1st rank card on top on mobile */
            }
            .result-item {
                flex-direction: column;
                gap: 1rem;
                text-align: center;
            }
            .student-info {
                flex-direction: column;
                gap: 1rem;
            }
            .student-score {
                width: 100%;
                text-align: center;
            }
        }
        @media (max-width: 480px) {
            .stats-grid, .results-grid, .legacy-grid, .improvement-grid {
                grid-template-columns: 1fr;
            }
            .cta-buttons {
                flex-direction: column;
                align-items: stretch;
            }
            .btn {
                justify-content: center;
            }
            .cta-placeholder {
                width: 180px;
                height: 180px;
            }
            .cta-placeholder i {
                font-size: 3rem;
            }
            .cta-content h3 {
                font-size: 2rem;
            }
        }
        @media (max-width: 390px) {
            .stats-grid,
            .results-grid,
            .legacy-grid,
            .improvement-grid,
            .leaderboard-top3-grid {
                grid-template-columns: 1fr !important;
                justify-items: center;
                align-items: center;
            }
            .stat-card,
            .result-card,
            .legacy-card,
            .improvement-card,
            .leaderboard-card {
                margin-left: auto;
                margin-right: auto;
                width: 100%;
                max-width: 320px;
                box-sizing: border-box;
            }
            .all-results-container .result-item {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }
            .student-info {
                flex-direction: column;
                align-items: center;
                gap: 0.5rem;
            }
            .student-score {
                width: 100%;
                text-align: center;
            }
            .final-cta {
                grid-template-columns: 1fr !important;
                text-align: center;
                padding: 1.5rem;
                gap: 1.5rem;
            }
            .cta-content h3 {
                font-size: 1.3rem;
            }
            .cta-placeholder {
                width: 120px;
                height: 120px;
                min-width: 120px;
                min-height: 120px;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                position: relative;
                margin: 0 auto 1rem auto;
            }
            .cta-placeholder i {
                font-size: 2.2rem;
                margin-bottom: 0.2rem;
                position: static;
                z-index: 1;
            }
            .cta-placeholder-text {
                font-size: 1rem;
                font-weight: 600;
                color: var(--primary-blue);
                margin-top: 0.2rem;
                z-index: 1;
            }
        }