* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        @font-face {
            font-family: '29LTBukra';
            font-style: normal;
            font-display: swap;
            font-weight: 300;
            src: url('../fonts/29ltbukralight.ttf') format('truetype');
            }

            /* 29LT Bukra Bold (TrueType only) */
        @font-face {
            font-family: '29LTBukra';
            font-style: normal;
            font-display: swap;
            font-weight: 700;
            src: url('../fonts/29ltbukrabold.ttf') format('truetype');
        }
        :root {
            --primary-dark: #14141F;
            --primary-gold: #B2845D;
            --background-beige: #F7F5F0;
            --secondary-beige: #F2E8E4;
            --dark-green: #171D1A;
            --gold-light: rgba(178, 132, 93, 0.8);
            --gold-dark: rgba(178, 132, 93, 1.2);
            /* addition */
            --brand:   #8B6B2B;   /* Dark Gold 1 */
            --brand-2: #B8860B;   /* Dark Gold 2 */
            --ink: #1b1b1b;
            --muted: #6b6b6b;
            --track: #e5ded5;    
            --shadow: 0 8px 30px rgba(0,0,0,.08);
            --radius: 16px;
        }

        body {
            font-family:'29LTBukra',  'Noto Sans Arabic', sans-serif;
            background-color: var(--background-beige);
            color: var(--primary-dark);
            line-height: 1.6;
            overflow-x: hidden;
        }


        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }


        /* Header */
        .header {
            background-color: var(--primary-dark);
            padding: 1rem 0;
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
            transition: all 0.3s ease;
            /* height: 70px; Add fixed height */
        }

        .nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .logo {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            padding-bottom: 4px;
            gap: 1rem;
        }

        .heading {
            color: white;
            font-size: 1.5rem;
            font-weight: 700;
            text-decoration: none;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        .nav-links {
            display: flex;
            list-style: none;
            gap: 2rem;
            align-items: center;
        }

        .nav-links a {
            color: white;
            text-decoration: none;
            font-weight: 300;
            transition: color 0.3s ease;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        .nav-links a:hover {
            color: var(--primary-gold);
        }
        .nav-links .header-button a:hover {
            color: white
        }
        .header-button:hover {
            background: var(--brand, #8B6B2B);
            color: #fff !important;
        }

        /* Add or update logo styles */
        .nav img {
            height: 40px;  /* Adjust this value to match your desired logo height */
            width: auto;
            object-fit: contain;
        }

        .nav a img {
            display: block;
            max-width: 100%;
        }

        h2{
            padding-bottom: 10px;
        }

        /* Hero Section */
        .hero {
            background: linear-gradient(rgba(20, 20, 31, 0.8), rgba(23, 29, 26, 0.8)), 
                        url('../images/heroimage.jpg');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            color: white;
            text-align: center;
            padding: 180px 0 80px; 
            position: relative;
            overflow: hidden;
            margin-top: 70px;
        }
        .hero-female{
            background:
            linear-gradient(rgba(20, 20, 31, 0.8), rgba(23, 29, 26, 0.8)), 
            url('../images/moshaf.jpg');
                        background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            color: white;
            text-align: center;
            padding: 180px 0 80px; 
            position: relative;
            overflow: hidden;
            margin-top: 70px;
        }
        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23B2845D' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
            opacity: 0.3;
        }

        .hero-content {
            position: relative;
            z-index: 2;
        }

        .hero h1 {
            font-size: 3rem;
            margin-bottom: 1rem;
            font-weight: 700;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }
        .dropdown-label {
            font-size: 17px !important;
            margin-bottom: 1rem !important;
            font-weight: 700;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        .hero p {
            font-size: 1.2rem;
            margin-bottom: 2rem;
            opacity: 0.9;
        }

        .cta-button {
            background: var(--primary-gold);
            color: white;
            padding: 1rem 2.5rem;
            border: none;
            border-radius: 30px;
            font-size: 1.1rem;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            transition: all 0.3s ease;
            font-weight: 700;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        .cta-button:hover {
            background: var(--gold-light);
            transform: translateY(-3px);
        }

        .selector-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 700;
            font-size: 1.2rem;
            color: var(--primary-dark);
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        /* Image Carousel */
        .carousel-container {
            margin: 3rem 0;
            position: relative;
            border-radius: 15px;
            overflow: hidden;
        }

        .carousel {
            display: flex;
            transition: transform 0.5s ease;
            height: 300px;
        }

        .carousel-slide {
            min-width: 100%;
            height: 300px;
            background: var(--secondary-beige);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: var(--primary-dark);
            position: relative;
        }

        .carousel-slide::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, transparent 30%, var(--primary-gold) 31%, var(--primary-gold) 33%, transparent 34%),
                        linear-gradient(-45deg, transparent 30%, var(--primary-gold) 31%, var(--primary-gold) 33%, transparent 34%);
            background-size: 40px 40px;
            opacity: 0.1;
        }

        .carousel-dots {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 1rem;
        }

        .dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--primary-gold);
            opacity: 0.5;
            cursor: pointer;
            transition: opacity 0.3s ease;
        }

        .dot.active {
            opacity: 1;
        }

        .groups-analytics{
            text-align: center;
            padding: 2rem 0;
        }
        
         /* School Selector Styles */
        .school-selector-wrapper {
            display: inline-block;
            position: relative;
        }

        .school-selector {
            background: var(--primary-gold);
            color: white;
            padding: 1rem 3rem 1rem 2.5rem;
            border: none;
            border-radius: 30px;
            font-size: 1.1rem;
            cursor: pointer;
            font-weight: 700;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
            transition: all 0.3s ease;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            min-width: 300px;
            text-align: right;
        }

        /* .school-selector:hover {
            background: var(--gold-light);
            transform: translateY(-3px);
        } */

        .school-selector:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(178, 132, 93, 0.3);
        }

        .school-selector option {
            background: var(--primary-dark);
            color: white;
            padding: 10px;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        /* dropdown arrow */
        .school-selector-wrapper::after {
            content: '▼';
            position: absolute;
            top: 50%;
            left: 20px;
            transform: translateY(-50%);
            color: white;
            pointer-events: none;
            font-size: 0.8rem;
        }
        /* Analytics Cards */
        .analytics-section {
            padding: 4rem 0;
        }

        .section-title {
            text-align: center;
            font-size: 2.5rem;
            margin-bottom: 3rem;
            color: var(--primary-dark);
            font-weight: 700;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
            position: relative;
            
        }
        .groups-section-title {
            text-align: right;
            font-size: 32px;
            margin-bottom: 1.5rem;
            color: var(--primary-dark);
            font-weight: 700;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
            position: relative;
            margin: 0;
            position: relative;
            padding-left: 10px;    /* Add padding to prevent text overlap with line */
            display: inline-block;   /* Contain the title and its pseudo-element */
        }
        .teacher-name{
            font-size: 1rem;
            font-weight: 700;
        }
        /* .card-number {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary-dark);
            margin-bottom: 0.5rem;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        } */

        .teacher-info {
            display: flex;
            align-items: center;
            /* justify-content: flex-start; */
            gap: 20px;
            /* margin-top: 10px; */
            margin-right: 20px;
        }
        
        .separator {
            color: var(--primary-gold);
            font-weight: bold;
        }

        .teacher-info ul {
            list-style-type: none;
            text-align: right;
        }  
    
        
        .teacher-info li::marker{
            /* color: var(--primary-gold); */

        }

        .section-title::after {
            content: '';
            width: 80px;
            height: 3px;
            background: var(--primary-gold);
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
        }
        .groups-section-title::after {
            content: '';
            width: 3px;              /* Change width to 3px (was 120px) */
            height: 80%;             /* Change height to 80% of title height */
            /* background: var(--primary-gold); */
            position: absolute;
            top: 10%;               /* Position from top to center vertically */
            left: -8px;           /* Position to the right of the text */
            transform: none;
        }

        .groups-section-title.no-after::after {
            display: none;
            content: none;
        }
        
        .cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(calc(50% - 1rem), 1fr));
            gap: 2rem;
            margin-bottom: 3rem;
        }
        

        .analytics-card {
            background: white;
            padding: 2rem;
            border-radius: 15px;
            text-align: center;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .analytics-card:hover {
            transform: translateY(-5px);
            border-color: var(--primary-gold);
        }

        .card-icon {
            width: 60px;
            height: 60px;
            background: var(--primary-gold);
            border-radius: 50%;
            margin: 0 auto 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.5rem;
        }

        .card-icon img {
            width: 60%;   /* image scales inside circle */
            height: 60%;
            object-fit: contain;
}
        .card-number {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary-dark);
            margin-bottom: 0.5rem;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }
        .best-student{
            font-size: 18px;
        }
        #best-student {
            display: inline-block;
            transition: opacity 0.8s ease-in-out;
        }

        .card-label {
            color: var(--primary-gold);
            font-weight: 700;
            margin-bottom: 0.5rem;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        .card-description {
            color: #666;
            font-size: 0.9rem;
        }
        
        /* Performance Chart */
        .chart-section {
            background: white;
            padding: 3rem;
            border-radius: 15px;
            margin: 3rem 0;
        }
        .group-info {
            background: white;
            padding: 24px;
            border-radius: 15px;
            margin: 3rem auto ;
            text-align: right !important;
            display: flex;
            align-items: center;
            justify-content: center;
            max-width: 700px;
            width: 100%;
        }
        
        #performanceChart {
            max-height: 400px;
            width: 100% !important;
        }
        
        .chart-description {
            color: #666;
            font-size: 0.9rem;
            text-align: center;
        }
        .chart-header {
            text-align: center;
            /* margin-bottom: 2rem;  */
            color: var(--primary-dark); 
            font-size: 1.8rem;
        }

        /* Groups Analytics Section */

        .groups-analytics {

            text-align: center;

            padding: 2rem 0;

            background: var(--background-beige);

        }


        #group-stats {

            display: none;

            animation: fadeIn 0.5s ease-in;

            padding: 2rem 0;

        }


        .schoolsAnalyticsButton{ 
            display: flex;
            justify-content: center;
            text-align: center;
            align-items: center;
            margin-bottom: 32px;
            margin-top: -48px;
        }

        .analytics-card canvas {
            width: 100%;
            height: 140px ;
            display: block;
            }
        .schoolsAnalyticsButton .cta-button {
            display: inline-block;
        }
        #group-stats.active {

            display: block;

        }

        /* Footer */
        .footer {
            background: var(--primary-dark);
            color: white;
            padding: 3rem 0 1rem;
            position: relative;
            overflow: hidden;
        }

        .footer::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 31%, rgba(255, 255, 255, 0.2) 33%, transparent 34%),
                        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.2) 31%, rgba(255, 255, 255, 0.2) 33%, transparent 34%);
            background-size: 40px 40px;
            opacity: 0.3;
            /* background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23B2845D' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat; */
        }

        .footer-content {
            position: relative;
            z-index: 2;
            text-align: center;
        }

        .footer-logo {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 1rem;
            color: white;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif;
        }

        .footer-text {
            opacity: 0.8;
            margin-bottom: 2rem;
        }

        .footer-bottom {
            /* border-top: 1px solid rgba(178, 132, 93, 0.3); */
            /* padding-top: 1rem; */
            opacity: 0.6;
        }
        #image-carousel {
            padding: 2rem 0;
            margin: 2rem auto;
            max-width: 1000px;
        }

        .circle{
            --size: 140px;         /* حجم الرسم */
            --thickness: 18px;    /* سُمك الحلقة */
            --val: 0;              /* تُملأ بالـ JS (0..100) */
            --ring: var(--brand);
            --ring2: var(--brand);

            width: var(--size);
            aspect-ratio: 1/1;
            position: relative;
            border-radius: 50%;
            display:grid;
            place-items:center;
            /* margin: 10px auto 8px; */
            filter: drop-shadow(0 0 calc(var(--size) * 0.07) rgba(0,0,0,.12));
            transition: transform .25s cubic-bezier(.2,.8,.2,1);
        }
        .circle:hover{ transform: scale(1.03); }

        /* الحلقة الممتلئة + المسار */
        .circle::before{
            content:""; position:absolute; inset:0; border-radius:50%;
            background:
            conic-gradient( from 270deg,
                var(--ring) 0%,
                var(--ring2) calc(var(--val)*1%),
                var(--track) 0% 100% );
            /* شقّ فتحة للوسط ليظهر الأسود */
            -webkit-mask:
            radial-gradient(closest-side, transparent calc(50% - var(--thickness)), #000 calc(50% - var(--thickness)));
                    mask:
            radial-gradient(closest-side, transparent calc(50% - var(--thickness)), #000 calc(50% - var(--thickness)));
        }

        /* الدائرة الداخلية السوداء */
        .circle .center{
            position:relative; z-index:2;
            width: calc(var(--size) - var(--thickness)*2);
            aspect-ratio:1/1; border-radius:50%;
            background:#000; display:grid; place-items:center;
            box-shadow: inset 0 0 0 2px rgba(255,255,255,.06), 0 0 0 4px rgba(0,0,0,.05);
            animation: puffIn .7s ease both;
        }
        .center b{
            color:#fff; font-size:28px; letter-spacing:.5px; font-weight:800;
            text-shadow: 0 2px 6px rgba(0,0,0,.45);
        }
        .center small{
            color: var(--primary-gold);
            display:block;
            font-size:12px; 
            margin-top:2px;
            font-weight: 700;
        }
        .chart-container{
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 ;
            margin-bottom: 8px;
        }
         .header-button{
            /*
            background: var(--primary-gold);
          /*   padding: 1rem 2.5rem;
            border: none;
            border-radius: 30px;    
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            transition: all 0.3s ease;
            font-family: '29LTBukra', 'Noto Sans Arabic', sans-serif; 
            background: var(--brand, #8B6B2B);   fallback: ذهبي داكن 
            display: inline-block;
            padding: 10px 18px;
            color: #fff !important;
            border-radius: 999px; حواف دائرية 
            text-decoration: none;
            transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
            box-shadow: 0 3px 8px rgba(0,0,0,0.15);
            */
            display: inline-block;
            padding: 8px 16px;
            border: 2px solid var(--brand, #8B6B2B);
            border-radius: 999px;
            color: var(--brand, #8B6B2B) !important;
            text-decoration: none;
            transition: all 0.25s ease;
        }


        .header-button a{
            font-weight: 700 !important;
        }

        /* === Popup / Modal === */
            .popup-overlay{
                position: fixed; inset: 0;
                background: rgba(0,0,0,.6);
                display: none;                 /* hidden by default */
                align-items: center; justify-content: center;
                z-index: 2000;
            }
            .popup-overlay.show{ 
                display: flex; 
            }

            .popup{
                background: #fff; color: var(--primary-dark);
                width: min(560px, 92vw);
                border-radius: 16px;
                box-shadow: 0 18px 40px rgba(0,0,0,.25);
                padding: 24px 28px;
                position: relative;
                animation: modalIn .25s ease;
                direction: rtl;
                text-align: right;
            }
            .popup h3{ margin: 0 0 10px; font-size: 1.25rem; }
            .popup-close{
                position: absolute; top: 10px; left: 12px;   /* RTL: close on left */
                font-size: 28px; line-height: 1;
                background: transparent; border: 0; color: #666; cursor: pointer;
            }
            @keyframes modalIn{
                from { transform: translateY(-10px); opacity: 0;}
                to   { transform: translateY(0);     opacity: 1;}
            }

        @keyframes puffIn{
            from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity:1; }
        }

        
        /* Responsive Design */
        @media (max-width: 768px) {
            .header-button {
                border: none;
                background: none;
                padding: 0;
                border-radius: 0;
                font-weight: normal;
                color: inherit !important;
            }
            .hero h1 {
                font-size: 2rem;
            }
            
            .nav-links {
                gap: 1rem;
            }
            
            .school-selector {

                min-width: 250px;

                font-size: 1rem;

                padding: 0.8rem 2.5rem 0.8rem 2rem;
            }
            .cards-grid {
                /* grid-template-columns: 1fr; */
            }
            
            .chart-section {
                padding: 2rem 1rem;
            }
            
            .carousel-slide {
                height: 200px;
            }
            .section-title {
                font-size: 32px;
            }
            .groups-section-title {
                font-size: 32px;
            }
            .analytics-card.clicked {
                transform: translateY(-5px);
                border-color: var(--primary-gold);
            }
            .analytics-card:focus {
                transform: translateY(-5px);
                border-color: var(--primary-gold);
            }
        }

        @media (max-width: 480px) {
            .container {
                padding: 0 15px;
            }
            
            .hero {
                padding: 100px 0 60px;
            }
            
            .hero h1 {
                font-size: 1.8rem;
            }
            
            .section-title {
                font-size: 26px;
            }
            .groups-section-title {
                font-size: 26px;
            }

            .analytics-card {
            padding: 1rem;
        }
            .card-description-schools {
                font-size: 12px;
            }

            .best-student {
                font-size: 18px !important;
            }
            .school-selector {

                min-width: 200px;

                font-size: 0.9rem;

            }
        }



        /* Animation for page load */
        .fade-in {
            animation: fadeIn 0.8s ease-in;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }