/* Safe Haven Mental Health Project - Main Stylesheet */

:root {
    --primary-green: #2d8a47;
    --light-green: #e8f5e8;
    --dark-green: #1e5d32;
    --text-dark: #333;
    --text-light: #595959; /* WCAG AA compliant - 4.5:1 contrast ratio */
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --navbar-height: 100px; /* Centralized navbar height variable */
}

/* ============================================
   TYPOGRAPHY & BASE STYLES
   ============================================ */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    padding-top: var(--navbar-height);
}

html {
    scroll-behavior: smooth;
}

.blockquote {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-light);
}

/* ============================================
   BOOTSTRAP OVERRIDES
   ============================================ */

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

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

.bg-light {
    background-color: #f8f9fa;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%) !important;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--dark-green) !important;
    border-color: var(--dark-green) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Donation Buttons */
.donation-btn {
    white-space: nowrap;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donation-btn.btn-primary {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.donation-btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(45, 138, 71, 0.25);
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    max-width: 70%;
    flex-shrink: 1;
}

.navbar-brand img {
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.navbar-brand h5 {
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.navbar-brand small {
    white-space: nowrap;
    display: block;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-green);
}

.nav-link.active {
    color: var(--primary-green);
    font-weight: 600;
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

/* Nav Pills for Gallery Tabs */
.nav-pills .nav-link {
    color: var(--text-dark);
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    background-color: var(--light-green);
    color: var(--primary-green);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-green);
    color: white;
}

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

.hero-section {
    background: linear-gradient(135deg, var(--light-green) 0%, rgba(255, 255, 255, 0.9) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="3" fill="%232d8a47" opacity="0.1"/><circle cx="800" cy="300" r="2" fill="%232d8a47" opacity="0.1"/><circle cx="400" cy="600" r="2.5" fill="%232d8a47" opacity="0.1"/><circle cx="600" cy="800" r="2" fill="%232d8a47" opacity="0.1"/></svg>') repeat;
    pointer-events: none;
}

.hero-image img {
    transition: transform 0.3s ease;
}

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

.hero-logo {
    max-width: 450px;
    width: 100%;
    height: auto;
}

@media (max-width: 576px) {
    .hero-logo {
        max-width: 250px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .hero-logo {
        max-width: 350px;
    }
}

/* ============================================
   CARDS
   ============================================ */

.card {
    border-radius: 1rem;
    overflow: hidden;
}

.stat-card {
    padding: 2rem 1rem;
    border-radius: 1rem;
    background: white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
}

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

.service-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
}

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

.sponsor-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
}

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

.sponsor-card img {
    transition: transform 0.3s ease;
    filter: grayscale(20%);
    object-fit: contain;
}

.sponsor-card:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.sponsor-card .bg-light {
    transition: background-color 0.3s ease;
}

.sponsor-card:hover .bg-light {
    background-color: var(--light-green);
}

article.card {
    transition: all 0.3s ease;
}

article.card:hover {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15);
}

.gallery-card {
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ============================================
   ALERTS
   ============================================ */

.alert-primary {
    background-color: var(--light-green);
    border-color: var(--primary-green);
    color: var(--dark-green);
    border-radius: 0.75rem;
}

.alert-info {
    border-radius: 0.75rem;
}

.alert-danger {
    border-radius: 0.5rem;
    background-color: #dc3545;
    border-color: #dc3545;
}

.alert-warning {
    border-radius: 0.5rem;
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

/* ============================================
   FORMS
   ============================================ */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.25rem rgba(45, 138, 71, 0.25);
}

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

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-green), transparent);
    margin: 3rem 0;
}

.page-header {
    margin-top: var(--navbar-height);
}

.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Sponsor Logos */
.sponsor-logo {
    max-height: 100px;
    object-fit: contain;
    width: auto;
}

.sponsor-logo-sm {
    max-height: 80px;
    object-fit: contain;
    width: auto;
}

.sponsor-logo-container {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Founder Photo */
.founder-photo {
    max-width: 500px;
}

/* Testimonial Styles */
.testimonial-quote-icon {
    font-size: 3rem;
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

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

@media (max-width: 768px) {
    :root {
        --navbar-height: 80px;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .display-4 {
        font-size: 2.5rem;
    }

    .display-5 {
        font-size: 2rem;
    }

    .btn-lg {
        padding: 0.625rem 1.5rem;
        font-size: 1rem;
    }

    .navbar-brand {
        max-width: 65%;
    }

    .navbar-brand img {
        height: 50px;
    }

    .navbar-brand h5 {
        font-size: 0.9rem;
        line-height: 1.1;
    }

    .navbar-brand small {
        font-size: 0.7rem;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }

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

@media (max-width: 576px) {
    .hero-section .container .row {
        text-align: center;
    }

    .d-flex.flex-column.flex-sm-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        margin-bottom: 0.5rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .navbar-brand {
        max-width: 60%;
    }

    .navbar-brand img {
        height: 45px;
        margin-right: 0.5rem;
    }

    .navbar-brand h5 {
        font-size: 0.85rem;
    }

    .navbar-brand small {
        font-size: 0.65rem;
    }

    /* Donation buttons responsive */
    .donation-btn {
        font-size: 1rem;
        padding: 0.65rem 0.4rem;
        min-height: 48px;
    }

    .donation-btn + .donation-btn {
        margin-top: 0;
    }
}

/* Extra small devices - WhatsApp browser optimization */
@media (max-width: 400px) {
    .navbar-brand {
        max-width: 58%;
    }

    .navbar-brand img {
        height: 40px;
        margin-right: 0.4rem;
    }

    .navbar-brand h5 {
        font-size: 0.75rem;
        line-height: 1;
        margin-bottom: 0.1rem;
    }

    .navbar-brand small {
        font-size: 0.6rem;
        line-height: 1;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Donation buttons - smaller on mobile */
    .donation-btn {
        font-size: 0.95rem;
        padding: 0.6rem 0.3rem;
        min-height: 45px;
    }
}
