/* ============================================
   RefoundHope - Main Website CSS
   ============================================ */

/* CSS Variables */
:root {
    --primary: #0A8754;
    --primary-dark: #066840;
    --secondary: #F4A261;
    --secondary-dark: #E08B3A;
    --background: #F8F9FA;
    --text: #222222;
    --text-light: #666666;
    --white: #FFFFFF;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

p {
    color: var(--text-light);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--white);
}

/* ============================================
   Header
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: var(--white);
    z-index: 99999;
    box-shadow: var(--shadow);
}

.navbar {
    height: 100%;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo svg {
    width: 40px;
    height: 40px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a {
    padding: 10px 15px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
    background: rgba(10, 135, 84, 0.1);
}

.btn-donate {
    background: var(--secondary);
    color: var(--text) !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    margin-left: 10px;
}

.btn-donate:hover {
    background: var(--secondary-dark);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 8px;
    z-index: 10001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9997;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }
    
    .mobile-menu-backdrop.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* ============================================
   Main Content
   ============================================ */
main {
    padding-top: 90px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-height: 48px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(10, 135, 84, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

/* ============================================
   Page Hero
   ============================================ */
.page-hero {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    text-align: center;
}

.page-hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 15px;
}

.page-hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Hero Section (Homepage)
   ============================================ */
.hero {
    padding: 180px 0 100px;
    background: linear-gradient(135deg, #E8F5E9 0%, #F8F9FA 50%, #FFF5EB 100%);
    position: relative;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-content h1 span {
    color: var(--primary);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* ============================================
   Stats Section
   ============================================ */
.stats {
    background: var(--primary);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
}

.stat-label {
    color: rgba(255,255,255,0.9);
}

/* ============================================
   Focus Areas
   ============================================ */
.focus-areas {
    background: var(--background);
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-subtitle {
    max-width: 600px;
    margin: 0 auto;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.focus-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.focus-image {
    height: 180px;
    background: #E8F5E9;
}

.focus-content {
    padding: 25px;
}

.focus-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.focus-content p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.focus-link {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Gallery
   ============================================ */
/* Gallery styles are in pages/home.php */

/* ============================================
   Testimonials
   ============================================ */
.testimonials {
    padding: 80px 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%);
}

.testimonials .section-title {
    color: var(--white);
}

.testimonials .section-subtitle {
    color: rgba(255,255,255,0.7);
}

.testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
}

.testimonial-quote {
    font-size: 1.4rem;
    color: var(--white);
    text-align: center;
    font-style: italic;
    margin-bottom: 30px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 600;
}

.author-info h4 {
    color: var(--white);
}

.author-info span {
    color: var(--secondary);
    font-size: 0.9rem;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    text-align: center;
}

.cta-section h2 {
    color: var(--white);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.cta-section p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    padding-bottom: 60px;
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-brand p {
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.footer-social, .social-links {
    display: flex;
    gap: 12px;
}

.footer-social a, .social-links a {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--primary);
}

.footer-title, .footer-links h4, .footer-contact h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.footer-contact svg {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

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

.footer-bottom p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    gap: 30px;
}

.footer-bottom-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.footer-bottom-links a:hover {
    color: var(--white);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.card-body {
    padding: 25px;
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .focus-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 768px) {
    .logo-text {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        position: relative;
        z-index: 99999;
    }
    
    .nav-menu {
        display: none !important;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        gap: 5px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        z-index: 99998;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    .nav-menu a {
        width: 100%;
        text-align: center;
        padding: 15px 10px;
    }
    
    .btn-donate {
        width: 100%;
        margin: 10px 0 0;
    }
    
    .hero {
        padding: 140px 0 60px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .focus-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .page-hero h1 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    /* Additional Mobile Fixes */
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        padding: 16px 24px;
    }
    
    .stats {
        padding: 40px 0;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .focus-card {
        margin-bottom: 20px;
    }
    
    .footer {
        padding-top: 50px;
    }
    
    .footer-grid {
        padding-bottom: 40px;
    }
    
    .footer-title {
        margin-bottom: 15px;
    }
    
    .footer-links li {
        margin-bottom: 8px;
    }
    
    .footer-contact li {
        margin-bottom: 12px;
    }
    
    .footer-bottom {
        padding: 20px 0;
    }
    
    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .page-hero {
        padding: 60px 0;
    }
    
    .page-hero h1 {
        font-size: 1.75rem;
    }
    
    .page-hero p {
        font-size: 1rem;
    }
}
    
    .section-title {
        font-size: 1.75rem;
    }
}

/* ============================================
   Small Mobile
   ============================================ */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Hero adjustments */
    .hero {
        padding: 120px 0 50px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    /* Better buttons on mobile */
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Mobile images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Blog cards */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card {
        margin-bottom: 30px;
    }
    
    /* Partner logos */
    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .logo-item {
        height: 80px;
        padding: 15px;
    }
    
    .logo-item img {
        max-width: 100%;
        max-height: 50px;
    }
    
    .header {
        height: 80px;
    }
    
    .logo img {
        height: 60px !important;
    }
    
    main {
        padding-top: 80px;
    }
    
    /* Testimonials */
    .testimonial-slider {
        padding: 0 10px;
    }
    
    .testimonial-quote {
        font-size: 1rem;
    }
    
    /* Forms */
    .donation-form {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-links, .footer-contact {
        padding-left: 0;
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .team-card {
        margin-bottom: 20px;
    }
    
    /* Program pages */
    .program-hero {
        padding: 80px 0 50px;
    }
    
    .program-hero h1 {
        font-size: 1.5rem;
    }
    
    .solution-grid, .support-grid, .action-grid {
        grid-template-columns: 1fr;
    }
    
    .donate-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    /* About page */
    .story-section {
        grid-template-columns: 1fr;
    }
    
    .story-image {
        order: -1;
    }
    
    .mission-vision {
        grid-template-columns: 1fr;
    }
    
    .core-values-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact page */
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Touch-friendly improvements */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
    
    .focus-card:hover {
        transform: none;
    }
}
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Focus cards */
    .focus-card {
        margin-bottom: 0;
    }
    
    /* Footer small mobile */
    .footer-grid {
        gap: 20px;
    }
    
    .footer-social {
        flex-wrap: wrap;
    }
    
    /* Program pages mobile */
    .program-hero h1 {
        font-size: 1.75rem;
    }
    
    .program-hero p {
        font-size: 1rem;
    }
    
    .problem-text {
        font-size: 1rem;
    }
    
    .solution-grid,
    .support-grid,
    .action-grid {
        gap: 15px;
    }
    
    .solution-card,
    .support-card,
    .action-card {
        padding: 20px;
    }
    
    /* Donate button */
    .donate-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    /* Vision box */
    .vision-box {
        padding: 30px 20px;
    }
    
    /* About page mobile */
    .team-grid {
        gap: 15px;
    }
    
    .team-card {
        margin-bottom: 15px;
    }
    
    .team-photo {
        height: 200px;
    }
    
    /* Legal section */
    .legal-section {
        padding: 30px 20px;
    }
    
    /* Mission/Vision cards */
    .mv-card {
        padding: 25px 20px;
    }
    
    /* Story section */
    .story-section {
        gap: 30px;
    }
    
    /* Core values */
    .core-values-grid > div {
        padding: 25px 20px;
    }
}

/* ============================================
   Landscape Mobile
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 100px 0 50px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Better touch targets */
    .btn {
        min-height: 48px;
        padding: 14px 24px;
    }
    
    .nav-menu a {
        padding: 14px 15px;
    }
    
    .focus-card,
    .team-card,
    .solution-card,
    .support-card {
        cursor: default;
    }
    
    /* Remove hover effects on touch */
    .focus-card:hover,
    .team-card:hover {
        transform: none;
    }
    
    /* Larger touch targets for forms */
    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
    }
    
    /* Tap highlight */
    a, button {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
}

/* ============================================
   Desktop Large Screens
   ============================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 2.75rem;
    }
}

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .footer,
    .cta-section,
    .chat-widget,
    .mobile-menu-btn {
        display: none !important;
    }
    
    main {
        padding-top: 0;
    }
    
    .section {
        padding: 40px 0;
    }
}