/* CSS Variables */
:root {
    /* Colors */
    --green: #85ca9e;
    --green-dark: #3f533f;
    --yellow: #ffe295;
    --yellow-dark: #ffc107;
    --red: #f49cc2;
    --blue: #2196f3;
    --white: #ffffff;
    --dark: #333333;
    --gray: #f5f5f5;
    --green-pastel: rgba(46, 125, 50, 0.1);
    --ash: #7d7f83;
    --off-white: #f5f4f0;
    
    /* Fonts */
    --font-head:  "Playfair Display", serif;
    --font-body: "Montserrat", sans-serif;
    --font-curve: "Dancing Script", cursive;

    --filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
    --text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

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

/* Safari fix for box-sizing */
*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Safari AOS fix */
[data-aos] {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

/* Disable AOS on Safari if needed */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) and (stroke-color:transparent) {
        [data-aos] {
            opacity: 1 !important;
            transform: none !important;
            animation: none !important;
            transition: none !important;
        }
    }
}

/* Disable AOS animations on Safari only for after-school section */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) and (stroke-color:transparent) {
        .afterschool-card {
            opacity: 1 !important;
            transform: none !important;
            animation: none !important;
            transition: none !important;
        }
        
        .afterschool-card[data-aos] {
            opacity: 1 !important;
            transform: none !important;
            animation: none !important;
        }
    }
}

body {
    font-family: var(--font-body);
    color: var(--dark);
    background: var(--white);
    /* Safari text rendering fix */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    min-height: 100vh;
    /* Safari 100vh fix */
    min-height: -webkit-fill-available;
}

/* Page transition */
body {
    animation: pageFade 0.2s ease-out;
}

@keyframes pageFade {
    0% {
        opacity: 0;
        transform: translateY(8px);
        -webkit-transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        -webkit-transform: translateY(0);
    }
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    background: var(--green-dark);
    padding: 0;
    margin: 0;
}

#navbar.scrolled {
    background: var(--green-dark);
}

#navbar.scrolled .logo img {
    height: 75px;
    transition: height 0.3s ease;
    margin: 0.2rem 0 0.2rem 1.5rem;
    filter: var(--filter);
    -webkit-filter: var(--filter);
}

#navbar.scrolled .desktop-nav a:not(.apply-btn) {
    transition: font-size 0.3s ease;
    text-shadow: var(--text-shadow);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding:  0;
    margin: 0;
}

.logo img {
    height: 75px;
    width: auto;
    transition: height 0.3s ease;
    margin: 0.2rem 0 0.2rem 1.5rem;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.desktop-nav a:not(.apply-btn) {
    text-decoration: none;
    color: var(--gray);
    font-family: var(--font-head);
    font-size: 1.35rem;
    transition: font-size 0.3s ease;
    font-weight:500;
    margin-right: -8px;
    border-radius: 2rem;
    padding: 12px;
    text-shadow: var(--text-shadow);
}

.desktop-nav a:not(.apply-btn):hover {
    color: var(--yellow);
}

.apply-btn {
    background: var(--red);
    color: var(--white);
    text-decoration: none;
    border-radius: 10px;
    letter-spacing: 2px;
    font-family: var(--font-head);
    font-size: 1.35rem;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    margin: 1rem;
    /* Safari fix */
    -webkit-appearance: none;
}

.apply-btn:hover {
    opacity: 0.9;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    align-items: center;
}

.mobile-apply-btn {
    background: var(--red);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.3rem;
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    height: 9.7vh;
    display: flex;
    align-items: center;
    /* Safari fix */
    -webkit-appearance: none;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 21px;
    background: var(--green-dark);
    border: none;
    cursor: pointer;
    padding: 0 13px;
    height: 9.7vh;
    width: 15vw;
    gap: 7px;
    /* Safari fix */
    -webkit-appearance: none;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger to X Animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(50deg) translate(5px, 5px);
    -webkit-transform: rotate(50deg) translate(5px, 5px);
}

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

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

.hamburger span {
    transition: all 0.3s ease;
}

/* Mobile Menu Fade In Animation */
.mobile-menu {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

#navbar.scrolled .hamburger span {
    background: var(--white);
}

/* Mobile Menu */
.mobile-menu {
    display: block;
    position: absolute;
    top: calc(100% + 10px);
    left: 20px;
    right: 20px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    height: 75vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.mobile-nav a {
    text-decoration: none;
    color: var(--dark);
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray);
}

.mobile-nav a:hover {
    color: var(--green);
}

/* Responsive */
@media (max-width: 768px) {

    .desktop-nav {
        display: none;
    }
    
    .mobile-controls {
        display: flex;
    }

    .logo img {
        height: 65px;
    }
    
    #navbar.scrolled .logo img {
        height: 65px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .desktop-nav {
        gap: 0.5rem;
    }
    
    .desktop-nav a:not(.apply-btn) {
        font-size: 0.85rem;
        padding: 6px 8px;
        margin-right: -2px;
    }
    
    .apply-btn {
        padding: 0 1rem;
        font-size: 0.85rem;
        letter-spacing: 1px;
        height: 10vh;
        margin-left: 0.5rem;
    }
}

/* footer */
    .footer {
        background: var(--green-dark);
        padding: 3rem 2rem 2rem;
        color: var(--white);
    }
    
    .footer-container {
        max-width: 65vw;
        margin: 0 auto;
    }

    /* Top Row - 3 columns */
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

/* Center Column */
.footer-center {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.footer-center .footer-links-title {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--white);
    margin: 0 0 0.5rem 0;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-contact p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.footer-contact strong {
    color: var(--yellow);
    font-weight: 600;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-contact a:hover {
    color: var(--yellow);
}

.footer-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}
    
    .footer-logo {
        max-width: 300px;
        height: auto;
    }
    
    .footer-description {
        font-family: var(--font-body);
        font-size: 0.9rem;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.9);
        max-width: 400px;
        margin: 0;
    }
    
    .footer-apply-btn {
        display: inline-block;
        background: var(--yellow);
        color: var(--dark);
        text-decoration: none;
        padding: 0.75rem 1.5rem;
        border-radius: 40px;
        font-family: var(--font-body);
        font-size: 0.9rem;
        font-weight: 600;
        width: fit-content;
        transition: all 0.3s ease;
        /* Safari fix */
        -webkit-appearance: none;
    }
    
    .footer-apply-btn:hover {
        transform: translateX(5px);
        -webkit-transform: translateX(5px);
        background: var(--white);
    }
    
    /* Right Side */

    .footer-links-title {
        font-family: var(--font-head);
        font-size: 1.4rem;
        font-weight: 600;
        color: var(--white);
        margin: 0 0 0.5rem 0;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .footer-links a {
        font-family: var(--font-body);
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .footer-links a:hover {
        color: var(--yellow);
        transform: translateX(5px);
        -webkit-transform: translateX(5px);
    }
    
    /* Bottom Row */
    .footer-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .footer-copyright p {
        font-family: var(--font-body);
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.7);
        margin: 0;
    }
    
    .footer-copyright a {
        color: var(--yellow);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
    }
    
    .footer-copyright a:hover {
        text-decoration: underline;
    }
    
    .footer-social {
        display: flex;
        gap: 1rem;
    }
    
    .social-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        transition: all 0.3s ease;
    }
    
    .social-link:hover {
        background: var(--yellow);
        transform: translateY(-3px);
        -webkit-transform: translateY(-3px);
    }
    
    .social-link img {
        width: 18px;
        height: 18px;
        filter: brightness(0) invert(1);
        -webkit-filter: brightness(0) invert(1);
    }
    
    .social-link:hover img {
        filter: brightness(0) invert(0);
        -webkit-filter: brightness(0) invert(0);
    }
    
@media (max-width: 768px) {
    .footer {
        padding: 2rem 1.5rem 1.5rem;
    }

    .footer-container{
        max-width: none;
    }
    
    .footer-top {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .footer-logo{
        width: 220px;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: left;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .footer-bottom {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    
    .footer-copyright p {
        font-size: 0.75rem;
    }
    
    .footer-social {
        order: 1;
    }
    
    .footer-copyright {
        order: 2;
    }
}

    /* Tablet */
    @media (min-width: 769px) and (max-width: 1024px) {
        .footer-top {
            gap: 2rem;
        }
        
        .footer-logo {
            max-width: 150px;
        }
        
        .footer-description {
            font-size: 0.85rem;
        }
    }

    /* CTA Section */
.cta-section {
    background: var(--yellow);
    padding: 5rem 2rem;
    text-align: center;
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
}

.cta-tag {
    font-family: var(--font-body);
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--green-dark);
    font-weight: 500;
    display: inline-block;
    margin-bottom: 1rem;
}

.cta-title {
    font-family: var(--font-head);
    font-size: 4rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 2rem;
    line-height: 1.3;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 40px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    /* Safari fix */
    -webkit-appearance: none;
}

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

.cta-btn-primary:hover {
    background: var(--dark);
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.cta-btn-secondary {
    background: var(--white);
    color: var(--green);
}

.cta-btn-secondary:hover {
    background: var(--dark);
    color: var(--white);
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cta-section {
        padding: 3rem 0.2rem;
    }
    
    .cta-title {
        font-size: 2.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
        margin: auto 1rem;
    }
    
    .cta-btn {
        width: 100%;
        text-align: center;
        padding: 0.875rem 1.5rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .cta-title {
        font-size: 2rem;
    }
}

/* Safari/iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS specific */
    main {
        min-height: -webkit-fill-available;
    }
    
    /* Fix for sticky/hover issues on iOS */
    .whyus-point, .contact-card, .program-age-card {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Fix for border-radius + overflow hidden on iOS */
    .whyus-image, .embed-wrapper, .program-age-card, .contact-card {
        -webkit-mask-image: -webkit-radial-gradient(white, black);
    }
}