/* ==========================================================================
   KDF Global UK - Custom Charity Website Stylesheet
   ========================================================================== */

/* --- Variables & Design Tokens --- */
:root {
    /* Color Palette */
    --color-primary: #1D3557;   /* Deep Navy */
    --color-primary-light: #457B9D;
    
    --color-accent: #E63946;    /* Warm Red/Orange Charity active color */
    
    --color-charcoal: #2B2D42;
    --color-gray: #8D99AE;
    --color-light: #F8F9FA;
    --color-white: #FFFFFF;
    
    /* Category Colors */
    --color-blue: #028090;
    --color-blue-light: #E0F2F1;
    
    --color-teal: #00A896;
    --color-teal-light: #E6F7F5;
    
    --color-yellow: #F4A261;
    --color-yellow-light: #FEF5EB;
    
    --color-green: #2A9D8F;
    --color-green-light: #E9F5F4;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Shadows & Radii */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Container Widths */
    --max-w-container: 1200px;
}

/* --- Base Reset & Typography --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    color: var(--color-charcoal);
    background-color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: var(--color-primary);
}

.display-1 { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 800; }
.display-2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; color: #4A5568; }
.lead { font-size: 1.25rem; font-weight: 300; line-height: 1.8; color: #4A5568; }
.text-muted { color: var(--color-gray); }

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: all var(--transition-fast);
}

ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Globals & Backgrounds --- */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    max-width: var(--max-w-container);
}

.section-padding { padding: 6rem 0; }
@media (max-width: 768px) { .section-padding { padding: 4rem 0; } }

.bg-light { background-color: var(--color-light); }
.bg-navy { background-color: var(--color-primary); }
.bg-charcoal { background-color: var(--color-charcoal); }

.text-white { color: var(--color-white); }
.text-white p, .text-white h1, .text-white h2, .text-white h3 { color: var(--color-white); }
.text-accent { color: var(--color-accent); }

/* --- Utility Classes --- */
.text-center { text-align: center; }
.max-w-m { max-width: 700px; }
.max-w-lg { max-width: 900px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 3rem; }

/* Grid Utilities */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }

/* Category Tags */
.category-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    z-index: 2;
}
.bg-teal { background: var(--color-teal); }
.bg-yellow { background: var(--color-yellow); }
.bg-blue { background: var(--color-blue); }

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--color-accent);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Subtitle for Sections */
.subtitle {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--color-primary-light);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    font-weight: 500;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-base);
    text-align: center;
}

.btn-lg { padding: 1.2rem 2.5rem; font-size: 1.1rem; }
.btn-sm { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
.btn-md { padding: 1rem 2rem; }
.btn-block { width: 100%; }

.btn-primary { background-color: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-primary:hover { background-color: var(--color-charcoal); border-color: var(--color-charcoal); color: white; }

.btn-accent { background-color: var(--color-accent); color: white; border-color: var(--color-accent); box-shadow: var(--shadow-md); }
.btn-accent:hover { background-color: #d62828; border-color: #d62828; color: white; transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.btn-outline-light { background: transparent; color: white; border-color: white; border-width: 2px; }
.btn-outline-light:hover { background: white; color: var(--color-primary); }

.btn-outline-primary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline-primary:hover { background: var(--color-primary); color: white; }

.text-link { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--color-primary-light); }
.text-link:hover { gap: 0.8rem; color: var(--color-primary); }

/* Hover effects */
.hover-rise:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all var(--transition-base);
    background: transparent;
}

.navbar.scrolled {
    background: var(--color-white);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar.scrolled .logo, .navbar.scrolled .nav-links a, .navbar.scrolled .mobile-menu-btn i {
    color: var(--color-primary);
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}
.logo-text { font-weight: 800; }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition-base);
}

.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--color-primary); cursor: pointer; }

/* Mobile Navigation Setup */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--color-white);
    z-index: 1001;
    padding: 4rem 2rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right var(--transition-base);
}
.mobile-nav.open { right: 0; }

.close-menu-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-charcoal);
    cursor: pointer;
}
.mobile-links { display: flex; flex-direction: column; gap: 1.5rem; }
.mobile-links a { font-size: 1.2rem; font-weight: 500; color: var(--color-primary); }

@media (max-width: 992px) {
    .nav-links { display: none; }
    .nav-actions .btn { display: none; }
    .mobile-menu-btn { display: block; }
}

/* --- Hero Section (Split Layout) --- */
.hero-split {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    background-color: var(--color-light);
    overflow: hidden;
}

.hero-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    max-width: 600px;
    z-index: 2;
}

.hero-text .display-1 {
    color: var(--color-primary);
}

.hero-text .lead {
    color: var(--color-charcoal);
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}

.hero-actions { 
    display: flex; 
    gap: 1rem; 
    flex-wrap: wrap; 
}

.hero-visual {
    position: relative;
    z-index: 2;
    transform: translateX(20px);
}

.modern-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    border-top-left-radius: 100px;
    border-bottom-right-radius: 100px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.main-hero-img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 10s ease;
}

.modern-image-wrapper:hover .main-hero-img {
    transform: scale(1.05);
}

/* Decorative background elements */
.hero-split::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: var(--color-teal-light);
    border-radius: 50%;
    z-index: 1;
    filter: blur(80px);
}

.decorative-dots {
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 150px;
    height: 150px;
    background-image: radial-gradient(var(--color-primary-light) 2px, transparent 2px);
    background-size: 15px 15px;
    z-index: -1;
}

@media (max-width: 992px) {
    .hero-split-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .hero-text {
        margin: 0 auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-visual {
        transform: translateX(0);
        margin-top: 2rem;
    }
    .main-hero-img {
        height: 400px;
    }
}

/* --- Stats Section --- */
.stats-section { padding: 4rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; text-align: center; }
.stat-number { font-size: 3.5rem; font-weight: 800; color: var(--color-accent); line-height: 1; margin-bottom: 0.5rem; font-family: var(--font-heading); }
.stat-label { font-size: 1.1rem; font-weight: 500; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 1px; }

/* --- Urgent Campaign --- */
.campaign-box {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    margin-top: -3rem;
    z-index: 5;
}

.badge-danger { position: absolute; top: 1.5rem; left: 1.5rem; z-index: 10; }

.campaign-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.campaign-content { padding: 4rem 3rem; display: flex; flex-direction: column; justify-content: center; }
.campaign-image { height: 100%; min-height: 300px; }
.campaign-image img { width: 100%; height: 100%; object-fit: cover; }

.progress-wrap { margin-top: 2rem; }
.progress-stats { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.95rem; }
.progress-bar { width: 100%; height: 8px; background: var(--color-light); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-accent); border-radius: 4px; transition: width 1.5s ease-in-out; }

@media (max-width: 900px) {
    .campaign-grid { grid-template-columns: 1fr; }
    .campaign-image { height: 250px; }
    .campaign-content { padding: 2.5rem 2rem; }
    .campaign-box { margin-top: 0; }
}

/* --- Impact Areas --- */
.impact-card {
    background: var(--color-white);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border-bottom: 3px solid transparent;
}

.impact-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-md); border-bottom-color: var(--color-accent); }

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.bg-blue-light { background: var(--color-blue-light); }
.text-blue { color: var(--color-blue); }
.bg-teal-light { background: var(--color-teal-light); }
.text-teal { color: var(--color-teal); }
.bg-yellow-light { background: var(--color-yellow-light); }
.text-yellow { color: var(--color-yellow); }
.bg-green-light { background: var(--color-green-light); }
.text-green { color: var(--color-green); }

/* --- Projects --- */
.project-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.project-img { position: relative; height: 240px; overflow: hidden; }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.project-card:hover .project-img img { transform: scale(1.05); }

.project-content { padding: 2rem; flex-grow: 1; display: flex; flex-direction: column; }
.project-content p { flex-grow: 1; }

.section-header-inline { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--color-light); padding-bottom: 1rem; }

/* --- Testimonial Section --- */
.quote-icon { font-size: 3rem; color: var(--color-primary-light); opacity: 0.5; margin-bottom: 1.5rem; }
.quote-text { font-family: var(--font-heading); font-style: normal; font-weight: 500; font-size: clamp(1.2rem, 2.5vw, 1.8rem); line-height: 1.6; }
.author-avatar { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; margin: 0 auto 0.5rem; }
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.quote-author strong { display: block; font-size: 1.1rem; }
.quote-author span { font-size: 0.9rem; color: var(--color-gray); }

/* --- News & Events --- */
.news-list-item { display: flex; gap: 1.5rem; padding: 1.5rem; background: var(--color-white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 1rem; transition: all var(--transition-fast); }
.news-list-item:hover { transform: translateX(5px); box-shadow: var(--shadow-md); }
.news-date { text-align: center; min-width: 60px; padding-right: 1.5rem; border-right: 1px solid var(--color-light); display: flex; flex-direction: column; justify-content: center; }
.news-date .day { display: block; font-size: 1.8rem; font-weight: 700; color: var(--color-primary); line-height: 1; }
.news-date .month { font-size: 0.85rem; text-transform: uppercase; font-weight: 600; color: var(--color-accent); }
.news-text h4 { margin-bottom: 0.5rem; font-size: 1.1rem; color: var(--color-charcoal); transition: color var(--transition-fast); }
.news-list-item:hover .news-text h4 { color: var(--color-primary); }
.news-text p { margin-bottom: 0; font-size: 0.95rem; }

.event-card { background: var(--color-white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; align-items: center; transition: all var(--transition-base); }
.event-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.event-img { width: 40%; height: 200px; }
.event-img img { width: 100%; height: 100%; object-fit: cover; }
.event-info { width: 60%; padding: 2rem; }
.event-tag { font-size: 0.85rem; font-weight: 600; color: var(--color-primary-light); margin-bottom: 0.5rem; display: block; }
@media (max-width: 600px) { .event-card { flex-direction: column; } .event-img { width: 100%; height: 180px; } .event-info { width: 100%; } }

/* --- Final CTA --- */
.final-cta { position: relative; overflow: hidden; }
.cta-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.cta-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--color-primary); opacity: 0.85; }
.donate-options { display: flex; flex-wrap: wrap; }

/* --- Footer --- */
.footer {
    margin-top: 4rem;
    padding-top: 5rem;
    padding-bottom: 2rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 3rem; }
.footer-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--color-white); }
.footer-links ul li { margin-bottom: 0.8rem; }
.footer-links ul a { color: var(--color-gray); }
.footer-links ul a:hover { color: var(--color-white); padding-left: 5px; }
.contact-list li { display: flex; gap: 1rem; color: var(--color-gray); margin-bottom: 1rem; align-items: flex-start; }
.contact-list i { margin-top: 5px; color: var(--color-primary-light); }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.05); color: white; margin-right: 0.5rem; transition: all var(--transition-fast); }
.social-links a:hover { background: var(--color-accent); transform: translateY(-3px); }
.legal-links a { color: var(--color-gray); margin-left: 1.5rem; font-size: 0.9rem; }
.legal-links a:hover { color: white; }

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } .flex-between { flex-direction: column; text-align: center; gap: 1rem; } .legal-links a { margin: 0 0.5rem; } }

/* ==========================================================================
   Animations & Reveals
   ========================================================================== */

/* Preloader */
.preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--color-white); z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease; }
.preloader.fade-out { opacity: 0; pointer-events: none; }
.loader-pulse { width: 50px; height: 50px; border-radius: 50%; background-color: var(--color-accent); animation: pulse 1.5s infinite ease-in-out; }
@keyframes pulse { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* Reveal Classes (Triggered via JS by adding .active) */
.reveal-up { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-up.active { opacity: 1; transform: translateY(0); }

.reveal-left { opacity: 0; transform: translateX(-40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-left.active { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-right.active { opacity: 1; transform: translateX(0); }

.reveal-scale { opacity: 0; transform: scale(0.95); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-scale.active { opacity: 1; transform: scale(1); }

/* Staggered Reveals */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Parallax Effect Utility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .reveal-up, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; }
}

/* --- Modals for Donors --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(14, 23, 44, 0.85); /* Dark overlay matching theme */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--color-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-charcoal);
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: var(--color-accent);
    color: white;
    transform: rotate(90deg);
}

.donor-table-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
    display: block;
}
