* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'El Messiri', sans-serif;
}

:root {
    --primary: #4a6cf7;
    --secondary: #ff6b6b;
    --dark: #1a1a1a;
    --light: #f8f9fa;
    --blur-bg: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --muted: rgba(255, 255, 255, 0.7);
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --transition-time: 0.5s;
    --accent: #4a6cf7;
    --accent-2: #6c8eff;
    --side-padding: 15px;
    --section-spacing: 20px; /* تقليل المسافة بين الأقسام */
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/images/12.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    font-family: 'El Messiri', sans-serif;
    color: var(--light);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
    padding-left: 15px;
    padding-right: 15px;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem var(--side-padding);
    z-index: 1000;
    background: transparent;
    transition: all 0.4s ease;
}

.header.scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem var(--side-padding);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.9375rem;
}

.site-name {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    background: linear-gradient(45deg, #d4af37, #FFD700, #b8860b); /* تدرجات الذهب */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3); /* يضيف عمق */
}

.hamburger-menu {
    width: 2.5rem;
    height: 1.875rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-menu span {
    height: 0.25rem;
    width: 100%;
    background: white;
    border-radius: 0.125rem;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(0.8125rem) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-0.8125rem) rotate(-45deg);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 25rem;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(0.9375rem);
    z-index: 999;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 6.25rem var(--side-padding) 2.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu a {
    color: white;
    text-decoration: none;
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    font-weight: 600;
    padding: 0.625rem 0.9375rem;
    margin: 0.625rem 0;
    display: block;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu a:before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 0;
    width: 0.25rem;
    background: var(--primary);
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover:before {
    height: 70%;
}

/* Main Content Styles */
.main-content {
    padding-top: 5rem;
    padding-left: var(--side-padding);
    padding-right: var(--side-padding);
}

.main-title {
    font-size: clamp(1.7rem, 5vw, 2.5rem);
    font-weight: bold;
    background: linear-gradient(135deg, #ffffff 0%, #a8c6ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.1);
    text-align: center;
    margin-bottom: 1rem;
    padding: 0 var(--side-padding);
}

.main-description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #ffffff;
    text-align: center;
    max-width: 50rem;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    padding: 0 var(--side-padding);
}

/* Slideshow Styles */
.slideshow {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 37.5rem;
    overflow: hidden;
    margin: 0 calc(-1 * var(--side-padding));
    width: calc(100% + 2 * var(--side-padding));
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.1);
    transition: all 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

.slide-content {
    text-align: center;
    max-width: 50rem;
    width: 90%;
    padding: 0 var(--side-padding);
}

/* Social Icons */
.social-icons {
    position: fixed;
    left: var(--side-padding);
    top: 80%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 100;
}

.social-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blur-bg);
    backdrop-filter: blur(0.625rem);
    color: white;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-icon:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--primary);
    transition: all 0.3s ease;
    z-index: -1;
}

.social-icon:hover:before {
    height: 100%;
}

.social-icon:hover {
    transform: translateY(-0.3125rem) scale(1.1);
}

.social-icon:nth-child(1):before { background: #3b5998; }
.social-icon:nth-child(2):before { background: #e1306c; }
.social-icon:nth-child(3):before { background: #ff0000; }

/* Contact Icons */
.contact-icons {
    position: fixed;
    right: var(--side-padding);
    bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 100;
}

.contact-icon {
    width: 2.8125rem;
    height: 2.8125rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blur-bg);
    backdrop-filter: blur(0.625rem);
    color: white;
    font-size: 1.5625rem;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.2);
}

.contact-icon:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    transition: all 0.3s ease;
    z-index: -1;
}

.contact-icon:hover:before {
    height: 100%;
}

.contact-icon:nth-child(1):before { background: #25d366; }
.contact-icon:nth-child(2):before { background: #4a6cf7; }
.contact-icon:hover {
    transform: scale(1.1);
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0 var(--side-padding);
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-popup {
    background: rgba(0, 0, 0, 0.7);
    width: 90%;
    max-width: 28.125rem;
    border-radius: 0.9375rem;
    overflow: hidden;
    box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.8);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.4s ease;
    border: 1px solid #4a6cf7;
    margin: 0 var(--side-padding);
}

.popup-overlay.active .custom-popup {
    transform: scale(1);
    opacity: 1;
}

.popup-header {
    background: rgba(0, 0, 0, 0.6);
    color: #4a6cf7;
    padding: 0.3125rem;
    text-align: center;
    position: relative;
}

.popup-title {
    font-size: 1.375rem;
    margin-bottom: 0.3125rem;
}

.popup-icon {
    font-size: 2.5rem;
    margin-bottom: 0.625rem;
}

.popup-content {
    padding: 0.625rem;
}

.popup-description {
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 0.625rem;
    text-align: center;
    font-size: 1rem;
}

.popup-buttons {
    display: flex;
    justify-content: center;
    gap: 0.9375rem;
    flex-wrap: wrap;
}

.popup-btn {
    padding: 0.75rem 1.5625rem;
    border: none;
    border-radius: 1.875rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 7.5rem;
    justify-content: center;
}

.popup-btn-yes {
    background: #4a6cf7;
    color: white;
}

.popup-btn-no {
    background: #ff416c;
    color: white;
}

.popup-btn:hover {
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.2);
}

.popup-btn:active {
    transform: translateY(0);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* About Section */
#about {
    width: 100%;
    max-width: 100%;
    margin: var(--section-spacing) 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(0.625rem);
    border-radius: 1.25rem;
    padding: 1.25rem var(--side-padding);
    box-shadow: 0 0.9375rem 2.1875rem rgba(255, 255, 255, 0.2);
    text-align: center;
    border: 1px solid #4a6cf7;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

#about > .container,
#about .content,
#about .media {
    position: relative;
    z-index: 1;
}

.float-icon {
    position: absolute;
    opacity: 0.12;
    animation: float 7s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
    color: var(--accent-2);
    font-size: 3rem;
}

.float-icon:nth-child(1) { top: 8%; left: 6%; animation-delay: 0.2s; }
.float-icon:nth-child(2) { bottom: 10%; right: 14%; animation-delay: 1.1s; }
.float-icon:nth-child(3) { top: 40%; right: 4%; animation-delay: 0.6s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.625rem); }
}

.container {
    max-width: 100%;
    margin-inline: auto;
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: center;
    grid-template-columns: 1fr;
    padding: 0 var(--side-padding);
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: 1.3fr 0.7fr;
    }
}

.media {
    border-radius: 1rem;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.05) contrast(1.02);
    border-radius: 2rem;
}

.badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(17,24,39,.85);
    border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(0.375rem);
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-color);
    box-shadow: 0 0.375rem 1.25rem rgba(0,0,0,.25);
    border-radius: 1rem;
}

.badge svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--accent);
}

.badge.top-left { top: 0.9rem; left: 0.9rem; }
.badge.bottom-right { bottom: 0.9rem; right: 0.9rem; }

.content h2 {
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    line-height: 1.25;
    margin: 0;
}

.content p {
    color: var(--muted);
    margin: 0.9rem 0 1.2rem;
    font-size: clamp(0.98rem, 1.2vw, 1.05rem);
}

.bullets {
    display: grid;
    gap: 0.7rem;
    margin: 1rem 0 1.4rem;
}

.bullet {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 0.9rem;
}

.bullet svg {
    flex: 0 0 1.25rem;
    margin-top: 0.125rem;
    stroke: var(--accent-2);
    width: 1.25rem;
    height: 1.25rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin: 1.2rem 0 1.5rem;
}

@media (min-width: 480px) {
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat {
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 1rem;
    padding: 0.9rem;
    text-align: center;
}

.stat .num {
    font-size: clamp(1.2rem, 2.8vw, 1.9rem);
    font-weight: 800;
    letter-spacing: 0.2px;
}

.stat .label {
    color: var(--muted);
    font-size: 0.85rem;
}

.cta {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    appearance: none;
    border: none;
    cursor: pointer;
    padding: 0.85rem 1.1rem;
    border-radius: 0.9rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1020;
}

.btn.secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid rgba(255,255,255,.18);
}

.btn:hover {
    transform: translateY(-0.125rem);
}

.reveal {
    border-radius: 2rem;
    opacity: 0;
    transform: translateY(1.125rem) scale(0.98);
    filter: blur(2px);
    transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

.reveal.show {
    opacity: 1;
    transform: none;
    filter: none;
}

/* Cards Section */
#cards-section {
    width: 100%;
    max-width: 100%;
    margin: var(--section-spacing) 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(0.625rem);
    border-radius: 1.25rem;
    padding: 1.25rem var(--side-padding);
    box-shadow: 0 0.9375rem 2.1875rem rgba(255, 255, 255, 0.2);
    text-align: center;
    border: 1px solid #4a6cf7;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#cards-section .container {
    width: 100%;
    margin: 0 auto;
    padding: 0.1rem;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

#cards-section .cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 768px) {
    #cards-section .cards-grid {
        grid-template-columns: repeat(2, minmax(18.75rem, 22.5rem));
        gap: 1.2rem; /* تقليل المسافة بين البطاقات على الشاشات الكبيرة */
    }
}

@media (min-width: 1024px) {
    #cards-section .cards-grid {
        grid-template-columns: repeat(3, minmax(18.75rem, 22.5rem));
        gap: 1rem; /* تقليل إضافي للمسافة بين البطاقات على الشاشات الكبيرة جداً */
    }
}

#cards-section .card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(2.5rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#cards-section .card.visible {
    opacity: 1;
    transform: translateY(0);
}

#cards-section .card-image {
    height: 12.5rem;
    overflow: hidden;
    position: relative;
    background: #1e293b;
}

#cards-section .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s ease;
}

#cards-section .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 70%);
    z-index: 1;
    opacity: 0.8;
    transition: all 0.4s ease;
}

#cards-section .card:hover .card-image::before {
    opacity: 0.9;
}

#cards-section .card:hover .card-image img {
    transform: scale(1.08);
}

#cards-section .card-badge {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 3.125rem;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 0.25rem 0.75rem rgba(245, 158, 11, 0.35);
    z-index: 2;
}

#cards-section .card-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 45%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1.5rem;
    z-index: 2;
}

#cards-section .card:hover .card-overlay {
    opacity: 1;
}

#cards-section .card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#cards-section .card-title {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    color: white;
    position: relative;
    padding-bottom: 0.9rem;
    font-weight: 700;
}

#cards-section .card-details {
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    font-size: 1rem;
}

#cards-section .card-features {
    margin-bottom: 0.5rem;
}

#cards-section .card-features li {
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    color: #e2e8f0;
    font-size: 1rem;
}

#cards-section .card-features li i {
    color: #10b981;
    margin-left: 0.8rem;
    font-size: 0.9rem;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.45rem;
    border-radius: 50%;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cards-section .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#cards-section .card-price {
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
}

/* Animated Text */
.animated-text-container {
    width: 100%;
    max-width: 100%;
    margin: var(--section-spacing) 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(0.625rem);
    border-radius: 1.25rem;
    padding: 1.25rem var(--side-padding);
    box-shadow: 0 0.9375rem 2.1875rem rgba(255, 255, 255, 0.2);
    text-align: center;
    border: 1px solid #4a6cf7;
}

.text-slider-wrapper {
    position: relative;
    overflow: hidden;
    min-height: auto;
}

.text-content {
    position: relative;
}

.text-slide {
    position: absolute;
    width: 100%;
    opacity: 0;
    transition: opacity var(--transition-time) ease;
}

.text-slide.active-slide {
    opacity: 1;
    position: relative;
    transform: none;
}

/* Education System */
.edu-system-main {
    width: 100%;
    max-width: 100%;
    margin: var(--section-spacing) 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(0.625rem);
    border-radius: 1.25rem;
    box-shadow: 0 0.9375rem 2.1875rem rgba(255, 255, 255, 0.2);
    text-align: center;
    border: 1px solid #4a6cf7;
    padding: 1.875rem var(--side-padding);
}

.edu-system-title {
    text-align: center;
    margin-bottom: 1.875rem;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.edu-stages-container, .edu-grades-container, .edu-subjects-button {
    display: none;
}

.edu-stages-container.active, .edu-grades-container.active, .edu-subjects-button.active {
    display: block;
    animation: edu-fadeIn 0.5s ease;
}

.edu-stages-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.edu-stage-btn {
    width: 100%;
    max-width: 12.5rem;
    height: 7.5rem;
    border: none;
    border-radius: 0.9375rem;
    color: white;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.edu-stage-btn:hover {
    box-shadow: 0 0.5rem 1.25rem rgba(255, 255, 255, 0.3);
    transform: translateY(-0.3125rem);
}

.edu-stage-btn i {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 0.625rem;
}

.edu-stage-elementary {
    background: rgba(66, 230, 149, 0.3);
}

.edu-stage-middle {
    background: rgba(52, 148, 230, 0.3);
}

.edu-stage-high {
    background: rgba(255, 94, 98, 0.3);
}

.edu-grades-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9375rem;
    margin-top: 1.25rem;
}

.edu-grade-btn {
    width: 100%;
    max-width: 9.375rem;
    height: 5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #4a6cf7;
    border-radius: 0.75rem;
    color: white;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.edu-grade-btn:hover {
    box-shadow: 0 0.375rem 0.9375rem rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.7);
}

.edu-grade-btn.selected {
    background: rgba(74, 108, 247, 0.6);
}

.edu-back-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #4a6cf7;
    border-radius: 50%;
    width: 3.125rem;
    height: 3.125rem;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.25rem 0.625rem rgba(255, 255, 255, 0.15);
}

.edu-back-btn:hover {
    background: rgba(74, 108, 247, 0.5);
}

.edu-subjects-button {
    text-align: center;
    margin-top: 1.25rem;
}

.edu-explore-btn {
    padding: 0.9375rem 2.5rem;
    background: #4a6cf7;
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0.3125rem 0.9375rem rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
}

.edu-explore-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0.5rem 1.25rem rgba(255, 255, 255, 0.3);
}

.edu-section-title {
    text-align: center;
    margin-bottom: 1.25rem;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

@keyframes edu-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem var(--side-padding);
    margin-top: 3rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    :root {
        --side-padding: 10px;
        --section-spacing: 15px; /* تقليل المسافة بين الأقسام على الجوال */
    }
    
    .header {
        padding: 1rem var(--side-padding);
    }
    
    .header.scrolled {
        padding: 0.5rem var(--side-padding);
    }
    
    .sidebar {
        padding: 5rem var(--side-padding) 1.5rem;
    }
    
    .social-icons {
        display: none;
        flex-direction: row;
        bottom: 1rem;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
    
    .contact-icons {
        scale: 1.1;
        padding: 20px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        width: 90%;
        margin: 0 auto;
        position: fixed;
        bottom: 2rem;
    }
    
    .slideshow {
        height: 50vh;
        min-height: 25rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    /* تقليل المسافة بين الأقسام على الشاشات الصغيرة */
    #about, 
    #cards-section, 
    .animated-text-container, 
    .edu-system-main {
        margin: var(--section-spacing) 0;
        padding: 0.8rem var(--side-padding);
    }
    
    /* تقليل المسافة العلوية للمحتوى الرئيسي */
    .main-content {
        padding-top: 2rem;
    }
    
    /* تقليل المسافة بين العناصر داخل الأقسام */
    .container {
        gap: 0.8rem;
    }
    
    /* تقليل المسافة بين البطاقات */
    #cards-section .cards-grid {
        gap: 0.8rem;
    }
    
    /* تقليل المسافة بين عناصر التعليم */
    .edu-stages-grid,
    .edu-grades-grid {
        gap: 0.8rem;
        margin-top: 0.8rem;
    }
    
    /* تقليل حجم أزرار المراحل التعليمية */
    .edu-stage-btn {
        max-width: 10rem;
        height: 5rem;
        font-size: 1rem;
    }
    
    .edu-stage-btn i {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }
    
    /* تقليل حجم أزرار الصفوف */
    .edu-grade-btn {
        max-width: 7rem;
        height: 3.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    :root {
        --side-padding: 8px;
        --section-spacing: 10px; /* تقليل إضافي للمسافات على الشاشات الصغيرة جداً */
    }
    
    .header {
        padding: 0.8rem var(--side-padding);
    }
    
    .site-name {
        font-size: 1.1rem;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .main-description {
        font-size: 0.9rem;
    }
    
    .edu-stage-btn {
        height: 6rem;
        font-size: 1.1rem;
    }
    
    .edu-grade-btn {
        height: 4rem;
        font-size: 1rem;
    }
    
    .edu-explore-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* تقليل إضافي للمسافات على الشاشات الصغيرة جداً */
    #about, 
    #cards-section, 
    .animated-text-container, 
    .edu-system-main {
        margin: var(--section-spacing) 0;
        padding: 0.6rem var(--side-padding);
    }
    
    .edu-stages-grid,
    .edu-grades-grid {
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    #cards-section .cards-grid {
        gap: 0.5rem;
    }
}

/* تحسينات إضافية لشاشات الكمبيوتر الكبيرة */
@media (min-width: 1024px) {
    :root {
        --section-spacing: 15px; /* تقليل المسافة بين الأقسام على الشاشات الكبيرة */
    }
    
    .main-content {
        padding-top: 2rem; /* تقليل المسافة العلوية للمحتوى الرئيسي */
    }
    
    /* تقليل المسافات الداخلية للأقسام على الشاشات الكبيرة */
    #about, 
    #cards-section, 
    .animated-text-container, 
    .edu-system-main {
        padding: 0.7rem var(--side-padding);
    }
    
    /* تقليل المسافة بين عناصر التعليم على الشاشات الكبيرة */
    .edu-stages-grid {
        gap: 0.8rem;
    }
    
    .edu-grades-grid {
        gap: 0.8rem;
    }
}
.subject-card {
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4a6cf7;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    max-width: 250px;
    width: 100%;
    min-height: 280px; /* ارتفاع مرن */
}

.subject-image {
    height: 160px; /* ارتفاع ثابت للصورة */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.subject-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* مهم جدًا: يحافظ على نسبة العرض ويملأ المساحة */
    object-position: center;
}

.subject-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.subject-info h3 {
    font-size: 1.1rem;
    margin: 0 0 8px;
    color: #ffffff;
    text-align: center;
}

.teacher-name {
    font-size: 0.9rem;
    color: #cccccc;
    text-align: center;
}
@media (max-width: 576px) {
    .subjects-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 15px;
    }

    .subject-card {
        max-width: none;
        min-height: 240px;
    }

    .subject-image {
        height: 120px;
    }

    .subject-info h3 {
        font-size: 1rem;
    }
}
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    justify-content: center;
}