/* ===========================
   AAAGML - Responsive Design
   Mobile-First Approach
   =========================== */

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

/* Simplified mobile navigation */
@media (max-width: 768px) {
    .header {
        padding: 15px 0;
        min-height: 70px;
    }
    
    /* Standard layout: logo left, hamburger right */
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .navbar__logo-container {
        width: 45px;
        height: 45px;
    }
    
    /* Professional mobile menu design */
    .navbar__menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 80px var(--space-lg) var(--space-xl);
        z-index: 99999;
        overflow-y: auto;
        justify-content: flex-start;
        align-items: center;
        width: 100vw;
        height: 100vh;
    }
    
    /* Close button styling - will be added via JavaScript */
    .navbar__close {
        position: absolute;
        top: 30px;
        right: 30px;
        font-size: 2rem;
        color: var(--text-dark);
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(248, 249, 250, 0.8);
        transition: all 0.3s ease;
        border: none;
        z-index: 10001;
    }
    
    .navbar__close:hover {
        background: var(--charity-gold);
        color: var(--white);
        transform: rotate(90deg);
    }

    .navbar__menu.active {
        display: flex !important;
        animation: fadeIn 0.3s ease-out;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .navbar__menu li {
        margin-bottom: var(--space-md);
        width: 100%;
        max-width: 300px;
        text-align: center;
        display: block !important;
        visibility: visible !important;
    }

    .navbar__link {
        color: var(--text-dark) !important;
        font-size: 1.2rem;
        font-weight: 500;
        padding: var(--space-md) var(--space-lg);
        display: block;
        text-align: center;
        border-radius: var(--radius-medium);
        transition: all 0.3s ease;
        background: rgba(248, 249, 250, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.05);
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
    }

    .navbar__link:hover {
        color: var(--white) !important;
        background: var(--charity-gold);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(224, 195, 65, 0.3);
    }
    
    /* Prominent donate button */
    .navbar__menu .btn--primary {
        margin-top: var(--space-lg);
        padding: var(--space-md) var(--space-xl);
        font-size: 1.1rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-radius: var(--radius-large);
        background: var(--primary-blue);
        color: var(--white) !important;
        border: none;
        box-shadow: 0 4px 16px rgba(25, 118, 210, 0.3);
    }
    
    .navbar__menu .btn--primary:hover {
        background: var(--ocean-blue);
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
    }
    
    /* Fade in animation */
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    /* Hide dropdown menus completely on mobile - flatten navigation */
    .dropdown-menu {
        display: none !important;
    }
    
    /* Remove dropdown indicators on mobile */
    .dropdown-toggle::after {
        display: none;
    }

    /* Show hamburger button on mobile */
    /* Improved tap target sizes for mobile */
    .navbar__toggle {
        display: flex !important;
        padding: 12px;
        min-width: 48px;
        min-height: 48px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        background: transparent;
        border: none;
    }

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

    .navbar__toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .navbar__toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

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

@media (max-width: 1024px) {
    .hero {
        min-height: 85vh;
        padding-bottom: 100px;
        align-items: flex-end;
    }

    .hero__content {
        max-width: 90%;
        margin-bottom: 1.5rem;
    }

    .hero__donate-btn {
        bottom: 3rem;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 80vh;
        text-align: center;
        padding-bottom: 80px;
        background-attachment: scroll; /* Better performance on mobile */
        align-items: flex-end;
        justify-content: center;
    }
    
    /* Improved mobile readability */
    .hero::before {
        background: rgba(0, 0, 0, 0.6) !important; /* Increased from 0.5 for better contrast */
    }

    .hero__content {
        max-width: 100%;
        padding: 0 var(--space-sm);
        margin-bottom: 1rem;
    }

    .hero__title {
        font-size: clamp(2rem, 8vw, 2.5rem);
        margin-bottom: var(--space-sm);
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8); /* Stronger shadow for readability */
    }

    .hero__subtitle {
        font-size: clamp(1rem, 3.5vw, 1.15rem); /* Increased from 0.9rem */
        margin-bottom: var(--space-md);
        line-height: 1.65; /* Improved line height */
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    }

    .hero__donate-btn {
        position: static;
        margin-top: var(--space-lg);
        transform: none;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 75vh;
        padding-bottom: 70px;
    }

    .hero__content {
        margin-bottom: 0.5rem;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .btn--yellow {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* ===========================
   EXTRA SMALL MOBILE DEVICES
   =========================== */

@media (max-width: 320px) {
    .hero {
        padding-top: 90px; /* Further adjusted for very small screens */
        padding-bottom: 80px;
    }
    
    .hero__content {
        margin-top: var(--space-sm); /* Reduced top margin for tight spaces */
        margin-bottom: 1rem;
        padding: 0 calc(var(--space-xs) * 0.5); /* Minimal horizontal padding */
    }
    
    .hero__title {
        font-size: 1.8rem; /* Smaller title for very small screens */
        margin-bottom: var(--space-xs);
        margin-top: 0;
    }
    
    .hero__subtitle {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: var(--space-sm);
    }
    
    .navbar__logo-container {
        width: 45px; /* Even smaller logo for very small screens */
        height: 45px;
    }
    
    .header {
        min-height: 70px; /* Reduced header height */
        padding: 10px 0;
    }
}

/* ===========================
   ABOUT SECTION RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .about__content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-lg);
        padding: var(--space-lg);
    }

    .about__image {
        justify-self: center;
        width: 250px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .about {
        margin-top: -80px;
        padding: calc(var(--section-padding) * 0.6) 0;
        background-attachment: scroll; /* Better performance on mobile */
        background-position: 20% center;
    }

    .about__container {
        padding-top: 80px;
    }

    .about__content {
        padding: var(--space-md);
        background: rgba(255, 255, 255, 0.92);
    }

    .about__image {
        width: 200px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .about {
        background-position: 15% center;
    }

    .about__content {
        padding: var(--space-sm);
        background: rgba(255, 255, 255, 0.88);
    }

    .about__image {
        width: 180px;
        height: 220px;
    }
}

/* ===========================
   DONATION PAGE RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .donation-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .donate-hero {
        min-height: 50vh;
        background-attachment: scroll;
        text-align: center;
        padding-bottom: 80px;
    }
    
    .donate-hero__content {
        max-width: 100%;
        padding: 0 var(--space-sm);
    }
    
    .donation-options {
        background: 
            linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(248, 249, 250, 0.15) 100%),
            url('../assets/images/donation-page/rendering/front-face-render.png'),
            url('../assets/images/donation-page/rendering/inside-render/inside-render.png');
        background-attachment: scroll, scroll, scroll;
        background-size: cover, 40% auto, 55% auto;
        background-position: center center, 20% center, 80% center;
    }
    
    .donation-options .container {
        padding-top: 80px;
    }
    
    .section-header {
        background: rgba(255, 255, 255, 0.98);
        padding: var(--space-lg);
    }
    
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }
    
    .amount-btn {
        font-size: 1rem;
        padding: var(--space-sm);
    }
    
    .why-donate__grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .support-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .donation-options {
        background: 
            linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(248, 249, 250, 0.25) 100%),
            url('../assets/images/donation-page/rendering/front-face-render.png'),
            url('../assets/images/donation-page/rendering/inside-render/inside-render.png');
        background-attachment: scroll, scroll, scroll;
        background-size: cover, 45% auto, 65% auto;
        background-position: center center, 30% center, 70% center;
    }
    
    .section-header {
        background: rgba(255, 255, 255, 0.98);
        padding: var(--space-md);
    }
    
    .donate-hero {
        min-height: 40vh;
        padding-bottom: 60px;
    }
    
    .amount-buttons {
        grid-template-columns: 1fr;
    }
    
    .donation-impact {
        padding: var(--space-lg);
    }
    
    .btn--donate {
        font-size: 1.1rem;
        padding: var(--space-md) var(--space-lg);
    }
}

/* ===========================
   BLUEPRINTS & FEATURES RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    
    .blueprints__content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    

    
    .features__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
}

@media (max-width: 768px) {
    .blueprints__content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        text-align: center;
    }
    
    .blueprints__text h2 {
        font-size: 2rem;
    }
    
    .blueprints__description {
        font-size: 1rem;
    }
    
    .video-container {
        margin-top: var(--space-lg);
    }
    
    .features__grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .feature__item {
        padding: var(--space-lg);
    }
    
    .feature__icon {
        font-size: 2.5rem;
    }
    
    .fundraising-goal {
        padding: var(--space-md);
        margin: var(--space-sm) 0;
        background-attachment: scroll; /* Better performance on mobile */
    }
    
    .progress-bar {
        height: 50px;
    }
    
    .progress-text {
        font-size: 1.2rem;
    }
    
    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .stat-item {
        padding: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .blueprints__description {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .features__header h2 {
        font-size: 1.8rem;
    }
    
    .feature__item {
        padding: var(--space-md);
    }
    
    .feature__item h3 {
        font-size: 1.2rem;
    }
    
    .feature__item p {
        font-size: 0.9rem;
    }
    
    .fundraising-goal {
        padding: var(--space-sm);
    }
    
    .goal-header h3 {
        font-size: 1.6rem;
    }
    
    .goal-header p {
        font-size: 1rem;
    }
    
    .progress-bar {
        height: 40px;
    }
    
    .progress-text {
        font-size: 1rem;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }
    
    .stat-item {
        padding: var(--space-sm);
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .goal-message {
        padding: var(--space-md);
        margin: var(--space-sm) var(--space-sm) 0 var(--space-sm);
    }
    
    .goal-message p {
        font-size: 0.85rem;
        padding-left: var(--space-xs);
    }
}

/* ===========================
   PARTNERSHIP FORM RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .partnership-form-element {
        padding: var(--space-lg);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        margin-bottom: var(--space-md);
    }
    
    .form-header h2 {
        font-size: 1.8rem;
    }
    
    .form-header p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 0 var(--space-sm);
    }
    
    .partnership-form-element {
        padding: var(--space-md);
    }
    
    .form-group {
        margin-bottom: var(--space-md);
    }
    
    .form-header {
        margin-bottom: var(--space-lg);
    }
    
    .form-header h2 {
        font-size: 1.6rem;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }
}

/* ===========================
   GOALS SECTION RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .goals {
        background-attachment: scroll; /* Better performance on mobile */
        background-position: 70% center; /* Adjust cropping for mobile */
    }

    .goals__text {
        padding: var(--space-md);
    }

    .goals__text p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .goals__text {
        padding: var(--space-sm);
    }
}

/* ===========================
   IMPACT SECTION RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .impact__content {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .impact__image {
        height: 400px;
        order: 1;
    }
    
    .impact__text {
        height: auto;
        padding: var(--space-lg);
        order: 2;
    }
    
    .impact__title {
        font-size: clamp(1.8rem, 5vw, 2.2rem);
        margin-bottom: var(--space-md);
    }
    
    .impact__description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .impact__image {
        height: 300px;
    }
    
    .impact__text {
        padding: var(--space-md);
    }
    
    .impact__title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .impact__description {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* ===========================
   LOCATION SECTION RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .location__content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        text-align: center;
    }
}

@media (max-width: 768px) {
    .location__map {
        min-height: 200px;
        padding: var(--space-md);
    }
    
    .map-container {
        height: 250px;
        min-height: 250px;
    }
}

/* ===========================
   GET INVOLVED RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .get-involved {
        background-attachment: scroll;
    }
    
    .get-involved__content {
        max-width: 100%;
    }
    
    .get-involved__options {
        gap: var(--space-sm);
        max-width: 100%;
        justify-items: center;
        align-items: center;
    }

    .involvement__card {
        padding: var(--space-xl) var(--space-md);
        min-height: 240px;
        aspect-ratio: 1.2 / 1;
        background: rgba(255, 255, 255, 0.98);
        max-width: 280px;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .get-involved__options {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        justify-items: center;
        align-items: center;
    }

    .involvement__card {
        padding: var(--space-lg);
        min-height: 200px;
        aspect-ratio: auto;
        max-width: 400px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .involvement__card {
        padding: var(--space-md);
        min-height: 180px;
        max-width: 100%;
    }
}

/* ===========================
   TESTIMONIALS RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .testimonials {
        padding: calc(var(--section-padding) * 0.8) 0;
    }
    
    .testimonials .container {
        padding: 0 var(--space-md);
    }
    
    .testimonial__featured {
        grid-template-columns: 1fr;
        margin-top: var(--space-md);
    }
    
    .testimonial__image {
        min-height: 250px;
        order: 1;
    }
    
    .testimonial__text {
        padding: var(--space-lg);
        order: 2;
    }
    
    .testimonial__quote {
        font-size: clamp(1.1rem, 3.5vw, 1.4rem);
        margin-bottom: var(--space-sm);
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .testimonials .container {
        padding: 0 var(--space-sm);
    }
    
    .testimonial__image {
        min-height: 200px;
    }
    
    .testimonial__text {
        padding: var(--space-md);
    }
    
    .testimonial__quote {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .testimonial__author {
        font-size: 1rem;
    }
    
    /* Custom Map Pin Responsive */
    .custom-map-pin {
        /* Position will be calculated by JavaScript */
        transition: all 0.2s ease;
    }
    
    .pin-icon {
        width: 35px;
        height: 35px;
    }
    
    .pin-logo {
        width: 20px;
        height: 20px;
    }
    
    .pin-label {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

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

@media (max-width: 768px) {
    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-md);
    }

    .footer {
        padding: 40px 0 20px;
    }
    
    /* Improved tap targets for footer links */
    .footer__section a {
        display: inline-block;
        padding: 8px 4px;
        min-height: 44px;
        line-height: 28px;
    }
}

@media (max-width: 480px) {
    .footer__section {
        margin-bottom: var(--space-md);
    }

    .footer__section h3 {
        font-size: 1.1rem;
    }

    .footer__section p,
    .footer__section a {
        font-size: 0.9rem;
    }
}

/* ===========================
   BUTTON RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .btn--large {
        padding: 14px 28px;
        font-size: 1rem;
    }

    .btn--yellow {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .btn--large {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* ===========================
   TYPOGRAPHY RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    :root {
        --space-xs: 0.25rem;
        --space-sm: 0.75rem;
        --space-md: 1.25rem;
        --space-lg: 1.75rem;
        --space-xl: 2.5rem;
        --space-xxl: 3rem;
    }

    h1 { font-size: clamp(2rem, 6vw, 2.5rem); }
    h2 { font-size: clamp(1.75rem, 5vw, 2rem); }
    h3 { font-size: clamp(1.5rem, 4vw, 1.75rem); }
    h4 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .text-large {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }

    p {
        font-size: 0.9rem;
    }

    .text-large {
        font-size: 1rem;
    }
}

/* ===========================
   CONTAINER RESPONSIVE
   =========================== */

@media (max-width: 1200px) {
    .container {
        padding: 0 var(--space-md);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-xs);
    }
}

/* ===========================
   SECTION SPACING RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .section {
        padding: calc(var(--section-padding) * 0.6) 0;
    }

    .section--compact {
        padding: calc(var(--section-padding) * 0.4) 0;
    }
}

@media (max-width: 480px) {
    .section {
        padding: calc(var(--section-padding) * 0.5) 0;
    }

    .section--compact {
        padding: calc(var(--section-padding) * 0.3) 0;
    }
}

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

@media (max-width: 768px) {
    .visually-hidden:focus {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0.5rem;
        background: var(--primary-blue);
        color: var(--white);
        text-decoration: none;
        border-radius: var(--radius-small);
    }
}

/* ===========================
   PERFORMANCE OPTIMIZATIONS
   =========================== */

@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    .hero,
    .goals {
        background-attachment: scroll;
    }

    /* Simplify shadows on mobile */
    .about__content,
    .testimonial__card,
    .involvement__card {
        box-shadow: var(--shadow-light);
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Respect user's motion preferences */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero,
    .goals {
        background-attachment: scroll;
    }
}

/* ===========================
   HIGH DPI DISPLAYS
   =========================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for high DPI displays */
    .navbar__logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===========================
   LANDSCAPE ORIENTATION
   =========================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 80vh;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */

@media print {
    .header,
    .navbar__toggle,
    .hero__donate-btn,
    .btn,
    .footer {
        display: none !important;
    }

    .hero {
        background: none;
        color: var(--text-dark);
        min-height: auto;
        padding: var(--space-md) 0;
    }

    .section {
        padding: var(--space-md) 0;
        page-break-inside: avoid;
    }

    .about__content,
    .testimonial__card,
    .involvement__card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}