/* ========================================
   AfriHope Foundation - Custom Styles
   Theme system powered by CSS custom properties
   ======================================== */

/* ---------- Design tokens (Light theme) ---------- */
:root {
    /* Brand */
    --primary: #0d7a4f;
    --primary-dark: #065a3a;
    --primary-light: #1a9b68;
    --primary-rgb: 13, 122, 79;
    --secondary: #e8a317;
    --secondary-dark: #c4860f;
    --secondary-rgb: 232, 163, 23;
    --accent: #c44536;

    /* Surfaces */
    --bg-body: #faf6f1;
    --bg-surface: #ffffff;
    --bg-surface-alt: #ffffff;
    --bg-muted: #f8f5f0;
    --bg-topbar: #1a1a2e;
    --bg-navbar: var(--primary);
    --bg-footer: #1a1a2e;
    --bg-stats: var(--primary);
    --bg-cta: linear-gradient(135deg, var(--primary-dark), var(--primary));
    --bg-page-header: linear-gradient(135deg, var(--primary), var(--primary-dark));
    --bg-impact: linear-gradient(135deg, var(--primary), var(--primary-dark));
    --bg-contact-box: var(--primary);
    --bg-overlay-soft: rgba(var(--primary-rgb), 0.1);
    --bg-overlay-softer: rgba(var(--primary-rgb), 0.08);

    /* Text */
    --text: #2d2d2d;
    --text-heading: #1a1a2e;
    --text-muted: #6c757d;
    --text-on-primary: #ffffff;
    --text-on-dark: #ffffff;
    --text-on-dark-muted: rgba(255, 255, 255, 0.7);
    --text-on-dark-soft: rgba(255, 255, 255, 0.85);
    --text-on-dark-faint: rgba(255, 255, 255, 0.9);
    --text-link-hover: var(--secondary);

    /* Borders & inputs */
    --border-color: #e0e0e0;
    --border-color-strong: #d0d0d0;
    --input-bg: #ffffff;
    --input-border: #e0e0e0;
    --input-focus-ring: rgba(var(--primary-rgb), 0.15);

    /* Effects */
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
    --shadow-nav: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-donate: 0 5px 20px rgba(var(--secondary-rgb), 0.4);
    --gradient-hero: linear-gradient(135deg, rgba(var(--primary-rgb), 0.85), rgba(26, 26, 46, 0.75));
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 50px;
    --transition: all 0.3s ease;
    --transition-theme: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;

    /* Component-specific */
    --badge-bg: var(--bg-overlay-soft);
    --feature-icon-bg: var(--bg-overlay-soft);
    --alert-info-bg: var(--bg-overlay-softer);
    --alert-info-border: var(--primary);
    --carousel-dot: rgba(255, 255, 255, 0.5);
    --social-btn-bg: rgba(255, 255, 255, 0.1);
    --theme-toggle-bg: rgba(255, 255, 255, 0.1);
    --theme-toggle-border: rgba(255, 255, 255, 0.3);
}

/* ---------- Dark theme tokens ---------- */
[data-theme="dark"] {
    --primary: #1a9b68;
    --primary-dark: #0d7a4f;
    --primary-light: #2db87a;
    --primary-rgb: 26, 155, 104;
    --secondary: #f0b429;
    --secondary-dark: #e8a317;
    --secondary-rgb: 240, 180, 41;
    --accent: #e05a4a;

    --bg-body: #12121f;
    --bg-surface: #1e1e30;
    --bg-surface-alt: #1a1a2e;
    --bg-muted: #1a1a2e;
    --bg-topbar: #0d0d18;
    --bg-navbar: #0d7a4f;
    --bg-footer: #0d0d18;
    --bg-stats: #0d7a4f;
    --bg-cta: linear-gradient(135deg, #065a3a, #0d7a4f);
    --bg-page-header: linear-gradient(135deg, #0d7a4f, #065a3a);
    --bg-impact: linear-gradient(135deg, #0d7a4f, #065a3a);
    --bg-contact-box: #0d7a4f;
    --bg-overlay-soft: rgba(var(--primary-rgb), 0.2);
    --bg-overlay-softer: rgba(var(--primary-rgb), 0.15);

    --text: #e0ddd8;
    --text-heading: #f0ede8;
    --text-muted: #a0a0b0;
    --text-on-primary: #ffffff;
    --text-on-dark: #ffffff;
    --text-on-dark-muted: rgba(255, 255, 255, 0.7);
    --text-on-dark-soft: rgba(255, 255, 255, 0.85);
    --text-on-dark-faint: rgba(255, 255, 255, 0.9);

    --border-color: #2a2a40;
    --border-color-strong: #3a3a55;
    --input-bg: #252538;
    --input-border: #3a3a55;
    --input-focus-ring: rgba(var(--primary-rgb), 0.25);

    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.5);
    --shadow-nav: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-donate: 0 5px 20px rgba(var(--secondary-rgb), 0.35);
    --gradient-hero: linear-gradient(135deg, rgba(var(--primary-rgb), 0.9), rgba(18, 18, 31, 0.85));

    --badge-bg: var(--bg-overlay-soft);
    --feature-icon-bg: var(--bg-overlay-soft);
    --alert-info-bg: var(--bg-overlay-softer);
    --alert-info-border: var(--primary);
}

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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background: var(--bg-body);
    line-height: 1.7;
    overflow-x: hidden;
    transition: var(--transition-theme);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--text-heading);
    transition: color 0.3s ease;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Top bar ---------- */
.top-bar {
    overflow: hidden;
    background: var(--bg-topbar);
    color: var(--text-on-dark-soft);
    font-size: 0.85rem;
    transition: var(--transition-theme);
}

.top-bar a {
    color: var(--text-on-dark-soft);
}

.top-bar a:hover {
    color: var(--secondary);
}

/* ---------- Navbar ---------- */
.main-nav {
    background: var(--bg-navbar) !important;
    box-shadow: var(--shadow-nav);
    padding: 0.6rem 0;
    transition: var(--transition-theme);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-primary);
    font-size: 1.2rem;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-on-primary);
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.65rem;
    color: var(--text-on-dark-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.main-nav .nav-link {
    color: var(--text-on-dark-faint) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: var(--secondary) !important;
}

.main-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--secondary);
}

/* Navbar dropdowns */
.main-nav .dropdown-menu {
    background: var(--bg-card, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.4rem 0;
    margin-top: 0.25rem;
}
.main-nav .dropdown-item {
    color: var(--text-body, #333);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
}
.main-nav .dropdown-item:hover,
.main-nav .dropdown-item:focus {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}
.main-nav .dropdown-item.active {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-weight: 600;
}
[data-theme="dark"] .main-nav .dropdown-menu {
    background: #1a1a2e;
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .main-nav .dropdown-item {
    color: #e0e0e0;
}
[data-theme="dark"] .main-nav .dropdown-item:hover,
[data-theme="dark"] .main-nav .dropdown-item:focus {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--secondary);
}
[data-theme="dark"] .main-nav .dropdown-item.active {
    background: rgba(var(--primary-rgb), 0.25);
    color: var(--secondary);
}
@media (max-width: 991.98px) {
    .main-nav .dropdown-menu {
        background: transparent;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
    }
    .main-nav .dropdown-item {
        color: var(--text-on-dark-faint) !important;
    }
    .main-nav .dropdown-item:hover,
    .main-nav .dropdown-item.active {
        color: var(--secondary) !important;
        background: transparent;
    }
}

.btn-donate {
    background: var(--secondary) !important;
    border: none !important;
    color: var(--text-on-primary) !important;
    font-weight: 600;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.btn-donate:hover {
    background: var(--secondary-dark) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-donate);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--theme-toggle-border);
    background: var(--theme-toggle-bg);
    color: var(--text-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    padding: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--secondary);
    color: var(--secondary);
    transform: rotate(20deg);
}

.theme-toggle .bi-sun-fill { display: none; }
.theme-toggle .bi-moon-stars-fill { display: inline-block; }

[data-theme="dark"] .theme-toggle .bi-sun-fill { display: inline-block; }
[data-theme="dark"] .theme-toggle .bi-moon-stars-fill { display: none; }

/* ---------- Hero slider ---------- */
.hero-slider {
    position: relative;
    height: 85vh;
    min-height: 500px;
    overflow: hidden;
}

.hero-slider .carousel-item {
    height: 85vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    /* Image painted on ::after for Ken Burns; keep bg on item as fallback */
}

/* Fade transition (Bootstrap carousel-fade) — smoother timing */
.hero-slider.carousel-fade .carousel-item {
    opacity: 0;
    transition-property: opacity;
    transition-duration: 1.1s;
    transition-timing-function: ease-in-out;
}
.hero-slider.carousel-fade .carousel-item.active,
.hero-slider.carousel-fade .carousel-item-next.carousel-item-start,
.hero-slider.carousel-fade .carousel-item-prev.carousel-item-end {
    opacity: 1;
}
.hero-slider.carousel-fade .active.carousel-item-start,
.hero-slider.carousel-fade .active.carousel-item-end {
    opacity: 0;
}

/* Slow zoom on active slide background */
.hero-slider .carousel-item::after {
    content: '';
    position: absolute;
    inset: -4%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transform: scale(1);
    transition: transform 8s ease-out;
    will-change: transform;
}
.hero-slider .carousel-item.active::after {
    transform: scale(1.08);
    animation: heroKenBurns 8s ease-out forwards;
}
@keyframes heroKenBurns {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}

.hero-slider .carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Content entrance when slide becomes active */
.hero-slider .carousel-item .hero-content .hero-badge,
.hero-slider .carousel-item .hero-content h1,
.hero-slider .carousel-item .hero-content p,
.hero-slider .carousel-item .hero-content .hero-btns {
    opacity: 0;
    transform: translateY(28px);
}
.hero-slider .carousel-item.active .hero-content .hero-badge,
.hero-slider .carousel-item.active .hero-content h1,
.hero-slider .carousel-item.active .hero-content p,
.hero-slider .carousel-item.active .hero-content .hero-btns {
    animation: heroFadeUp 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-slider .carousel-item.active .hero-content .hero-badge { animation-delay: 0.15s; }
.hero-slider .carousel-item.active .hero-content h1 { animation-delay: 0.3s; }
.hero-slider .carousel-item.active .hero-content p { animation-delay: 0.45s; }
.hero-slider .carousel-item.active .hero-content .hero-btns { animation-delay: 0.6s; }

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

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-slider.carousel-fade .carousel-item {
        transition-duration: 0.01ms;
    }
    .hero-slider .carousel-item.active::after {
        animation: none;
        transform: none;
    }
    .hero-slider .carousel-item .hero-content .hero-badge,
    .hero-slider .carousel-item .hero-content h1,
    .hero-slider .carousel-item .hero-content p,
    .hero-slider .carousel-item .hero-content .hero-btns {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--text-on-dark);
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--text-on-dark-faint);
    max-width: 600px;
    margin-bottom: 2rem;
}

.hero-btns .btn {
    border-radius: var(--radius-pill);
    padding: 0.75rem 2rem;
    font-weight: 600;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
}

.btn-primary-custom {
    background: var(--secondary);
    border: 2px solid var(--secondary);
    color: var(--text-on-primary);
}

.btn-primary-custom:hover {
    background: transparent;
    border-color: var(--text-on-dark);
    color: var(--text-on-dark);
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--text-on-dark);
    color: var(--text-on-dark);
}

.btn-outline-custom:hover {
    background: var(--text-on-dark);
    color: var(--primary);
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--carousel-dot);
    border: none;
}

.carousel-indicators .active {
    background: var(--secondary);
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

/* ---------- Sections ---------- */
.section {
    padding: 5rem 0;
    transition: var(--transition-theme);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title .subtitle {
    display: inline-block;
    background: var(--badge-bg);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Surface helpers */
.bg-white,
.section.bg-white {
    background-color: var(--bg-surface-alt) !important;
    transition: var(--transition-theme);
}

/* ---------- Cards ---------- */
.card-custom {
    background: var(--bg-surface);
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.card-custom:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-custom .card-img-top {
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.card-custom:hover .card-img-top {
    transform: scale(1.05);
}

.card-custom .card-body {
    padding: 1.5rem;
}

.card-custom .card-title {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: var(--text-heading);
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.card-meta i {
    color: var(--primary);
}

.card {
    background-color: var(--bg-surface);
    color: var(--text);
    transition: var(--transition-theme);
}

/* ---------- Stats ---------- */
.stats-section {
    background: var(--bg-stats);
    color: var(--text-on-primary);
    padding: 4rem 0;
    transition: var(--transition-theme);
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
}

.stat-item .stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ---------- Feature boxes ---------- */
.feature-box {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    height: 100%;
    transition: var(--transition);
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--feature-icon-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
    color: var(--primary);
}

/* ---------- Donate ---------- */
.donate-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.amount-btn {
    border: 2px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 90px;
    text-align: center;
}

.amount-btn:hover,
.amount-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-on-primary);
}

.donate-form-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition-theme);
}

.impact-card {
    background: var(--bg-impact);
    color: var(--text-on-primary);
    border-radius: var(--radius);
    padding: 2rem;
    height: 100%;
}

.impact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.impact-item i {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-right: 1rem;
    margin-top: 0.2rem;
}

/* ---------- Report ---------- */
.report-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition-theme);
}

.alert-info-custom {
    background: var(--alert-info-bg);
    border-left: 4px solid var(--alert-info-border);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* ---------- Contact ---------- */
.contact-info-box {
    background: var(--bg-contact-box);
    color: var(--text-on-primary);
    border-radius: var(--radius);
    padding: 2.5rem;
    height: 100%;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-info-item i {
    font-size: 1.35rem;
    color: var(--secondary);
    margin-right: 1rem;
    width: 30px;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--bg-footer);
    color: var(--text-on-dark-soft);
    transition: var(--transition-theme);
}

.footer-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--text-on-dark);
}

.footer-heading {
    color: var(--text-on-dark);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--secondary);
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-on-dark-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.footer-contact li {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--social-btn-bg);
    border-radius: 50%;
    color: var(--text-on-dark);
    margin-right: 0.5rem;
    transition: var(--transition);
}

.social-btn:hover {
    background: var(--secondary);
    color: var(--text-on-primary);
    transform: translateY(-3px);
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ---------- Page header ---------- */
.page-header {
    background: var(--bg-page-header);
    padding: 4rem 0 3rem;
    color: var(--text-on-dark);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.05)"/><circle cx="80" cy="40" r="3" fill="rgba(255,255,255,0.05)"/><circle cx="40" cy="70" r="2" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.5;
}

.page-header h1 {
    color: var(--text-on-dark);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    position: relative;
}

.page-header .breadcrumb {
    justify-content: center;
    background: transparent;
    margin-bottom: 0;
    position: relative;
}

.page-header .breadcrumb-item a {
    color: var(--text-on-dark-muted);
}

.page-header .breadcrumb-item.active {
    color: var(--secondary);
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

/* ---------- Activity detail ---------- */
.activity-detail-img {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
}

.activity-detail-img img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    background: var(--input-bg);
    color: var(--text);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.input-group-text {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.form-check-label {
    color: var(--text);
}

.form-text {
    color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.75rem;
    font-weight: 600;
    color: var(--text-on-primary);
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--text-on-primary);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--text-on-primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-warning:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: var(--text-on-primary);
}

.btn-outline-success {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-success:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-on-primary);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--bg-muted);
    color: var(--text);
    border-color: var(--border-color-strong);
}

.btn-outline-light {
    color: var(--text-on-dark);
    border-color: var(--text-on-dark);
}

.btn-outline-light:hover {
    background: var(--text-on-dark);
    color: var(--primary);
}

/* ---------- CTA ---------- */
.cta-section {
    background: var(--bg-cta);
    padding: 4rem 0;
    color: var(--text-on-primary);
    text-align: center;
}

.cta-section h2 {
    color: var(--text-on-primary);
    margin-bottom: 1rem;
}

/* ---------- Image overlay cards ---------- */
.img-overlay-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 280px;
}

.img-overlay-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.img-overlay-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    color: var(--text-on-dark);
}

.img-overlay-card .overlay h5 {
    color: var(--text-on-dark);
    margin-bottom: 0.25rem;
}

/* ---------- Badge ---------- */
.badge-custom {
    background: var(--badge-bg);
    color: var(--primary);
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
}

/* ---------- Utility text ---------- */
.text-muted {
    color: var(--text-muted) !important;
}

.lead {
    color: var(--text);
}

.content {
    color: var(--text);
}

hr {
    border-color: var(--border-color);
    opacity: 1;
}

/* ---------- Bootstrap overrides for theme ---------- */
[data-theme="dark"] .table {
    color: var(--text);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: var(--text);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .alert-success {
    background-color: rgba(26, 155, 104, 0.2);
    border-color: var(--primary);
    color: var(--text);
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(196, 69, 54, 0.2);
    border-color: var(--accent);
    color: var(--text);
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(240, 180, 41, 0.15);
    border-color: var(--secondary);
    color: var(--text);
}

[data-theme="dark"] .alert-info {
    background-color: rgba(26, 155, 104, 0.15);
    border-color: var(--primary);
    color: var(--text);
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .hero-slider,
    .hero-slider .carousel-item {
        height: 70vh;
        min-height: 450px;
    }

    .brand-tagline {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .hero-slider,
    .hero-slider .carousel-item {
        height: 60vh;
        min-height: 400px;
    }

    .section {
        padding: 3.5rem 0;
    }

    .stat-item .stat-number {
        font-size: 2.2rem;
    }

    .donate-form-card,
    .report-card {
        padding: 1.5rem;
    }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ========== IMPROVED TEMPLATE COMPONENTS ========== */

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 9999;
    border-radius: var(--radius-sm);
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0.5rem;
}

/* Top bar extras */
.top-social {
    color: var(--text-on-dark-soft);
    margin-left: 0.6rem;
    font-size: 0.95rem;
}
.top-social:hover { color: var(--secondary); }
.top-report-link {
    color: var(--secondary) !important;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}
.top-report-link:hover { opacity: 0.85; }

/* Hero badge */
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255,255,255,0.25);
}

/* Section alternate bg */
.section-alt {
    background: var(--bg-muted);
}

/* About image grid */
.about-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    position: relative;
}
.about-img {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.about-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.about-img:hover img { transform: scale(1.06); }
.about-img-2, .about-img-4 { margin-top: 1.25rem; }
.about-img-badge {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-hover);
    z-index: 2;
}
.about-img-badge .badge-years {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}
.about-img-badge .badge-text {
    font-size: 0.7rem;
    opacity: 0.9;
}

.mini-feature {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.mini-feature i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 0.15rem;
}
.mini-feature h6 { color: var(--text-heading); }

/* Feature link */
.feature-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}
.feature-link:hover {
    color: var(--primary-dark);
    gap: 0.5rem;
}

/* Process steps */
.process-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    height: 100%;
    border-top: 3px solid var(--primary);
    transition: var(--transition);
}
.process-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.process-num {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.35;
    line-height: 1;
    margin-bottom: 0.75rem;
}
.process-card h5 { color: var(--text-heading); }

/* Card image wrap */
.card-img-wrap {
    position: relative;
    overflow: hidden;
}
.card-date-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
}

/* Testimonials */
.testimonials-section {
    background: var(--bg-body);
}
.testimonial-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    height: 100%;
    transition: var(--transition);
}
.testimonial-card:hover {
    box-shadow: var(--shadow-hover);
}
.testimonial-quote {
    font-size: 2rem;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: 0.75rem;
}
.testimonial-text {
    font-style: italic;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.testimonial-author img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.testimonial-author strong {
    display: block;
    color: var(--text-heading);
    font-size: 0.95rem;
}
.testimonial-author span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Action cards */
.action-card {
    border-radius: var(--radius);
    padding: 2.5rem;
    height: 100%;
    color: #fff;
}
.action-card-donate {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.action-card-report {
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
}
.action-card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}
.action-card h3 {
    color: #fff;
    margin-bottom: 0.75rem;
}
.action-card p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* About page extras */
.about-hero-img {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
}
.about-hero-img img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}
.about-hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    padding: 2rem 1.5rem 1.25rem;
    font-size: 0.9rem;
}
.about-stat-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.about-stat-pill strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--primary);
    line-height: 1.2;
}
.about-stat-pill span {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.values-list {
    list-style: none;
    padding: 0;
}
.values-list li {
    padding: 0.35rem 0;
    padding-left: 1.25rem;
    position: relative;
}
.values-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 3px solid var(--primary);
    margin-left: 1rem;
}
.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.35rem;
    width: 14px;
    height: 14px;
    background: var(--secondary);
    border-radius: 50%;
    border: 3px solid var(--bg-body);
    transform: translateX(-50%);
    margin-left: 1.5px;
}
.timeline-year {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}
.timeline-content h5 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

/* Footer newsletter */
.footer-newsletter {
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
}
.newsletter-form .form-control {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.newsletter-form .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}
.newsletter-form .form-control:focus {
    background: rgba(255,255,255,0.15);
    border-color: var(--secondary);
    color: #fff;
    box-shadow: none;
}
.footer-about { color: rgba(255,255,255,0.7); }
.footer-focus li { color: rgba(255,255,255,0.75); font-size: 0.9rem; margin-bottom: 0.4rem; }
.footer-focus i { color: var(--secondary); }
.footer-contact a { color: rgba(255,255,255,0.8); }
.footer-contact a:hover { color: var(--secondary); }
.footer-copy { color: rgba(255,255,255,0.55); }

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 1050;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Empty state */
.empty-state i { opacity: 0.4; }

/* Stat icon */
.stat-icon {
    font-size: 1.25rem;
    opacity: 0.7;
    margin-bottom: 0.35rem;
}

/* Navbar scrolled effect */
.main-nav.scrolled {
    box-shadow: 0 6px 30px rgba(0,0,0,0.2);
}

@media (max-width: 767.98px) {
    .about-img img { height: 120px; }
    .about-hero-img img { height: 260px; }
    .timeline { margin-left: 0.5rem; }
}


/* Uploaded site logo in navbar */
.site-logo {
    height: 42px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}
.navbar-brand .site-logo {
    border-radius: 6px;
}

/* Compact donate impact card */
.impact-card.impact-card-compact {
    padding: 1.25rem 1.35rem;
}
.impact-card-compact h4 {
    font-size: 1.1rem;
    margin-bottom: 0.85rem !important;
}
.impact-card-compact .impact-item {
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
}
.impact-card-compact .impact-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}
.impact-card-compact .impact-item i {
    font-size: 1.15rem;
    width: 2rem;
}
.impact-card-compact .impact-item p {
    font-size: 0.8rem;
    line-height: 1.35;
}


/* Top bar contact row — single line on desktop */
.top-bar .top-bar-info {
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.8125rem;
}
.top-bar .top-bar-item {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}
.top-bar .top-bar-item.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 1199.98px) {
    .top-bar .top-bar-item.d-none.d-xl-inline {
        display: none !important;
    }
}
