/* ==================== CSS Reset & Base ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(270, 80%, 15%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(270, 80%, 15%);
    --primary: hsl(280, 80%, 28%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(45, 100%, 52%);
    --secondary-foreground: hsl(270, 80%, 15%);
    --muted: hsl(270, 20%, 96%);
    --muted-foreground: hsl(270, 20%, 40%);
    --border: hsl(270, 20%, 90%);
    --radius: 1rem;
}

/* Dark Mode Variables */
.dark {
    --background: hsl(270, 50%, 6%);
    --foreground: hsl(0, 0%, 98%);
    --card: hsl(270, 45%, 10%);
    --card-foreground: hsl(0, 0%, 98%);
    --primary: hsl(280, 80%, 55%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(45, 100%, 52%);
    --secondary-foreground: hsl(270, 80%, 10%);
    --muted: hsl(270, 30%, 15%);
    --muted-foreground: hsl(270, 15%, 65%);
    --border: hsl(270, 30%, 20%);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin-top: 0px !important;
}

/* ==================== Utility Classes ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================== Animations ==================== */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(5deg); }
    50% { transform: translateY(-25px) rotate(0deg); }
    75% { transform: translateY(-15px) rotate(-5deg); }
}

@keyframes aurora {
    0%, 100% { transform: translate(0%, 0%) rotate(0deg) scale(1); opacity: 0.6; }
    25% { transform: translate(10%, -10%) rotate(90deg) scale(1.1); opacity: 0.8; }
    50% { transform: translate(-5%, 10%) rotate(180deg) scale(0.95); opacity: 0.5; }
    75% { transform: translate(-10%, -5%) rotate(270deg) scale(1.05); opacity: 0.7; }
}

@keyframes aurora-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.float-animation { animation: float 6s ease-in-out infinite; }
.float-animation-delayed { animation: float 6s ease-in-out infinite 2s; }
.float-animation-slow { animation: float 8s ease-in-out infinite 1s; }
.animate-bounce-subtle { animation: bounce-subtle 2s ease-in-out infinite; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-slide-in-right { animation: slideInRight 0.8s ease-out forwards; }
.animate-slide-in-left { animation: slideInLeft 0.8s ease-out forwards; }


/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-gold {
    background: linear-gradient(135deg, var(--secondary), hsl(40, 100%, 45%));
    color: var(--foreground);
    box-shadow: 0 8px 30px rgba(255, 193, 7, 0.4);
}

.btn-gold:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 193, 7, 0.5);
}

.btn-hero {
    background: var(--secondary);
    color: var(--foreground);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    box-shadow: 0 8px 30px rgba(255, 193, 7, 0.5);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 193, 7, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    background: var(--muted);
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== Hero Section ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, hsl(280, 80%, 28%) 0%, hsl(280, 85%, 20%) 50%, hsl(260, 70%, 25%) 100%);
    overflow: hidden;
    padding-top: 8rem;
    padding-bottom: 5rem;
}

.dark .hero {
    background: linear-gradient(135deg, hsl(270, 50%, 12%) 0%, hsl(280, 60%, 18%) 50%, hsl(270, 50%, 10%) 100%);
}

.aurora-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    mix-blend-mode: screen;
    pointer-events: none;
}

.aurora-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, hsla(280, 80%, 45%, 0.4) 0%, transparent 70%);
    top: -10%;
    right: -10%;
    animation: aurora 15s ease-in-out infinite;
}

.aurora-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, hsla(45, 100%, 52%, 0.3) 0%, transparent 70%);
    bottom: 10%;
    left: -5%;
    animation: aurora 18s ease-in-out infinite reverse;
}

.aurora-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, hsla(280, 70%, 55%, 0.35) 0%, transparent 70%);
    top: 40%;
    left: 30%;
    animation: aurora-pulse 10s ease-in-out infinite;
}

.math-symbols {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.math-symbol {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    font-weight: 700;
    user-select: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    min-height: calc(100vh - 12rem);
}

@media (min-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
}

.hero-text {
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-badge svg {
    color: var(--secondary);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .hero-title { font-size: 3.5rem; }
}

.hero-title span {
    display: block;
    color: var(--secondary);
    font-size: 3rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .hero-title span { font-size: 4rem; }
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 500px;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.hero-image-container {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: scale(0.75);
    filter: blur(40px);
}

.hero-image {
    position: relative;
    z-index: 10;
    max-width: 100%;
    width: 400px;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.3));
    animation: float 8s ease-in-out infinite;
}

@media (min-width: 1024px) {
    .hero-image { width: 500px; }
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 20;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .floating-card {
    background: rgba(30, 20, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .floating-card-text h4 {
    color: var(--foreground);
}

.dark .floating-card-text p {
    color: var(--muted-foreground);
}

.floating-card-1 {
    top: 25%;
    right: 0;
    animation: float 6s ease-in-out infinite;
}

.floating-card-2 {
    bottom: 33%;
    left: 0;
    animation: float 6s ease-in-out infinite 2s;
}

.floating-card-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.floating-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card-icon.purple {
    background: rgba(128, 0, 128, 0.1);
    color: var(--primary);
}

.floating-card-icon.gold {
    background: rgba(255, 193, 7, 0.2);
    color: var(--secondary);
}

.floating-card-text h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--foreground);
}

.floating-card-text p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.hero-wave svg {
    width: 100%;
    display: block;
}

/* ==================== Grades Section ==================== */
.grades {
    padding: 6rem 0;
    background: var(--background);
    position: relative;
    overflow: hidden;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    background: rgba(128, 0, 128, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--foreground);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .section-title { font-size: 3rem; }
}

.section-title span {
    color: var(--primary);
}

.section-description {
    color: var(--muted-foreground);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.grades-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grades-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grades-grid { grid-template-columns: repeat(3, 1fr); }
}

.grade-card {
    background: var(--card);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(128, 0, 128, 0.1);
    transition: all 0.5s ease;
    border: 1px solid var(--border);
}

.grade-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(128, 0, 128, 0.2);
}

.dark .grade-card {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dark .grade-card:hover {
    box-shadow: 0 20px 60px rgba(255, 193, 7, 0.15);
}

/* 1920×1080 = 16:9 — الحاوية بنفس النسبة عشان الصورة تظهر كاملة بدون قص */
.grade-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.grade-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s ease;
}

.grade-card:hover .grade-image img {
    transform: scale(1.1);
}

.grade-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.grade-content {
    padding: 1.5rem;
}

.grade-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.grade-courses {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.grade-buttons {
    display: flex;
    gap: 0.75rem;
}

.grade-buttons .btn { flex: 1; }

.grades-cta {
    text-align: center;
    margin-top: 3rem;
}

.grades-cta p {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

/* ==================== Features Section ==================== */
.features {
    padding: 6rem 0;
    background: var(--muted);
    position: relative;
    overflow: hidden;
}

.features-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .features-grid { grid-template-columns: repeat(4, 1fr); }
}

.feature-card {
    position: relative;
    background: var(--card);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(128, 0, 128, 0.1);
    transition: all 0.5s ease;
    overflow: hidden;
    border: 1px solid var(--border);
}

.feature-card:hover {
    background: linear-gradient(135deg, var(--primary), hsl(280, 80%, 35%));
    transform: translateY(-4px);
}

.dark .feature-card {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-icon.purple { background: linear-gradient(135deg, hsl(270, 70%, 50%), hsl(270, 70%, 60%)); }
.feature-icon.blue { background: linear-gradient(135deg, hsl(210, 80%, 50%), hsl(210, 80%, 60%)); }
.feature-icon.green { background: linear-gradient(135deg, hsl(140, 70%, 40%), hsl(140, 70%, 50%)); }
.feature-icon.orange { background: linear-gradient(135deg, hsl(30, 90%, 50%), hsl(30, 90%, 60%)); }

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.feature-card:hover .feature-title { color: white; }

.feature-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    transition: color 0.3s;
}

.feature-card:hover .feature-description { color: rgba(255, 255, 255, 0.8); }

.feature-number {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 4rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.03);
    transition: color 0.3s;
}

.feature-card:hover .feature-number { color: rgba(255, 255, 255, 0.1); }

/* ==================== Methodology Section ==================== */
.methodology {
    padding: 6rem 0;
    background: var(--background);
    position: relative;
    overflow: hidden;
}

.methodology-grid {
    display: grid;
    gap: 4rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .methodology-grid { grid-template-columns: 1fr 1fr; }
}

.methodology-steps {
    margin-top: 2rem;
}

.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--primary), hsl(280, 80%, 35%));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.3s;
}

.step:hover .step-icon { transform: scale(1.1); }

.step-number {
    color: var(--secondary);
    font-weight: 900;
    margin-left: 0.5rem;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
}

.step-description {
    color: var(--muted-foreground);
}

.video-container {
    position: relative;
}

.video-placeholder {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--primary), hsl(280, 80%, 35%), hsl(280, 70%, 30%));
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(128, 0, 128, 0.3);
    position: relative;
}

.play-button {
    width: 96px;
    height: 96px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s;
    border: none;
}

.play-button:hover { transform: scale(1.1); }

.play-button svg {
    color: white;
    width: 40px;
    height: 40px;
}

.video-text {
    position: absolute;
    bottom: 2rem;
    text-align: center;
    color: white;
    width: 100%;
}

.video-text p:first-child {
    font-size: 1.1rem;
    font-weight: 700;
}

.video-text p:last-child {
    font-size: 0.875rem;
    opacity: 0.7;
}

.video-math-symbol {
    position: absolute;
    font-size: 4rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.1);
}

.testimonial-card {
    position: absolute;
    bottom: -2rem;
    right: -2rem;
    background: var(--card);
    border-radius: 1rem;
    padding: 1.25rem;
    max-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: bounce-subtle 2s ease-in-out infinite;
    border: 1px solid var(--border);
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), hsl(40, 100%, 45%));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.testimonial-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--foreground);
}

.testimonial-grade {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.testimonial-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.testimonial-stars {
    color: var(--secondary);
    letter-spacing: 2px;
}

.stats-card {
    position: absolute;
    top: -1rem;
    left: -1rem;
    background: var(--card);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: bounce-subtle 2s ease-in-out infinite 0.3s;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-card svg {
    color: hsl(140, 70%, 40%);
}

.stats-number {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--foreground);
}

.stats-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ==================== CTA Section ==================== */
.cta {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, hsl(280, 80%, 28%) 0%, hsl(280, 85%, 20%) 50%, hsl(260, 70%, 25%) 100%);
}

.dark .cta {
    background: linear-gradient(135deg, hsl(270, 50%, 12%) 0%, hsl(280, 60%, 18%) 50%, hsl(270, 50%, 10%) 100%);
}

.cta-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.cta-particle {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    font-weight: 700;
}

.cta-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
}

.cta-glow-1 {
    top: 5rem;
    left: 5rem;
    width: 256px;
    height: 256px;
    background: rgba(255, 193, 7, 0.3);
    animation: aurora-pulse 3s ease-in-out infinite;
}

.cta-glow-2 {
    bottom: 5rem;
    right: 5rem;
    width: 384px;
    height: 384px;
    background: rgba(255, 193, 7, 0.2);
    animation: aurora-pulse 3s ease-in-out infinite 1s;
}

.cta-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.cta-badge svg { color: var(--secondary); }

.cta-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .cta-title { font-size: 3.5rem; }
}

.cta-title span { color: var(--secondary); }

.cta-description {
    font-size: 1.25rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

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



/* ==================== Icons (SVG inline) ==================== */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
}


/* ==================== Hero Wave Dark Mode ==================== */
.hero-wave svg path {
    fill: var(--background);
}

/* ==================== Dark Mode Adjustments ==================== */
.dark .section-badge {
    background: rgba(280, 80%, 55%, 0.2);
}

.dark .testimonial-card,
.dark .stats-card {
    background: var(--card);
    border-color: var(--border);
}

.dark .btn-outline {
    border-color: var(--border);
    color: var(--foreground);
}

.dark .btn-outline:hover {
    background: var(--muted);
}

.dark .aurora-glow-1 {
    background: radial-gradient(circle, hsla(280, 80%, 50%, 0.3) 0%, transparent 70%);
}

.dark .aurora-glow-2 {
    background: radial-gradient(circle, hsla(45, 100%, 52%, 0.2) 0%, transparent 70%);
}

.dark .aurora-glow-3 {
    background: radial-gradient(circle, hsla(280, 70%, 60%, 0.25) 0%, transparent 70%);
}
