/* ===================================
   ملازم دار المغرب - التصميم الرئيسي
   الهوية البصرية الرسمية
   =================================== */

/* --- الخطوط --- */
@font-face {
    font-family: 'BankAlRiyadh';
    src: url('fonts/bank-alriyadh-light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BankAlRiyadh';
    src: url('fonts/bank-alriyadh-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BankAlRiyadh';
    src: url('fonts/bank-alriyadh-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- المتغيرات --- */
:root {
    /* ألوان الهوية البصرية الرسمية */
    --yellow: #F3C623;
    --yellow-light: #F7D84C;
    --yellow-dark: #D4A90A;
    --orange: #EB8317;
    --orange-light: #F09A3E;
    --orange-dark: #C86D0E;
    --blue: #10375C;
    --blue-light: #1A4F80;
    --blue-dark: #0A2440;
    --white: #FEFEFE;

    /* ألوان مساعدة */
    --cream: #FFF9EC;
    --cream-dark: #FFF0D1;
    --dark: #0A1929;
    --dark-light: #132F4C;
    --text: #1A2332;
    --text-light: #4A5568;
    --text-muted: #8896A6;
    --shadow: rgba(16, 55, 92, 0.12);
    --shadow-heavy: rgba(16, 55, 92, 0.25);

    /* عام */
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font: 'BankAlRiyadh', 'Tajawal', sans-serif;
}

/* --- إعادة تعيين --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background-color: var(--cream);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==============================
   شريط التنقل
   ============================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 18px 0;
    transition: padding var(--transition), background var(--transition), box-shadow var(--transition);
    background: transparent;
    will-change: padding, background-color;
}

.navbar.scrolled {
    background: rgba(10, 25, 41, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--blue-dark);
    box-shadow: 0 6px 20px rgba(243, 198, 35, 0.35);
    transition: var(--transition);
}

.logo-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    transition: var(--transition);
    filter: drop-shadow(0 4px 12px rgba(243, 198, 35, 0.3));
}

.footer-logo-img {
    width: 85px;
    height: 85px;
}

.logo:hover .logo-img {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 18px rgba(243, 198, 35, 0.45));
}

.logo:hover .logo-icon {
    transform: rotate(-5deg) scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.logo-sub {
    font-size: 0.78rem;
    color: var(--yellow);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 6px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 400;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--yellow);
    background: rgba(243, 198, 35, 0.1);
}

.nav-links a i {
    font-size: 0.85rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 2.5px;
    background: #fff;
    border-radius: 3px;
    transition: var(--transition);
}

/* ==============================
   Hero Section
   ============================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 40%, #1A4F80 70%, var(--dark) 100%);
}

.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 40%, rgba(243, 198, 35, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 25%, rgba(235, 131, 23, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, rgba(243, 198, 35, 0.06) 0%, transparent 50%);
    z-index: 2;
}

/* نمط مغربي زخرفي (ثابت بدون أنيميشن لتحسين الأداء) */
.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border: 2px solid rgba(243, 198, 35, 0.06);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border: 1px solid rgba(243, 198, 35, 0.05);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 20px;
    max-width: 850px;
    will-change: transform, opacity;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(243, 198, 35, 0.15), rgba(235, 131, 23, 0.1));
    border: 1px solid rgba(243, 198, 35, 0.25);
    color: var(--yellow);
    padding: 10px 28px;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease;
}

.hero-badge i {
    animation: sparkle 2s ease-in-out infinite;
}

.hero-title {
    margin-bottom: 28px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.title-line {
    display: block;
    font-size: 1.3rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 12px;
}

.title-highlight {
    display: block;
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--yellow-light), var(--yellow), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    filter: drop-shadow(0 4px 15px rgba(243, 198, 35, 0.3));
}

.hero-desc {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.65);
    max-width: 560px;
    margin: 0 auto 45px;
    line-height: 1.9;
    font-weight: 300;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 45px;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, rgba(243, 198, 35, 0.12), rgba(235, 131, 23, 0.08));
    border: 1px solid rgba(243, 198, 35, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--yellow);
    font-size: 1.15rem;
    transition: var(--transition);
}

.stat-item:hover .stat-icon {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(243, 198, 35, 0.2);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--blue-dark);
    padding: 16px 44px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font);
    transition: var(--transition);
    box-shadow: 0 8px 35px rgba(243, 198, 35, 0.35);
    animation: fadeInUp 0.8s ease 0.8s both;
}

.hero-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 45px rgba(243, 198, 35, 0.5);
}

.hero-btn i {
    animation: bounceDown 1.5s ease-in-out infinite;
}

/* مؤشر التمرير */
.scroll-indicator {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 1s ease 1.2s both;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid rgba(243, 198, 35, 0.3);
    border-radius: 13px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--yellow);
    border-radius: 2px;
    animation: scrollWheel 1.5s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 2px;
    font-weight: 300;
}

/* ==============================
   قسم المراحل
   ============================== */
.stages-section {
    padding: 110px 0;
    background: var(--cream);
    position: relative;
}

.stages-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 250px;
    background: linear-gradient(to bottom, rgba(16, 55, 92, 0.03), transparent);
}

.section-header {
    text-align: center;
    margin-bottom: 65px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(16, 55, 92, 0.07), rgba(235, 131, 23, 0.06));
    color: var(--blue);
    padding: 8px 22px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.section-title {
    font-size: clamp(2.2rem, 4.5vw, 3rem);
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 14px;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
}

.stages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.stage-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    border: 1px solid rgba(16, 55, 92, 0.06);
}

.stage-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 70px rgba(16, 55, 92, 0.14);
}

.stage-card-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    opacity: 0;
    transition: var(--transition);
}

.stage-card:hover .stage-card-glow {
    opacity: 0.05;
}

.stage-card-content {
    position: relative;
    z-index: 2;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stage-icon {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--yellow);
    margin-bottom: 22px;
    box-shadow: 0 10px 30px rgba(16, 55, 92, 0.25);
    transition: var(--transition);
}

.stage-card:hover .stage-icon {
    transform: scale(1.1) rotate(-5deg);
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--blue-dark);
}

.stage-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.stage-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.count-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--orange);
}

.count-label {
    font-size: 0.9rem;
    font-weight: 400;
}

.stage-arrow {
    width: 44px;
    height: 44px;
    background: var(--cream);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    transition: var(--transition);
    font-size: 0.9rem;
}

.stage-card:hover .stage-arrow {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--blue-dark);
    transform: translateX(-6px);
}

.stage-card-pattern {
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    opacity: 0.04;
    border-radius: 50%;
    z-index: 1;
}

/* ==============================
   قسم الأساتذة
   ============================== */
.teachers-section {
    padding: 100px 0;
    background: linear-gradient(180deg, #F8FAFC 0%, #fff 100%);
}

.teachers-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.teacher-card {
    text-align: center;
    padding: 28px 16px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: default;
}

.teacher-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(16, 55, 92, 0.1);
    border-color: rgba(16, 55, 92, 0.1);
}

.teacher-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 16px;
    overflow: hidden;
    border: 3px solid var(--yellow);
    box-shadow: 0 4px 15px rgba(243, 198, 35, 0.25);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.teacher-card:hover .teacher-photo {
    border-color: var(--orange);
    box-shadow: 0 6px 25px rgba(235, 131, 23, 0.3);
    transform: scale(1.05);
}

.teacher-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--yellow);
    font-size: 2rem;
}

.teacher-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.teacher-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.teacher-count i {
    color: var(--orange);
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .teachers-carousel {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 16px;
    }

    .teacher-photo {
        width: 80px;
        height: 80px;
    }

    .teacher-card {
        padding: 20px 12px;
    }

    .teacher-name {
        font-size: 0.9rem;
    }
}

/* ==============================
   قسم الملازم / رف الكتب
   ============================== */
.materials-section {
    padding: 110px 0;
    background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
    position: relative;
}

.bookshelf {
    position: relative;
}

.shelf-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 32px;
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.shelf-wood {
    height: 22px;
    background: linear-gradient(180deg, #8B6544, #6D4C41);
    border-radius: 5px;
    box-shadow:
        0 5px 10px rgba(109, 76, 65, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.shelf-wood::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 5%;
    right: 5%;
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 0 0 50% 50%;
    filter: blur(4px);
}

.book-card {
    transition: transform var(--transition);
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-12px);
}

.book-cover {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 3/4;
    box-shadow:
        5px 5px 15px rgba(16, 55, 92, 0.15),
        -2px 0 10px rgba(0, 0, 0, 0.08);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.06);
}

.book-overlay {
    position: absolute;
    top: 14px;
    right: 14px;
}

.book-stage {
    background: rgba(10, 25, 41, 0.92);
    color: var(--yellow);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.book-spine {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 7px;
    background: linear-gradient(180deg,
        rgba(16, 55, 92, 0.1),
        rgba(16, 55, 92, 0.3),
        rgba(16, 55, 92, 0.1));
}

.book-info {
    padding: 18px 4px;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.book-teacher {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 400;
}

.book-teacher i {
    color: var(--orange);
    font-size: 0.8rem;
}

/* ==============================
   الحالة الفارغة
   ============================== */
.empty-state {
    text-align: center;
    padding: 90px 20px;
}

.empty-icon {
    width: 110px;
    height: 110px;
    margin: 0 auto 28px;
    background: linear-gradient(135deg, rgba(16, 55, 92, 0.07), rgba(243, 198, 35, 0.06));
    border-radius: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: var(--blue);
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 300;
}

/* ==============================
   قسم عن الدار
   ============================== */
.about-section {
    padding: 110px 0;
    background: var(--cream);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
}

.about-text .section-badge {
    margin-bottom: 18px;
}

.about-text .section-title {
    text-align: right;
    margin-bottom: 22px;
}

.about-text p {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 2;
    margin-bottom: 32px;
    font-weight: 300;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1rem;
    color: var(--text);
}

.feature-item i {
    color: var(--yellow);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.about-card {
    background: linear-gradient(145deg, var(--blue-dark), var(--blue));
    border-radius: var(--radius-xl);
    padding: 55px 45px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(243, 198, 35, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(235, 131, 23, 0.08) 0%, transparent 50%);
}

/* نقش مغربي */
.about-card::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(243, 198, 35, 0.08);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.about-card-inner {
    position: relative;
    z-index: 1;
}

.about-card-inner i {
    font-size: 3.5rem;
    color: var(--yellow);
    margin-bottom: 22px;
    filter: drop-shadow(0 4px 10px rgba(243, 198, 35, 0.3));
}

.about-card-inner h3 {
    font-size: 1.9rem;
    color: #fff;
    margin-bottom: 18px;
}

.about-card-inner p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.05rem;
    line-height: 1.9;
    font-weight: 300;
}

/* ==============================
   الفوتر
   ============================== */
.footer {
    background: var(--dark);
    padding: 65px 0 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 50px;
    padding-bottom: 45px;
    border-bottom: 1px solid rgba(243, 198, 35, 0.08);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.45);
    margin-top: 18px;
    font-size: 0.95rem;
    font-weight: 300;
}

.footer-links h4 {
    color: var(--yellow);
    font-size: 1.1rem;
    margin-bottom: 18px;
    font-weight: 700;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    transition: var(--transition);
    font-weight: 300;
}

.footer-links a:hover {
    color: var(--yellow);
    padding-right: 6px;
}

.footer-bottom {
    text-align: center;
    padding: 22px 0;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
}

/* ==============================
   صفحة المرحلة
   ============================== */
.page-header {
    padding: 150px 0 65px;
    background: linear-gradient(145deg, var(--blue-dark), var(--blue));
    position: relative;
    overflow: hidden;
}

.page-header-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(243, 198, 35, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 30%, rgba(235, 131, 23, 0.08) 0%, transparent 55%);
}

/* زخرفة مغربية */
.page-header::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border: 1px solid rgba(243, 198, 35, 0.06);
    border-radius: 50%;
    top: -200px;
    left: -200px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}

.breadcrumb a, .breadcrumb span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    transition: var(--transition);
    font-weight: 300;
}

.breadcrumb a:hover {
    color: var(--yellow);
}

.breadcrumb i {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
}

.breadcrumb span:last-child {
    color: var(--yellow);
    font-weight: 700;
}

.page-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: #fff;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* تبويبات المراحل */
.stage-tabs {
    background: #fff;
    border-bottom: 1px solid rgba(16, 55, 92, 0.06);
    position: sticky;
    top: 64px;
    z-index: 100;
    box-shadow: 0 3px 15px rgba(16, 55, 92, 0.05);
}

.tabs-wrapper {
    display: flex;
    gap: 6px;
    padding: 14px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding: 10px 26px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 400;
    white-space: nowrap;
    color: var(--text-muted);
    transition: var(--transition);
    border: 1px solid transparent;
}

.tab-item:hover {
    background: var(--cream);
    color: var(--blue);
}

.tab-item.active {
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: var(--yellow);
    box-shadow: 0 6px 20px rgba(16, 55, 92, 0.3);
    font-weight: 700;
}

/* محتوى المرحلة */
.stage-content {
    padding: 55px 0 110px;
    min-height: 50vh;
}

/* شريط البحث */
.search-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 2px solid rgba(16, 55, 92, 0.06);
    border-radius: 50px;
    padding: 15px 28px;
    margin-bottom: 45px;
    transition: var(--transition);
    box-shadow: 0 5px 25px rgba(16, 55, 92, 0.04);
}

.search-bar:focus-within {
    border-color: var(--yellow);
    box-shadow: 0 5px 35px rgba(243, 198, 35, 0.15);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-bar:focus-within i {
    color: var(--orange);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text);
    background: transparent;
}

.search-bar input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.search-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 300;
}

/* شبكة الملازم في صفحة المرحلة */
.bookshelf-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 32px;
}

.material-card {
    transition: transform var(--transition);
}

.material-card:hover {
    transform: translateY(-10px);
}

.material-card-inner {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(16, 55, 92, 0.06);
    border: 1px solid rgba(16, 55, 92, 0.04);
    transition: var(--transition);
}

.material-card:hover .material-card-inner {
    box-shadow: 0 25px 70px rgba(16, 55, 92, 0.14);
}

.material-image {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
}

.material-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.material-card:hover .material-image img {
    transform: scale(1.08);
}

.material-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(10, 25, 41, 0.75));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 30px;
    opacity: 0;
    transition: var(--transition);
}

.material-card:hover .material-image-overlay {
    opacity: 1;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--blue-dark);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(20px);
    transition: var(--transition);
}

.material-card:hover .view-btn {
    transform: translateY(0);
}

.view-btn:hover {
    box-shadow: 0 8px 28px rgba(243, 198, 35, 0.45);
}

.material-details {
    padding: 22px;
}

.material-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.5;
}

.material-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.material-teacher, .material-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
}

.material-teacher i {
    color: var(--orange);
    width: 16px;
    text-align: center;
}

.material-date i {
    color: var(--blue-light);
    width: 16px;
    text-align: center;
}

/* ==============================
   عارض الصور
   ============================== */
.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.image-viewer.active {
    opacity: 1;
    visibility: visible;
}

.viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 41, 0.95);
}

.viewer-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: var(--transition);
}

.image-viewer.active .viewer-content {
    transform: scale(1);
}

.viewer-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
}

.viewer-close {
    position: absolute;
    top: -55px;
    left: 0;
    width: 44px;
    height: 44px;
    background: rgba(243, 198, 35, 0.15);
    border: 1px solid rgba(243, 198, 35, 0.2);
    border-radius: 50%;
    color: var(--yellow);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-close:hover {
    background: var(--yellow);
    color: var(--blue-dark);
}

.viewer-title {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 18px;
    font-size: 1.1rem;
    font-weight: 300;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: var(--yellow);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 22px;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-back:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 55, 92, 0.3);
}

/* ==============================
   الحركات
   ============================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(35px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3) rotate(10deg); }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(7px); }
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(14px); }
}

@keyframes rotateDecor {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes floatParticle {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(-20vh) scale(1); }
}

/* عنصر مرئي عند التمرير */
.reveal {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* جزيئات Hero المحسّنة */
.hero-particle {
    position: absolute;
    background: rgba(243, 198, 35, 0.3);
    border-radius: 50%;
    animation: floatParticle linear infinite;
    pointer-events: none;
    will-change: transform, opacity;
}

/* ==============================
   الاستجابة
   ============================== */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .hero-stats {
        gap: 30px;
    }

    .stages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 25, 41, 0.98);
        backdrop-filter: blur(24px);
        flex-direction: column;
        padding: 24px;
        gap: 6px;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8.5px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8.5px) rotate(-45deg);
    }

    .hero-stats {
        flex-direction: column;
        gap: 22px;
    }

    .stages-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .shelf-row,
    .bookshelf-display {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .footer-content {
        flex-direction: column;
    }

    .page-header {
        padding: 130px 0 45px;
    }

    .tabs-wrapper {
        gap: 4px;
    }

    .tab-item {
        padding: 9px 18px;
        font-size: 0.85rem;
    }

    .stage-card-content {
        padding: 26px 20px;
    }

    .stage-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stages-grid {
        grid-template-columns: 1fr;
    }

    .shelf-row,
    .bookshelf-display {
        grid-template-columns: 1fr;
        max-width: 340px;
        margin: 0 auto;
    }

    .hero-content {
        padding: 0 12px;
    }

    .title-line {
        font-size: 1.1rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .hero-btn {
        padding: 14px 34px;
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 45px;
    }
}

/* ===================================
   صفحة الوكلاء
   =================================== */

.agents-header .page-subtitle {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 10px;
}

.agents-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.95rem;
}

/* فلترة وبحث */
.agents-filter-section {
    background: var(--white);
    padding: 24px 0;
    border-bottom: 1px solid rgba(16, 55, 92, 0.08);
    position: sticky;
    top: 80px;
    z-index: 90;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.agents-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agents-search-form {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.agents-search-box {
    display: flex;
    align-items: center;
    background: var(--cream);
    border: 2px solid transparent;
    border-radius: 50px;
    padding: 10px 20px;
    gap: 12px;
    transition: var(--transition);
}

.agents-search-box:focus-within {
    border-color: var(--orange);
    background: var(--white);
    box-shadow: 0 4px 20px rgba(235, 131, 23, 0.15);
}

.agents-search-box i {
    color: var(--orange);
    font-size: 1.1rem;
}

.agents-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text);
    outline: none;
}

.agents-search-box input::placeholder {
    color: var(--text-muted);
}

.clear-search {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 4px;
    transition: var(--transition);
}

.clear-search:hover {
    color: #e74c3c;
}

/* تبويبات المدن */
.city-tabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.city-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.city-tabs {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    min-width: max-content;
}

.city-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    background: var(--cream);
    color: var(--text-light);
    border: 1px solid transparent;
    white-space: nowrap;
    transition: var(--transition);
}

.city-tab:hover {
    background: var(--cream-dark);
    color: var(--blue);
}

.city-tab.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.city-count {
    background: rgba(255,255,255,0.2);
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 0.78rem;
}

.city-tab.active .city-count {
    background: rgba(255,255,255,0.25);
}

/* محتوى الوكلاء */
.agents-content {
    padding: 40px 0 80px;
}

.search-results-info {
    background: var(--cream);
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    color: var(--text-light);
}

.search-results-info strong {
    color: var(--orange);
}

/* قسم المدينة */
.city-section {
    margin-bottom: 50px;
}

.city-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--blue);
}

.city-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-name i {
    color: var(--orange);
    font-size: 1.1rem;
}

.city-badge {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--blue-dark);
    padding: 5px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* شبكة الوكلاء */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.agent-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid rgba(16, 55, 92, 0.06);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.agent-card:hover {
    box-shadow: 0 8px 30px var(--shadow);
    border-color: var(--orange);
    transform: translateY(-2px);
}

.agent-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: linear-gradient(135deg, var(--cream), var(--cream-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    font-size: 1.2rem;
}

.agent-card:hover .agent-icon {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--blue-dark);
}

.agent-info {
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.agent-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.agent-phone:hover {
    color: var(--orange);
}

.agent-phone i {
    font-size: 0.8rem;
}

.agent-address {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.agent-address i {
    margin-top: 3px;
    font-size: 0.75rem;
    color: var(--orange);
}

/* ريسبونسيف */
@media (max-width: 768px) {
    .agents-header .page-subtitle {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .agents-grid {
        grid-template-columns: 1fr;
    }

    .city-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .agents-filter-section {
        top: 70px;
    }
}
