/* ============================================================
   JAMIA GULSHAN-E-BARKAAT — 2026 DESIGN SYSTEM
   All phases of TODO.md implemented here
   ============================================================ */

/* ── PHASE 1: HSL Design Tokens ─────────────────────────────── */
:root {
    /* Green Scale */
    --green-900: hsl(152, 65%, 12%);
    --green-800: hsl(152, 62%, 17%);
    --green-700: hsl(152, 58%, 22%);
    --green-600: hsl(152, 55%, 28%);
    --green-500: hsl(152, 50%, 35%);
    --green-400: hsl(152, 44%, 45%);

    /* Gold Scale */
    --gold-600: hsl(45, 75%, 42%);
    --gold-500: hsl(45, 78%, 52%);
    --gold-400: hsl(45, 85%, 62%);
    --gold-glow: hsl(45, 95%, 70%);

    /* Semantic Aliases (backward-compatible) */
    --primary-green: var(--green-500);
    --dark-green: var(--green-900);
    --green-primary: var(--green-800);
    --gold: var(--gold-500);
    --gold-accent: var(--gold-500);

    /* Neutral */
    --bg-light: hsl(210, 17%, 98%);
    --text-primary: hsl(220, 14%, 18%);
    --text-muted: hsl(220, 9%, 46%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: 20px;

    /* Shadows — Layered System */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 75, 35, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 75, 35, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08), 0 20px 60px rgba(0, 75, 35, 0.10);
    --shadow-xl: 0 15px 50px rgba(0, 0, 0, 0.10), 0 35px 80px rgba(0, 75, 35, 0.14);

    /* Gold Glow Shadow */
    --shadow-gold-sm: 0 0 0 1px var(--gold-500), 0 8px 25px rgba(212, 175, 55, 0.15);
    --shadow-gold-lg: 0 0 0 2px var(--gold-400), 0 15px 50px rgba(212, 175, 55, 0.25);

    /* Transitions */
    --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 180ms;
    --dur-med: 320ms;
    --dur-slow: 500ms;
}

/* ── PHASE 9: Dark Mode Foundation ──────────────────────────── */
[data-theme="dark"] {
    --bg-light: hsl(152, 20%, 8%);
    --text-primary: hsl(60, 9%, 92%);
    --text-muted: hsl(60, 5%, 65%);
    --glass-bg: rgba(0, 40, 20, 0.55);
    --glass-border: rgba(212, 175, 55, 0.12);
}

/* ── BASE RESET ──────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    cursor: none;
    /* Custom cursor — Phase 8 */
    transition: background-color var(--dur-med) ease, color var(--dur-med) ease;
}

/* ── PHASE 8: Custom Gold Cursor ─────────────────────────────── */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--gold-500);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    transition: transform 0.1s ease, opacity 0.2s ease;
    transform: translate(-50%, -50%);
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 2px solid var(--gold-500);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.25s var(--ease-out),
        height 0.25s var(--ease-out),
        border-color 0.25s ease,
        opacity 0.25s ease;
    opacity: 0.6;
}

.cursor-ring.is-hovered {
    width: 56px;
    height: 56px;
    border-color: var(--gold-glow);
    opacity: 0.9;
    background: rgba(212, 175, 55, 0.08);
}

/* Restore default cursor inside iframes & select menus */
select,
iframe {
    cursor: auto;
}

/* ── FONT UTILITIES ──────────────────────────────────────────── */
.font-amiri {
    font-family: 'Amiri', serif;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* ── COLOUR UTILITIES ────────────────────────────────────────── */
.bg-green {
    background-color: hsl(152, 50%, 35%) !important;
}

.bg-dark-green {
    background-color: var(--green-900) !important;
}

.text-green {
    color: var(--primary-green) !important;
}

.text-gold {
    color: var(--gold-500) !important;
}

.text-dark-green {
    color: var(--green-800) !important;
}

.text-light-alpha {
    color: rgba(255, 255, 255, 0.72);
}

.bg-light-alpha {
    background-color: rgba(255, 255, 255, 0.08);
}

.border-gold {
    border-color: var(--gold-500) !important;
}

/* ── PHASE 1: GLASSMORPHISM UTILITY ─────────────────────────── */
.glass {
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.glass-card {
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.12);
    box-shadow: var(--shadow-md);
}

/* ── NAVBAR ──────────────────────────────────────────────────── */
/* Glassmorphism navbar on scroll (Phase 1) */
.navbar {
    transition: background var(--dur-med) ease,
        box-shadow var(--dur-med) ease,
        backdrop-filter var(--dur-med) ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08) !important;
}

.custom-nav-link {
    position: relative;
    padding-bottom: 5px;
    transition: color var(--dur-fast) ease;
}

.custom-nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--gold-500);
    transition: width var(--dur-med) var(--ease-out),
        left var(--dur-med) var(--ease-out);
}

.custom-nav-link:hover::after {
    width: 100%;
    left: 0;
}

.custom-nav-link:hover {
    color: var(--green-600) !important;
}

/* ── PHASE 2: HOVER LIFT — now with layered shadow ───────────── */
.hover-lift {
    transition: transform var(--dur-med) var(--ease-spring),
        box-shadow var(--dur-med) ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg) !important;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%) !important;
    border-color: var(--gold-500) !important;
    position: relative;
    overflow: hidden;
    transition: transform var(--dur-med) var(--ease-spring),
        box-shadow var(--dur-med) ease,
        filter var(--dur-med) ease;
}

.btn-gold:hover {
    filter: brightness(1.08);
    box-shadow: var(--shadow-gold-sm) !important;
    transform: translateY(-2px);
}

.btn-outline-gold {
    color: var(--gold-500) !important;
    border-color: var(--gold-500) !important;
    position: relative;
    overflow: hidden;
    transition: all var(--dur-med) ease;
}

.btn-outline-gold:hover {
    background-color: var(--gold-500) !important;
    color: white !important;
    box-shadow: var(--shadow-gold-sm);
}

/* Phase 8: Ripple effect on buttons */
.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.55s linear;
    background-color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── FOOTER HOVER ────────────────────────────────────────────── */
.hover-white:hover {
    color: #ffffff !important;
    transition: color var(--dur-fast) ease;
}

.placeholder-white::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ── PHASE 7: SCROLL REVEAL BASE (JS drives class) ──────────── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity var(--dur-slow) var(--ease-out),
        transform var(--dur-slow) var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-28px);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.reveal-right {
    opacity: 0;
    transform: translateX(28px);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    transform: translate(0);
}

/* Stagger helpers */
.reveal-d1 {
    transition-delay: 80ms;
}

.reveal-d2 {
    transition-delay: 160ms;
}

.reveal-d3 {
    transition-delay: 240ms;
}

.reveal-d4 {
    transition-delay: 320ms;
}

/* ── SECTION PADDING ─────────────────────────────────────────── */
.section-padding {
    padding: 90px 0;
}

/* ── ISLAMIC DIVIDER ─────────────────────────────────────────── */
.islamic-divider {
    width: 150px;
    height: 3px;
    background: var(--gold-500);
    margin: 20px auto;
    position: relative;
}

.islamic-divider::after {
    content: '❖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0 10px;
    background: inherit;
    /* Set per-section via specificity */
    color: var(--green-primary);
    font-size: 1.2rem;
}

.bg-white .islamic-divider::after {
    background: #ffffff;
}

.bg-light .islamic-divider::after {
    background: hsl(210, 17%, 98%);
}

.bg-dark-green .islamic-divider::after {
    background: var(--green-900);
    color: var(--gold-500);
}

[data-theme="dark"] .islamic-divider::after {
    background: var(--bg-light);
}

/* ── PAGE HERO BANNER (All inner pages) ─────────────────────── */
.page-hero {
    background: linear-gradient(155deg, var(--green-900) 0%, var(--green-700) 100%);
    background-image:
        radial-gradient(circle at 15% 40%, rgba(212, 175, 55, 0.18), transparent 40%),
        radial-gradient(circle at 85% 60%, rgba(0, 75, 35, 0.35), transparent 50%),
        url('https://www.transparenttextures.com/patterns/arabesque.png');
    padding: 90px 0 70px;
    text-align: center;
    color: white;
    border-bottom: 4px solid var(--gold-500);
    position: relative;
    overflow: hidden;
}

/* ── PHASE 2: 3D HOVER CARDS (Global upgrade) ───────────────── */
/* Applied to card-islamic, belief-card, faculty-card etc */
.card-3d {
    transition:
        transform var(--dur-med) var(--ease-spring),
        box-shadow var(--dur-med) ease;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(4deg) translateY(-10px);
    box-shadow: var(--shadow-xl);
}

/* ── PHASE 4: GLOW BORDER on hover ──────────────────────────── */
.glow-border:hover {
    box-shadow: var(--shadow-gold-sm);
    border-color: var(--gold-500) !important;
}

/* ── PHASE 6: FLOATING LABEL FORMS ──────────────────────────── */
.form-float {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-float input,
.form-float textarea,
.form-float select {
    background: hsl(210, 17%, 98%);
    border: 1.5px solid hsl(220, 13%, 88%);
    padding: 20px 16px 8px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color var(--dur-med) ease, box-shadow var(--dur-med) ease, background var(--dur-med) ease;
    width: 100%;
}

.form-float label {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    transition: top var(--dur-fast) ease, font-size var(--dur-fast) ease, color var(--dur-fast) ease;
}

.form-float input:focus,
.form-float textarea:focus,
.form-float select:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
    background: #fff;
    outline: none;
}

.form-float input:focus+label,
.form-float input:not(:placeholder-shown)+label,
.form-float textarea:focus+label,
.form-float textarea:not(:placeholder-shown)+label {
    top: 6px;
    font-size: 0.72rem;
    color: var(--green-700);
}

/* Backward-compat: old .custom-input still works */
.custom-input {
    background-color: hsl(210, 17%, 98%);
    border: 1.5px solid hsl(220, 13%, 88%);
    padding: 14px 18px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    transition: border-color var(--dur-med) ease, box-shadow var(--dur-med) ease, background var(--dur-med) ease;
}

.custom-input:focus {
    background-color: #fff;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

/* file upload */
.custom-file-upload {
    border: 2px dashed hsl(220, 13%, 80%);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    background: hsl(210, 17%, 98%);
    cursor: pointer;
    transition: border-color var(--dur-med) ease, background var(--dur-med) ease;
}

.custom-file-upload:hover {
    border-color: var(--gold-500);
    background: rgba(212, 175, 55, 0.04);
}

.custom-file-upload input[type="file"] {
    display: none;
}

/* ── PHASE 6: FORM SUCCESS ANIMATION ────────────────────────── */
.success-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    border-radius: inherit;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.success-overlay.show {
    display: flex;
    animation: fadeIn var(--dur-med) ease;
}

.checkmark-svg {
    animation: checkPop 0.5s var(--ease-spring);
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── PHASE 5: RAMADAN PROGRESS BAR ANIMATED ─────────────────── */
.progress-wrapper {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    height: 28px;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.4);
    margin: 16px 0;
}

.progress-fill {
    background: linear-gradient(90deg, var(--gold-600), var(--gold-400), var(--gold-glow));
    height: 100%;
    width: 0;
    /* Starts at 0, JS animates on scroll */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--green-900);
    border-radius: 50px;
    transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    animation: shimmer 2.2s infinite;
}

@keyframes shimmer {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(200%);
    }
}

/* ── PHASE 5: CRESCENT MOON GLOW ────────────────────────────── */
.moon-glow {
    filter: drop-shadow(0 0 14px var(--gold-glow)) drop-shadow(0 0 30px var(--gold-500));
    animation: moonPulse 4s ease-in-out infinite;
}

@keyframes moonPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 10px var(--gold-500));
    }

    50% {
        filter: drop-shadow(0 0 24px var(--gold-glow)) drop-shadow(0 0 50px rgba(212, 175, 55, 0.35));
    }
}

/* ── PHASE 3: FLOATING GOLD SHAPES ──────────────────────────── */
.floating-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.float-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 70%);
    animation: floatY var(--duration, 7s) ease-in-out infinite alternate;
}

@keyframes floatY {
    from {
        transform: translateY(0) scale(1);
    }

    to {
        transform: translateY(-30px) scale(1.06);
    }
}

/* ── PHASE 7: FLUID TYPOGRAPHY ──────────────────────────────── */
.hero-title {
    font-size: clamp(1.9rem, 5.5vw, 3.5rem);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

/* ── PHASE 8: PAGE FADE TRANSITION ──────────────────────────── */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--green-900);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-transition-overlay.fade-in {
    opacity: 1;
    pointer-events: all;
}

.page-transition-overlay.fade-out {
    opacity: 0;
}

/* ── PHASE 9: prefers-reduced-motion ────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }
}

/* ── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .section-padding {
        padding: 60px 0;
    }

    /* Restore default cursor on touch devices */
    .cursor-dot,
    .cursor-ring {
        display: none;
    }

    body {
        cursor: auto;
    }

    /* Larger tap targets */
    .btn {
        min-height: 48px;
    }
}

/* ── DARK MODE TOGGLE BUTTON ─────────────────────────────────── */
.dark-toggle {
    width: 42px;
    height: 22px;
    background: rgba(212, 175, 55, 0.25);
    border: 1.5px solid var(--gold-500);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: background var(--dur-fast) ease;
}

.dark-toggle::after {
    content: '';
    width: 16px;
    height: 16px;
    background: var(--gold-500);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--dur-med) var(--ease-spring);
}

[data-theme="dark"] .dark-toggle {
    background: rgba(212, 175, 55, 0.6);
}

[data-theme="dark"] .dark-toggle::after {
    transform: translateX(20px);
}

/* ── MISC UTILITIES ──────────────────────────────────────────── */
.letter-spacing-1 {
    letter-spacing: 0.08em;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── FOUNDER SECTION ─────────────────────────────────────────── */
.founder-section {
    max-width: 900px;
}

.founder-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 18px;
    padding: 40px;
    position: relative;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.25);
    overflow: hidden;
}

/* gold accent line */
.founder-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #d4af37, #f5d76e);
}

.founder-header {
    margin-bottom: 20px;
}

.founder-header h2 {
    font-family: "Amiri", serif;
    font-size: 2rem;
    color: #004B23;
    margin-bottom: 5px;
}

.founder-title {
    color: #d4af37;
    font-weight: 600;
    letter-spacing: .08em;
}

.founder-bio {
    line-height: 1.9;
    font-size: 1.05rem;
    color: #444;
    text-align: justify;
}

/* hover effect */
.founder-card:hover {
    transform: translateY(-6px);
    transition: .4s ease;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(212, 175, 55, 0.4);
}

/* responsive */
@media (max-width: 768px) {
    .founder-card {
        padding: 25px;
    }

    .founder-header h2 {
        font-size: 1.6rem;
    }

    .founder-bio {
        font-size: 0.98rem;
    }
}