/* ===========================================================
   TADABBUR ACADEMY
   Palette: #E8F5E9 · #A5D6A7 · #66BB6A · #1B5E20
   Fonts: Lora (heading), Open Sans (body), Noto Naskh Arabic
   =========================================================== */

/* ===== Light Theme ===== */
:root {
    --c1: #E8F5E9;
    --c2: #A5D6A7;
    --c3: #66BB6A;
    --c4: #1B5E20;

    --bg-main: #ffffff;
    --bg-alt: var(--c1);
    --bg-card: #ffffff;
    --text-heading: var(--c4);
    --text-body: #2e3d2f;
    --text-muted: #5a6e5b;
    --accent: var(--c4);
    --accent-light: var(--c3);
    --border: #c8e6c9;
    --shadow-sm: 0 2px 10px rgba(27,94,32,0.06);
    --shadow-md: 0 6px 24px rgba(27,94,32,0.09);
    --shadow-lg: 0 10px 36px rgba(27,94,32,0.13);
    --hero-grad-start: var(--c4);
    --hero-grad-end: var(--c3);
    --btn-bg: var(--c4);
    --btn-bg-hover: #144a18;
}

/* ===== Dark Theme ===== */
body.dark {
    --c1: #162416;
    --c2: #1e3a1e;
    --c3: #4caf50;
    --c4: #a5d6a7;

    --bg-main: #0f140f;
    --bg-alt: #162416;
    --bg-card: #1c291c;
    --text-heading: var(--c4);
    --text-body: #c5d8c6;
    --text-muted: #8aaa8b;
    --accent: var(--c4);
    --accent-light: var(--c3);
    --border: #2a4a2a;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.25);
    --shadow-md: 0 6px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 10px 36px rgba(0,0,0,0.4);
    --hero-grad-start: #0a1f0a;
    --hero-grad-end: #1a4a1a;
    --btn-bg: var(--c3);
    --btn-bg-hover: #66bb6a;
}

/* Flash prevention */
html.dark-early {
    background-color: #0f140f;
}
html.dark-early body {
    --bg-main: #0f140f;
    --bg-alt: #162416;
    --bg-card: #1c291c;
    --text-heading: #a5d6a7;
    --text-body: #c5d8c6;
}

/* ===== Global Transition ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.5s ease,
                color 0.5s ease,
                border-color 0.5s ease,
                box-shadow 0.5s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.8;
    font-size: 1.15rem;
    -webkit-font-smoothing: antialiased;
}

.font-heading { font-family: 'Lora', serif; }
.font-arabic { font-family: 'Noto Naskh Arabic', serif; }

::selection {
    background: var(--accent-light);
    color: #fff;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.1rem 2rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
    letter-spacing: 0.03em;
}

.nav-menu {
    display: flex;
    gap: 2.2rem;
}

.nav-item {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nav-item:hover { color: var(--accent); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Theme Button */
.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.theme-btn svg { width: 20px; height: 20px; }

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.menu-toggle span {
    width: 24px;
    height: 2.5px;
    background: var(--text-heading);
    border-radius: 2px;
}

/* ===== Mobile Overlay ===== */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.mobile-link {
    font-size: 2rem;
    color: var(--text-heading);
    text-decoration: none;
}
.mobile-link:hover { color: var(--accent-light); }
.mobile-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 2.5rem;
    background: none;
    border: none;
    color: var(--text-heading);
    cursor: pointer;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 9rem 2rem 5rem;
    background: linear-gradient(155deg, var(--hero-grad-start) 0%, var(--hero-grad-end) 100%);
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect width='80' height='80' fill='none'/%3E%3Ccircle cx='40' cy='40' r='1.5' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E");
    pointer-events: none;
}
.hero-container {
    position: relative;
    z-index: 1;
    max-width: 1140px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3.5rem;
    align-items: center;
}
.hero-heading {
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 1.4rem;
    line-height: 1.15;
    font-weight: 700;
}
.hero-text {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
    margin-bottom: 2.2rem;
}
.hero-btns {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.hero-right {
    display: flex;
    justify-content: flex-end;
}

/* Ayah Card */
.ayah-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 2.8rem 2.2rem;
    text-align: right;
    max-width: 400px;
    width: 100%;
}
.ayah-card .ayah-text {
    font-size: 2.5rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.7;
}
.ayah-card .ayah-meaning {
    font-size: 1.15rem;
    font-weight: 550;
    font-style: italic;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.5rem;
}
.ayah-card .ayah-ref {
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
}

/* ===== Buttons ===== */
.btn-fill {
    display: inline-block;
    padding: 1rem 2.4rem;
    background: var(--btn-bg);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: transform 0.25s ease, box-shadow 0.3s ease, background-color 0.5s ease;
}
.btn-fill:hover {
    background: var(--btn-bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27,94,32,0.3);
}
.btn-ghost {
    display: inline-block;
    padding: 1rem 2.4rem;
    border: 2px solid rgba(255,255,255,0.55);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: transform 0.25s ease, border-color 0.3s ease, background-color 0.3s ease;
}
.btn-ghost:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* ===== Sections ===== */
.section { padding: 6rem 2rem; }
.section-main { background: var(--bg-main); }
.section-alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.section-container {
    max-width: 1140px;
    margin: 0 auto;
}
.section-heading {
    font-size: 2.6rem;
    color: var(--text-heading);
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.8rem;
}
.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 55px;
    height: 3px;
    background: var(--accent-light);
    border-radius: 2px;
}
.section-heading.centered {
    text-align: center;
}
.section-heading.centered::after {
    left: 50%;
    transform: translateX(-50%);
}
.text-center { text-align: center; }

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: start;
}
.about-bio {
    padding-right: 3rem;
    border-right: 1px solid var(--border);
}
.about-bio p {
    margin-bottom: 1.2rem;
    font-size: 1.15rem;
    color: var(--text-body);
    line-height: 1.85;
}
.about-bio strong { color: var(--text-heading); }

.about-quals {
    padding-left: 3rem;
}
.quals-title {
    font-size: 1.5rem;
    color: var(--text-heading);
    margin-bottom: 1.2rem;
    font-weight: 600;
}
.quals-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.quals-list li {
    font-size: 1.08rem;
    color: var(--text-body);
    padding: 0.7rem 1.1rem;
    background: var(--bg-card);
    border-left: 3px solid var(--accent-light);
    border-radius: 0 8px 8px 0;
    box-shadow: var(--shadow-sm);
}

/* ===== Cards (Courses & Achievements) ===== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.8rem;
    margin-top: 1rem;
}
.achieve-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.8rem;
    margin-top: 1.5rem;
}

/* Course Cards — left accent border style */
.course-card {
    display: flex;
    background: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.5s ease, background-color 0.5s ease, border-color 0.5s ease;
}
.course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.course-accent {
    width: 5px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--c4), var(--c3));
}
.course-body {
    padding: 2rem 2rem;
}

/* Achievement cards — top accent bar */
.card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.5s ease, background-color 0.5s ease, border-color 0.5s ease;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--c4), var(--c3));
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.card-center { text-align: center; }

.card-title {
    font-size: 1.5rem;
    color: var(--text-heading);
    margin-bottom: 0.7rem;
    font-weight: 600;
}
.card-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Tags (pill style for courses) */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    background: var(--c1);
    color: var(--c4);
    border: 1px solid var(--border);
}

/* Checkmark list (about qualifications) */
.card-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.card-list li {
    font-size: 1.05rem;
    color: var(--text-body);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.achieve-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
}

/* ===== CTA ===== */
.cta-section {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--c4);
    position: relative;
}
body.dark .cta-section {
    background: var(--hero-grad-start);
}
.cta-heading {
    font-size: 2.6rem;
    color: #fff;
    margin-bottom: 0.8rem;
    font-weight: 700;
}
.cta-text {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 2.2rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-main);
    border-top: 1px solid var(--border);
    padding: 3.5rem 2rem;
    text-align: center;
}
.footer-inner {
    max-width: 1140px;
    margin: 0 auto;
}
.footer-brand {
    font-size: 1.7rem;
    color: var(--text-heading);
    margin-bottom: 1.2rem;
    font-weight: 600;
}
.footer-line {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.footer-line a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-line a:hover { color: var(--accent-light); }
.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .menu-toggle { display: flex; }
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-btns { justify-content: center; }
    .hero-right { margin-top: 2rem; }
    .hero-heading { font-size: 2.6rem; }
    .about-grid { grid-template-columns: 1fr; }
    .about-bio { padding-right: 0; border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 2rem; margin-bottom: 2rem; }
    .about-quals { padding-left: 0; }
    .section-heading { font-size: 2.2rem; }
    .ayah-card .ayah-text { font-size: 1.9rem; }
}

@media (max-width: 480px) {
    .hero-heading { font-size: 2.1rem; }
    .hero-text { font-size: 1.1rem; }
    .hero-btns { flex-direction: column; }
    .btn-fill, .btn-ghost { width: 100%; text-align: center; }
    .section-heading { font-size: 1.9rem; }
    .cta-heading { font-size: 2.1rem; }
}
