/* ========================================
   AgriGate — بوابة الزراعة
   Visual Design System (Redesigned)
   ======================================== */

:root {
    --leaf: #2e7d32;
    --leaf-dark: #1b5e20;
    --leaf-darker: #0d3b21;
    --leaf-soft: #e8f5e9;
    --green-50: #f1f8f1;
    --green-100: #e1f2e3;
    --gold: #d97706;
    --gold-light: #f59e0b;
    --gold-soft: #fffbeb;
    --bg: #f6f9f7;
    --white: #ffffff;
    --ink-dark: #112f22;
    --ink: #2f4438;
    --muted: #6b7280;
    --line: #e6eee8;
    --shadow-md: 0 16px 38px rgba(15, 55, 32, 0.13);
    --shadow-lg: 0 30px 70px rgba(12, 45, 26, 0.18);
    --grad-leaf: linear-gradient(135deg, #3b9c42, var(--leaf-dark));
    --grad-gold: linear-gradient(135deg, var(--gold-light), var(--gold));
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
    font-family: "Cairo", "Tajawal", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    direction: rtl;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { width: 100%; height: auto; display: block; max-width: 100%; }
button, input { font-family: inherit; }
ul { list-style: none; }

.container { width: min(1100px, 90%); margin: auto; }
.departments .container { width: min(955px, 90%); }

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes growLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ========================================
   NAVBAR
   ======================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #0a2e1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.nav-container {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo { display: flex; align-items: center; gap: 10px; color: var(--white); flex-shrink: 0; }
.logo-icon {
    font-size: 30px; line-height: 1; width: 42px; height: 42px; border-radius: 12px;
    background: var(--grad-leaf); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 96, 40, 0.3);
}
.logo strong { display: block; font-size: 20px; line-height: 1; font-weight: 800; letter-spacing: -0.5px; color: var(--white); }
.logo strong span, .footer-logo strong span { color: var(--gold-light); }
.logo small { display: block; font-size: 8.5px; color: #9cb6a4; margin-top: 2px; font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
    color: #d6e8db; font-size: 12.5px; font-weight: 700; padding: 8px 12px; position: relative;
    border-radius: 7px; transition: all 0.3s; white-space: nowrap;
}
.nav-links a:hover { color: var(--white); background: rgba(255, 255, 255, 0.1); }
.nav-links a.active { color: var(--white); background: rgba(255, 255, 255, 0.12); }
.nav-links a.active::after {
    content: ""; position: absolute; bottom: 4px; right: 14px; left: 14px; height: 3px;
    border-radius: 999px; background: var(--grad-gold);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

.lang-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid #e4ebe6;
    background: var(--green-50); font-size: 14px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; color: var(--leaf-dark); transition: all 0.3s;
}
.lang-btn:hover { background: var(--green-100); transform: rotate(-8deg); }

.login-btn, .register-btn {
    padding: 8px 18px; border-radius: 8px; font-size: 12px; font-weight: 700; transition: all 0.3s; white-space: nowrap;
}
.login-btn { color: var(--leaf-dark); border: 1.5px solid var(--leaf); background: var(--white); }
.login-btn:hover { background: var(--leaf-soft); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(15, 55, 32, 0.1); }
.register-btn { background: var(--grad-leaf); color: var(--white); border: 1.5px solid transparent; box-shadow: 0 4px 12px rgba(30, 96, 40, 0.22); }
.register-btn:hover { background: var(--grad-gold); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(217, 119, 6, 0.25); }

.menu-btn { display: none; background: none; border: none; color: var(--leaf-dark); font-size: 28px; cursor: pointer; line-height: 1; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }

/* ========================================
   HERO
   ======================================== */

.hero {
    min-height: 520px;
    position: relative;
    background: url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449?auto=format&fit=crop&w=2200&q=85") center/cover no-repeat;
    display: flex; align-items: center; color: var(--white); padding: 52px 0 64px;
}

.hero-overlay {
    position: absolute; inset: 0;
    background:
        linear-gradient(105deg, rgba(5, 34, 18, 0.95) 0%, rgba(9, 54, 30, 0.8) 48%, rgba(13, 62, 35, 0.45) 100%);
}

.hero-container { position: relative; z-index: 2; width: 100%; }
.hero-content { max-width: 660px; }

.hero h1 { font-size: clamp(38px, 5vw, 56px); line-height: 1.12; margin-bottom: 16px; font-weight: 800; }
.hero h1 span { color: var(--gold-light); background: linear-gradient(90deg, var(--gold-light), #fbbf24); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 15px; line-height: 1.95; color: #e9f2ec; margin-bottom: 26px; max-width: 520px; }

.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-primary, .hero-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 10px; font-size: 13.5px; font-weight: 700; transition: all 0.35s;
}
.hero-primary { background: var(--grad-leaf); color: var(--white); box-shadow: 0 8px 24px rgba(11, 51, 30, 0.4); }
.hero-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(11, 51, 30, 0.5); }
.hero-secondary { border: 1.5px solid rgba(255, 255, 255, 0.85); color: var(--white); background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(4px); }
.hero-secondary:hover { background: var(--gold); border-color: var(--gold); transform: translateY(-3px); }

/* ========================================
   STATS — صندوق عائم أسفل الـ Hero
   ======================================== */

.stats-float {
    position: relative; z-index: 3; margin-top: 44px;
    background: rgba(13, 40, 24, 0.88); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px;
    box-shadow: var(--shadow-lg); animation: fadeUp 0.8s ease both;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); }

.stat { padding: 20px 14px; display: flex; align-items: center; justify-content: center; gap: 11px; border-left: 1px solid rgba(255, 255, 255, 0.1); transition: background 0.3s; }
.stat:first-child { border-left: none; }
.stat:hover { background: rgba(255, 255, 255, 0.04); }

.stat-icon { font-size: 22px; animation: floatY 3s ease-in-out infinite; }
.stat strong { display: block; color: var(--white); font-size: 17px; line-height: 1.2; }
.stat span { display: block; color: #c4d9cc; font-size: 11px; font-weight: 600; }

/* ========================================
   SECTION HEADING
   ======================================== */

.section-heading { text-align: center; max-width: 720px; margin: 0 auto 28px; }
.section-heading > span {
    display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 13px; font-weight: 700;
    background: var(--gold-soft); padding: 5px 14px; border-radius: 999px; border: 1px solid #fde3b0;
}
.section-heading h2 { font-size: clamp(26px, 3.5vw, 34px); color: var(--ink-dark); margin-top: 12px; font-weight: 800; line-height: 1.3; }
.section-heading h2::after {
    content: ""; width: 64px; height: 4px; border-radius: 999px;
    background: var(--grad-gold); display: block; margin: 16px auto 0;
    animation: growLine 0.6s ease both;
}
.section-heading p { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ========================================
   DEPARTMENTS PAGE — HERO
   ======================================== */

.dept-page-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    color: var(--white);
    background: url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449?auto=format&fit=crop&w=2200&q=85") center/cover no-repeat;
    padding: 80px 0 0;
    overflow: hidden;
}

.dept-page-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(5, 34, 18, 0.95) 0%, rgba(9, 54, 30, 0.82) 48%, rgba(13, 62, 35, 0.5) 100%);
}

.dept-page-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-bottom: 0;
}

.dept-page-hero-content h1 {
    font-size: clamp(34px, 4.5vw, 50px);
    line-height: 1.15;
    margin-bottom: 14px;
    font-weight: 800;
}

.dept-page-hero-content h1 span {
    color: var(--gold-light);
    background: linear-gradient(90deg, var(--gold-light), #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dept-page-hero-content > p {
    font-size: 14px;
    line-height: 1.9;
    color: #d6e8db;
    margin-bottom: 24px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.dept-page-hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 44px;
}

.dept-hero-btn-outline,
.dept-hero-btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.35s;
    cursor: pointer;
}

.dept-hero-btn-outline {
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
}

.dept-hero-btn-outline:hover {
    background: var(--gold);
    border-color: var(--gold);
    transform: translateY(-2px);
}

.dept-hero-btn-solid {
    background: var(--grad-leaf);
    color: var(--white);
    border: 1.5px solid transparent;
    box-shadow: 0 6px 20px rgba(11, 51, 30, 0.35);
}

.dept-hero-btn-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(11, 51, 30, 0.5);
}

/* Stats Bar */
.dept-page-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(13, 40, 24, 0.86);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: -40px;
    position: relative;
    z-index: 3;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
}

.dept-page-stat {
    padding: 18px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s;
}

.dept-page-stat:first-child { border-left: none; }
.dept-page-stat:hover { background: rgba(255, 255, 255, 0.05); }

.dept-page-stat-icon {
    font-size: 20px;
    animation: floatY 3s ease-in-out infinite;
}

.dept-page-stat strong {
    display: block;
    color: var(--white);
    font-size: 16px;
    line-height: 1.2;
}

.dept-page-stat small {
    display: block;
    color: #b4d0bc;
    font-size: 10.5px;
    font-weight: 600;
    margin-top: 1px;
}

/* ========================================
   DEPARTMENTS — CARDS
   ======================================== */

.departments { padding: 52px 0 44px; background: var(--white); }
.department-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
#departments #departmentsGrid .department-card:nth-child(n+9) { display: none; }

.department-card {
    background: var(--white);
    border: 1px solid #e4ebe6;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--card-accent, #2e7d32) 8%, transparent),
                0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.department-card::before { display: none; }

.department-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--card-accent, #2e7d32) 16%, transparent),
                0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: color-mix(in srgb, var(--card-accent, #2e7d32) 28%, #e4ebe6);
}

.card-image {
    height: 130px;
    position: relative;
}

.card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(#ffffff00, rgba(11, 51, 30, 0.2));
}

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

.department-card:hover .card-image img { transform: scale(1.06); }

.card-icon {
    position: absolute;
    bottom: -20px;
    right: 50%;
    transform: translateX(50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2.5px solid var(--card-accent, var(--leaf));
    box-shadow: 0 2px 8px rgba(15, 55, 32, 0.12);
    z-index: 2;
}

.card-content {
    padding: 26px 13px 13px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-content h3 {
    color: var(--ink-dark);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1.4;
}

.card-content p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.75;
    min-height: 32px;
    flex: 1;
}

.card-content a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--card-accent, var(--leaf));
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 8px;
    padding: 0;
    border-radius: 0;
    background: none;
    border: none;
    transition: all 0.3s;
    width: fit-content;
    margin-right: auto;
    margin-left: auto;
}

.card-content a:hover {
    color: var(--white);
    background: var(--card-accent, var(--leaf));
    padding: 5px 12px;
    border-radius: 6px;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--card-accent, var(--leaf)) 30%, transparent);
}

.card-content a span { transition: transform 0.3s; font-size: 12px; }
.card-content a:hover span { transform: translateX(-4px); }

.all-departments { text-align: center; margin-top: 24px; }

.all-departments a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--grad-leaf);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    transition: all 0.35s;
    box-shadow: 0 6px 20px rgba(11, 51, 30, 0.22);
}

.all-departments a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(11, 51, 30, 0.28);
    background: var(--grad-gold);
}

/* ========================================
   CTA
   ======================================== */

.cta {
    position: relative; padding: 64px 0; background: var(--leaf-darker); color: var(--white); overflow: hidden;
}
.cta::before {
    content: ""; position: absolute; inset: 0;
    background: url("https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=1600&q=60") center/cover no-repeat;
    opacity: 0.18;
}
.cta::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.15), transparent 40%);
}
.cta-content { position: relative; z-index: 2; text-align: center; }
.cta-content h2 { font-size: clamp(24px, 3.5vw, 34px); font-weight: 800; margin-bottom: 10px; }
.cta-content h2 span { color: var(--gold-light); }
.cta-content p { color: #dcebe1; font-size: 13.5px; max-width: 520px; margin: 0 auto 22px; }
.cta-content a {
    display: inline-flex; align-items: center; gap: 8px; background: var(--grad-leaf);
    color: var(--white); padding: 12px 28px; border-radius: 10px; font-size: 13.5px; font-weight: 700;
    transition: all 0.35s; box-shadow: 0 8px 24px rgba(11, 51, 30, 0.35);
}
.cta-content a:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(11, 51, 30, 0.45); background: var(--grad-gold); }

/* ========================================
   FOOTER
   ======================================== */

footer { background: #072016; color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px; padding: 52px 0 36px; }

.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--white); }
.footer-logo > span { font-size: 30px; line-height: 1; width: 42px; height: 42px; border-radius: 12px; background: var(--grad-leaf); display: flex; align-items: center; justify-content: center; }
.footer-logo strong { display: block; font-size: 20px; line-height: 1; font-weight: 800; }
.footer-logo small { font-size: 9px; color: #9cb6a4; font-weight: 600; }
.footer-about p { color: #9cb6a4; font-size: 12px; line-height: 1.9; max-width: 280px; }

.footer-column h3 { font-size: 14px; font-weight: 800; margin-bottom: 14px; color: var(--white); position: relative; padding-bottom: 8px; }
.footer-column h3::after { content: ""; position: absolute; bottom: 0; right: 0; width: 30px; height: 2.5px; border-radius: 999px; background: var(--grad-gold); }
.footer-column a { display: block; color: #9cb6a4; font-size: 12px; margin-bottom: 8px; transition: all 0.3s; }
.footer-column a:hover { color: var(--gold-light); transform: translateX(-4px); }

.contact p { color: #9cb6a4; font-size: 12px; margin-bottom: 8px; direction: ltr; text-align: right; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 18px 0; display: flex; flex-wrap: wrap;
    align-items: center; justify-content: space-between; gap: 12px;
}
.socials { display: flex; gap: 8px; }
.socials a {
    width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
    color: var(--white); transition: all 0.3s;
}
.socials a:hover { background: var(--grad-gold); border-color: transparent; transform: translateY(-3px); }
.copyright { color: #86a390; font-size: 11px; font-weight: 600; }

/* ========================================
   AUTH PAGES
   ======================================== */

.login-page, .register-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px;
    background:
        radial-gradient(circle at 12% 18%, rgba(46, 125, 50, 0.15), transparent 34%),
        radial-gradient(circle at 88% 82%, rgba(217, 119, 6, 0.12), transparent 36%),
        url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449?auto=format&fit=crop&w=1600&q=60") center/cover no-repeat fixed;
    position: relative;
}

.login-page::before, .register-page::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(13, 59, 33, 0.92) 0%, rgba(27, 94, 32, 0.88) 50%, rgba(46, 125, 50, 0.85) 100%);
    z-index: 0;
}

.login-page > *, .register-page > * { position: relative; z-index: 1; }

.login-card, .register-card {
    width: 100%; background: var(--white); border-radius: 18px; border: 1px solid #e4ebe6;
    border-top: 3px solid var(--leaf); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12); padding: 38px 32px; text-align: center;
    animation: fadeUp 0.5s ease both;
}
.login-card { max-width: 420px; }
.register-card { max-width: 480px; }

.login-logo, .register-logo {
    width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--grad-leaf); border: 2.5px solid var(--leaf);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; box-shadow: 0 6px 20px rgba(30, 96, 40, 0.28);
}

.login-card h1, .register-card h1 { color: var(--leaf-dark); font-size: 23px; font-weight: 800; margin-bottom: 5px; }
.login-subtitle, .register-subtitle { color: var(--muted); font-size: 12px; margin-bottom: 24px; }

.login-card form, .register-card form { text-align: right; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; color: var(--leaf-dark); font-size: 12px; font-weight: 700; margin-bottom: 5px; transition: color 0.25s; }
.form-group input {
    width: 100%; padding: 11px 13px; border: 1.5px solid #e4ebe6; border-radius: 10px;
    background: var(--green-50); font-size: 13px; color: var(--ink-dark);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.form-group input::placeholder { color: #a3b1a8; opacity: 1; }
.form-group input[type="email"], .form-group input[type="password"], .form-group input[type="tel"] { direction: ltr; text-align: left; }
.form-group input:focus { outline: none; border-color: var(--leaf); background: var(--white); box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.14); }
.form-group:focus-within label { color: var(--leaf); }
.form-group input.error { border-color: #d9432f; background: #fff7f6; }
.field-error { display: block; color: #c03321; font-size: 10.5px; font-weight: 600; margin-top: 5px; }

.form-message { display: none; padding: 9px 13px; border-radius: 9px; font-size: 11.5px; font-weight: 600; margin-bottom: 14px; text-align: right; }
.form-message.visible { display: block; }
.form-message.success { background: var(--leaf-soft); color: #2f6b2f; border: 1px solid #b7d9b0; }
.form-message.error { background: #fdeeec; color: #b3301f; border: 1px solid #f2b6ad; }
.form-message.form-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000;
    width: max-content; max-width: min(430px, 92vw); margin-bottom: 0; box-shadow: var(--shadow-lg);
}

button[type="submit"][aria-busy="true"] { pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
    button[type="submit"][aria-busy="true"]::before {
        content: ""; width: 14px; height: 14px; flex-shrink: 0; border: 2px solid rgba(255, 255, 255, 0.45);
        border-top-color: #ffffff; border-radius: 50%; animation: btnSpin 0.7s linear infinite;
    }
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

.login-submit-btn, .register-card .register-btn {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 18px; margin-top: 3px; border: none; border-radius: 10px;
    background: var(--grad-leaf); color: var(--white);
    font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.3s;
}
.login-submit-btn:hover, .register-card .register-btn:hover {
    background: var(--grad-gold); box-shadow: 0 8px 18px rgba(217, 119, 6, 0.3); transform: translateY(-2px);
}
.login-submit-btn:disabled, .register-card .register-btn:disabled { background: #b5c9ab; cursor: not-allowed; transform: none; box-shadow: none; }

.login-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 3px 0 16px; }
.login-options a { color: var(--leaf); font-size: 11.5px; font-weight: 600; transition: 0.3s; }
.login-options a:hover { color: var(--gold); text-decoration: underline; }

.create-account, .login-link { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e4ebe6; color: var(--muted); font-size: 12px; }
.create-account a, .login-link a { color: var(--leaf-dark); font-weight: 700; transition: 0.3s; }
.create-account a:hover, .login-link a:hover { color: var(--gold); text-decoration: underline; }

.login-page :focus-visible, .register-page :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.navbar a:focus-visible, .menu-btn:focus-visible, .logout-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ========================================
   NAVBAR — حالة المستخدم
   ======================================== */

.guest-actions, .auth-user { display: flex; align-items: center; gap: 10px; }
.auth-user { display: none; }
.navbar.is-authed .guest-actions { display: none; }
.navbar.is-authed .auth-user { display: flex; }

.user-chip {
    display: flex; align-items: center; gap: 8px; max-width: 180px; padding: 3px 12px 3px 5px;
    border-radius: 50px; border: 1px solid #d3e2d6; background: var(--green-50); color: var(--ink-dark);
    font-size: 11.5px; font-weight: 700;
}
.user-chip #userName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-avatar {
    width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
    background: var(--grad-leaf); color: var(--white);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.logout-btn {
    padding: 6px 14px; border-radius: 8px; border: 1.5px solid var(--leaf); background: transparent;
    color: var(--leaf-dark); font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.3s;
}
.logout-btn:hover:not(:disabled) { background: var(--leaf); border-color: var(--leaf); color: var(--white); }
.logout-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ========================================
   MOBILE MENU
   ======================================== */

@keyframes menuSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
    .nav-links, .nav-actions { display: none; }
    .menu-btn { display: flex; }
    .navbar.menu-open .nav-container { flex-wrap: wrap; padding-bottom: 16px; }
    .navbar.menu-open .menu-btn { order: 1; }
    .navbar.menu-open .nav-links { order: 2; }
    .navbar.menu-open .nav-actions { order: 3; }
    .navbar.menu-open .nav-links, .navbar.menu-open .nav-actions {
        display: flex; flex-direction: column; align-items: stretch; flex-basis: 100%; gap: 0; animation: menuSlide 0.25s ease;
    }
    .navbar.menu-open .nav-links a { padding: 14px 12px; font-size: 14px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; min-height: 48px; display: flex; align-items: center; }
    .navbar.menu-open .nav-links a.active { background: transparent; }
    .navbar.menu-open .nav-links a.active::after { display: none; }
    .navbar.menu-open .nav-links a:last-child { border-bottom: none; }
    .navbar.menu-open .nav-actions { gap: 10px; padding-top: 12px; }
    .navbar.menu-open .guest-actions, .navbar.menu-open .auth-user { flex-direction: column; align-items: stretch; width: 100%; gap: 8px; }
    .navbar.menu-open .login-btn, .navbar.menu-open .register-btn, .navbar.menu-open .logout-btn { width: 100%; text-align: center; padding: 12px; font-size: 13px; min-height: 48px; display: flex; align-items: center; justify-content: center; }
    .navbar.menu-open .user-chip { justify-content: center; max-width: none; }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1100px) {
    .department-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1050px) {
    .nav-links { gap: 2px; }
    .nav-links a { font-size: 11.5px; padding: 7px 10px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .dept-page-hero { min-height: 500px; }
}

@media (max-width: 850px) {
    .hero { min-height: 480px; padding: 40px 0 52px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat { border-left: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
    .stat:last-child, .stat:nth-last-child(2):nth-child(odd) { border-bottom: none; }
    .department-grid { grid-template-columns: repeat(2, 1fr); }
    .dept-page-hero { min-height: 480px; }
    .dept-page-stats { grid-template-columns: repeat(2, 1fr); }
    .dept-page-stat { border-left: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
    .dept-page-stat:last-child, .dept-page-stat:nth-last-child(2):nth-child(odd) { border-bottom: none; }
    .cta { padding: 48px 0; }
    .dept-body { padding: 40px 0; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: clamp(24px, 5vw, 36px); }
    .hero-content { max-width: 100%; }
    .dept-page-hero-content h1 { font-size: clamp(22px, 4.5vw, 34px); }
    .footer-grid { gap: 28px; }
    .stat strong { font-size: 15px; }
    .stat span { font-size: 10.5px; }
    .dept-page-stat strong { font-size: 14px; }
    .dept-page-stat small { font-size: 10px; }
}

@media (max-width: 600px) {
    .hero { min-height: 420px; padding: 32px 0 44px; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 13px; line-height: 1.8; }
    .hero-buttons { gap: 10px; }
    .hero-primary, .hero-secondary { padding: 11px 20px; font-size: 12.5px; }
    .stats-float { margin-top: 32px; border-radius: 12px; }
    .stats { grid-template-columns: 1fr; }
    .stat { padding: 14px 12px; }
    .department-grid { grid-template-columns: 1fr; gap: 14px; }
    .section-heading { margin-bottom: 20px; }
    .section-heading > span { font-size: 12px; padding: 4px 12px; }
    .section-heading h2 { font-size: 22px; }
    .section-heading p { font-size: 12px; }
    .cta { padding: 40px 0; }
    .cta-content h2 { font-size: 22px; }
    .cta-content p { font-size: 12.5px; }
    .cta-content a { padding: 11px 22px; font-size: 12.5px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 24px; padding: 36px 0 24px; }
    .footer-about p { margin: auto; max-width: none; }
    .footer-column h3::after { right: 50%; transform: translateX(50%); }
    .footer-bottom { flex-direction: column; justify-content: center; text-align: center; gap: 14px; padding: 16px 0; }
    .socials { justify-content: center; }
    .contact p { text-align: center; }
    .login-card, .register-card { padding: 28px 18px; border-radius: 14px; }
    .login-card { max-width: 100%; }
    .register-card { max-width: 100%; }
    .login-page, .register-page { padding: 24px 16px; background-attachment: scroll; }
    .dept-page-hero { min-height: 380px; padding-top: 48px; }
    .dept-page-hero-content h1 { font-size: 24px; }
    .dept-page-hero-content > p { font-size: 12px; line-height: 1.8; }
    .dept-page-hero-buttons { gap: 8px; }
    .dept-hero-btn-outline, .dept-hero-btn-solid { padding: 10px 18px; font-size: 12px; }
    .dept-page-stats { grid-template-columns: 1fr; margin-bottom: -24px; border-radius: 12px; }
    .dept-page-stat { padding: 12px; border-left: none; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
    .dept-page-stat:last-child { border-bottom: none; }
    .dept-hero { min-height: 340px; padding: 70px 0 40px; }
    .dept-hero-content h1 { font-size: 22px; }
    .dept-hero-tagline { font-size: 13px; }
    .dept-body { padding: 32px 0; }
    .dept-section { padding: 18px; margin-top: 18px; border-radius: 12px; }
    .dept-section h2 { font-size: 16px; }
    .dept-topics li, .dept-focus li { padding: 10px 32px 10px 12px; font-size: 12px; }
    .dept-careers li { padding: 10px 32px 10px 12px; font-size: 12px; }
    .dept-about p { font-size: 13px; }
}

@media (max-width: 480px) {
    .hero { min-height: 380px; padding: 28px 0 36px; }
    .hero h1 { font-size: 24px; line-height: 1.2; }
    .hero p { font-size: 12px; }
    .hero-primary, .hero-secondary { padding: 10px 16px; font-size: 12px; }
    .stats-float { border-radius: 10px; }
    .stat { padding: 12px 10px; gap: 8px; }
    .stat-icon { font-size: 18px; }
    .stat strong { font-size: 14px; }
    .stat span { font-size: 10px; }
    .dept-page-hero { min-height: 340px; padding-top: 40px; }
    .dept-page-hero-content h1 { font-size: 22px; }
    .dept-page-hero-content > p { font-size: 11.5px; }
    .dept-hero { min-height: 300px; padding: 60px 0 32px; }
    .dept-hero-content h1 { font-size: 20px; }
    .dept-hero-tagline { font-size: 12px; }
    .dept-hero-icon { width: 60px; height: 60px; font-size: 28px; }
    .login-card, .register-card { padding: 24px 16px; }
    .login-card h1, .register-card h1 { font-size: 20px; }
    .login-logo, .register-logo { width: 56px; height: 56px; font-size: 24px; }
    .form-group input { padding: 10px 12px; font-size: 13px; }
    .cta-content a { width: 100%; justify-content: center; }
    .all-departments a { width: 100%; justify-content: center; }
    .dept-section { padding: 14px; }
    .dept-section h2 { font-size: 15px; padding-right: 10px; }
    .breadcrumb { font-size: 11px; gap: 5px; }
}

/* ========================================
   DEPARTMENT PAGE
   ======================================== */

.dept-hero {
    position: relative; min-height: 420px; display: flex; align-items: center; color: var(--white);
    background-size: cover; background-position: center; padding: 90px 0 56px;
}
.dept-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(105deg, rgba(5, 34, 18, 0.95) 0%, rgba(9, 54, 30, 0.82) 48%, rgba(13, 62, 35, 0.5) 100%);
}
.dept-hero-overlay::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.15), transparent 45%);
}
.dept-hero-content { position: relative; z-index: 2; text-align: center; width: 100%; }

.breadcrumb { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; color: #d6e4db; margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb a { color: var(--white); font-weight: 600; transition: color 0.3s; }
.breadcrumb a:hover { color: var(--gold-light); }
.crumb-sep { opacity: 0.6; }

.dept-hero-icon {
    width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.14); border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; backdrop-filter: blur(6px);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
}
.dept-hero-content h1 { font-size: clamp(26px, 3.5vw, 38px); font-weight: 800; margin-bottom: 12px; }
.dept-hero-tagline { max-width: 600px; margin: 0 auto; color: #e6f1ea; font-size: 14px; line-height: 1.85; }

.dept-body { padding: 56px 0; background: var(--white); }
.dept-layout { max-width: 800px; margin: 0 auto; }

.dept-about p { color: var(--ink); font-size: 14px; line-height: 1.95; margin-bottom: 14px; }

/* Unified Section Styling */
.dept-section {
    background: var(--white);
    border: 1px solid #e4ebe6;
    border-radius: 14px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-right: 4px solid var(--leaf);
    transition: box-shadow 0.3s;
}
.dept-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.dept-section h2 {
    color: var(--leaf-dark); font-size: 18px; font-weight: 800; margin-bottom: 14px;
    padding-right: 12px; border-right: 3px solid var(--gold); line-height: 1.3;
}
.dept-section--about { border-right-color: var(--leaf); }
.dept-section--topics { border-right-color: #0d9488; }
.dept-section--focus { border-right-color: #65a30d; }
.dept-section--careers { border-right-color: #d97706; }

.dept-topics, .dept-focus { display: grid; gap: 8px; }
.dept-topics li, .dept-focus li {
    background: var(--white); border: 1px solid #e4ebe6; border-radius: 10px; padding: 11px 38px 11px 14px;
    font-size: 13px; color: var(--ink-dark); position: relative; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); transition: all 0.25s;
}
.dept-topics li:hover, .dept-focus li:hover { transform: translateX(-4px); border-color: #bfe3c4; box-shadow: var(--shadow-md); }
.dept-topics li::before, .dept-focus li::before {
    content: "🌱"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px;
}

.dept-careers { display: grid; gap: 8px; }
.dept-careers li {
    background: var(--grad-leaf); border: 1px solid transparent; color: var(--white);
    border-radius: 10px; padding: 11px 38px 11px 14px; font-size: 13px;
    position: relative; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); transition: all 0.25s;
}
.dept-careers li:hover { transform: translateX(-4px); box-shadow: var(--shadow-md); }
.dept-careers li::before { content: "💼"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; }

/* ---- Resource Sections ---- */
.dept-resources {
    display: grid;
    gap: 32px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e4ebe6;
}

/* Resources Section Header */
.resources-header {
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #f8fdf9 0%, #f1f8f1 50%, #fffbeb 100%);
    border-radius: 18px;
    border: 1px solid #e4ebe6;
    position: relative;
    overflow: hidden;
}

.resources-header::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--grad-gold);
}

.resources-header-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid #d4e8d7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.12);
}

.resources-header-title {
    color: var(--ink-dark);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.resources-header-subtitle {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
}

/* Resource Section (Videos / Materials / Research) */
.dept-resource-section {
    background: var(--white);
    border: 1px solid #e4ebe6;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.resource-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid #f1f5f3;
}

.resource-section-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.3s;
}

.resource-section-icon--video {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1.5px solid #fcd34d;
}

.resource-section-icon--material {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1.5px solid #93c5fd;
}

.resource-section-icon--research {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1.5px solid #6ee7b7;
}

.resource-section-header:hover .resource-section-icon {
    transform: scale(1.05);
}

.resource-section-text h3 {
    color: var(--ink-dark);
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.resource-section-text p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    gap: 16px;
}

.resource-grid--videos {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.resource-grid--materials {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.resource-grid--research {
    grid-template-columns: 1fr;
}

/* ---- Video Card ---- */
.resource-card--video {
    background: var(--white);
    border: 1px solid #e4ebe6;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.resource-card--video:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: #d0ddd3;
}

.resource-card--video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    overflow: hidden;
}

.resource-card--video-thumbnail img {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.resource-card--video:hover .resource-card--video-thumbnail img {
    transform: scale(1.05);
}

.resource-card--video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s;
    z-index: 2;
}

.resource-card--video:hover .resource-card--video-play {
    background: var(--white);
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
}

.resource-card--video-play-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.9);
}

.resource-card--video-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.resource-card--video-title {
    color: var(--ink-dark);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card--video-desc {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.75;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card--video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.resource-card--video-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0fdf4;
    color: #166534;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

.resource-card--video-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    background: var(--leaf-soft);
    color: var(--leaf-dark);
    border: 1.5px solid #cde8d0;
    text-decoration: none;
    transition: all 0.3s;
}

.resource-card--video-btn:hover {
    background: var(--grad-leaf);
    color: var(--white);
    border-color: var(--leaf);
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.25);
    transform: translateY(-1px);
}

.resource-card--video-btn span {
    transition: transform 0.3s;
}

.resource-card--video-btn:hover span {
    transform: translateX(-3px);
}

/* ---- Material / PDF Card ---- */
.resource-card--material {
    background: var(--white);
    border: 1px solid #e4ebe6;
    border-radius: 14px;
    padding: 20px;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.resource-card--material:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
    border-color: #d0ddd3;
}

.resource-card--material-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1.5px solid #bfdbfe;
    transition: transform 0.3s;
}

.resource-card--material:hover .resource-card--material-icon {
    transform: scale(1.05);
}

.resource-card--material-body {
    flex: 1;
    min-width: 0;
}

.resource-card--material-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.resource-card--material-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
}

.resource-card--material-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.resource-card--material-title {
    color: var(--ink-dark);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.5;
}

.resource-card--material-desc {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.75;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card--material-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    background: var(--leaf-soft);
    color: var(--leaf-dark);
    border: 1.5px solid #cde8d0;
    text-decoration: none;
    transition: all 0.3s;
}

.resource-card--material-btn:hover {
    background: var(--grad-leaf);
    color: var(--white);
    border-color: var(--leaf);
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.25);
    transform: translateY(-1px);
}

.resource-card--material-btn span {
    transition: transform 0.3s;
}

.resource-card--material-btn:hover span {
    transform: translateX(-3px);
}

/* ---- Research Card ---- */
.resource-card--research {
    background: var(--white);
    border: 1px solid #e4ebe6;
    border-radius: 14px;
    padding: 22px;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.resource-card--research:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #d0ddd3;
}

.resource-card--research-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1.5px solid #6ee7b7;
}

.resource-card--research-body {
    flex: 1;
    min-width: 0;
}

.resource-card--research-title {
    color: var(--ink-dark);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.5;
}

.resource-card--research-authors {
    color: var(--leaf-dark);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.resource-card--research-journal {
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
    margin-bottom: 8px;
}

.resource-card--research-desc {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.75;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card--research-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    background: var(--leaf-soft);
    color: var(--leaf-dark);
    border: 1.5px solid #cde8d0;
    text-decoration: none;
    transition: all 0.3s;
}

.resource-card--research-btn:hover {
    background: var(--grad-leaf);
    color: var(--white);
    border-color: var(--leaf);
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.25);
    transform: translateY(-1px);
}

/* ---- Locked Resource Gate ---- */
.resource-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #f8fdf9 0%, #f1f8f1 50%, #eff6ff 100%);
    border: 2px dashed #cde8d0;
    border-radius: 20px;
    padding: 52px 32px;
    position: relative;
    overflow: hidden;
}

.resource-locked::before {
    content: "";
    position: absolute;
    top: -60px;
    left: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 125, 50, 0.06) 0%, transparent 70%);
}

.resource-locked::after {
    content: "";
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.06) 0%, transparent 70%);
}

.resource-locked-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--white);
    border: 2.5px solid #d4e8d7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 20px;
    box-shadow: 0 6px 24px rgba(46, 125, 50, 0.12);
    position: relative;
    z-index: 1;
}

.resource-locked h3 {
    color: var(--ink-dark);
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.resource-locked p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.85;
    max-width: 440px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.resource-locked-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.resource-locked-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
}

.resource-locked-login {
    background: var(--white);
    color: var(--leaf-dark);
    border: 2px solid var(--leaf);
}

.resource-locked-login:hover {
    background: var(--leaf-soft);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 55, 32, 0.12);
}

.resource-locked-register {
    background: var(--grad-leaf);
    color: var(--white);
    border: 2px solid transparent;
    box-shadow: 0 6px 18px rgba(30, 96, 40, 0.25);
}

.resource-locked-register:hover {
    background: var(--grad-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.28);
}

/* ---- Empty State ---- */
.resource-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 44px 24px;
    background: linear-gradient(135deg, #f8fdf9 0%, #f1f8f1 100%);
    border: 1.5px dashed #cde8d0;
    border-radius: 14px;
}

.resource-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--white);
    border: 1.5px solid #d4e8d7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.08);
}

.resource-empty h4 {
    color: var(--ink-dark);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.resource-empty p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    max-width: 380px;
}

.dept-missing { min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 60px 20px; }
.dept-missing-icon { font-size: 52px; }
.dept-missing h2 { color: var(--leaf-dark); font-size: 22px; }
.dept-missing p { color: var(--muted); max-width: 400px; }

/* ---- Resource Section Responsive ---- */
@media (max-width: 900px) {
    .resource-grid--videos {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .resource-grid--materials {
        grid-template-columns: 1fr;
    }
    .dept-resource-section {
        padding: 22px;
    }
    .resource-section-header {
        gap: 12px;
    }
    .resource-section-icon {
        width: 46px;
        height: 46px;
        min-width: 46px;
        font-size: 20px;
    }
    .resource-section-text h3 {
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    .resources-header {
        padding: 28px 18px;
    }
    .resources-header-icon {
        width: 52px;
        height: 52px;
        font-size: 24px;
        margin-bottom: 12px;
    }
    .resources-header-title {
        font-size: 18px;
    }
    .resources-header-subtitle {
        font-size: 12.5px;
    }
    .dept-resource-section {
        padding: 18px;
        border-radius: 12px;
    }
    .resource-section-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding-bottom: 14px;
    }
    .resource-section-text h3 {
        font-size: 15px;
    }
    .resource-section-text p {
        font-size: 12px;
    }
    .resource-grid--videos,
    .resource-grid--materials {
        grid-template-columns: 1fr;
    }
    .resource-card--video-body {
        padding: 14px;
    }
    .resource-card--video-title {
        font-size: 14px;
    }
    .resource-card--video-desc {
        font-size: 12px;
    }
    .resource-card--material {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }
    .resource-card--material-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }
    .resource-card--research {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }
    .resource-locked {
        padding: 36px 20px;
    }
    .resource-locked-icon {
        width: 68px;
        height: 68px;
        font-size: 30px;
    }
    .resource-locked h3 {
        font-size: 17px;
    }
    .resource-locked p {
        font-size: 13px;
    }
    .resource-locked-actions {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }
    .resource-locked-btn {
        width: 100%;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .resource-grid--videos {
        grid-template-columns: 1fr;
    }
    .resource-card--video-body { padding: 12px; }
    .resource-card--video-title { font-size: 13px; }
    .resource-card--video-desc { font-size: 11.5px; }
    .resource-card--material { padding: 12px; gap: 10px; }
    .resource-card--material-icon { width: 44px; height: 44px; min-width: 44px; font-size: 22px; }
    .resource-card--material-title { font-size: 13px; }
    .resource-card--material-desc { font-size: 11.5px; }
    .resource-card--research { padding: 12px; gap: 10px; }
    .resource-card--research-icon { width: 40px; height: 40px; min-width: 40px; font-size: 18px; }
    .resource-card--research-title { font-size: 13px; }
    .resource-card--research-desc { font-size: 11.5px; }
    .resource-locked { padding: 24px 14px; }
    .resource-locked-icon { width: 52px; height: 52px; font-size: 24px; margin-bottom: 14px; }
    .resource-locked h3 { font-size: 15px; margin-bottom: 8px; }
    .resource-locked p { font-size: 11.5px; margin-bottom: 20px; }
    .resource-locked-actions { max-width: 100%; }
    .resource-locked-btn { padding: 11px 16px; font-size: 13px; }
    .resources-header { padding: 20px 14px; }
    .resources-header-icon { width: 48px; height: 48px; font-size: 22px; margin-bottom: 10px; }
    .resources-header-title { font-size: 16px; }
    .resources-header-subtitle { font-size: 12px; }
    .dept-resource-section { padding: 12px; border-radius: 8px; }
    .resource-section-icon { width: 40px; height: 40px; min-width: 40px; font-size: 18px; border-radius: 10px; }
    .resource-section-text h3 { font-size: 14px; }
    .resource-section-text p { font-size: 11px; }
    .dept-missing { min-height: 300px; padding: 40px 16px; }
    .dept-missing h2 { font-size: 18px; }
    .dept-missing p { font-size: 12px; }
}

/* ========================================
   REVEAL-ON-SCROLL ANIMATION
   ======================================== */

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .reveal, .department-card { animation: none; transition: none; opacity: 1; transform: none; }
}
