/* Enhanced Mobile-First Responsive Styles */

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Tablet and Small Desktop */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .section-header h2 {
        font-size: 2.5rem;
    }
    
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-image {
        order: -1;
    }
    
    .programs-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* Improved touch targets */
    .btn {
        min-height: 50px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    h1 {
        font-size: 2.3rem;
    }
    
    h2 {
        font-size: 1.9rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .hero {
        height: 80vh;
        min-height: 600px;
    }
    
    .hero-title {
        font-size: 2.3rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    /* Enhanced Mobile Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 2rem 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 0.5rem 0;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .nav-toggle {
        display: flex;
        flex-direction: column;
        width: 30px;
        height: 30px;
        justify-content: center;
    }
    
    .nav-toggle span {
        width: 25px;
        height: 2px;
        background: var(--text);
        margin: 3px 0;
        transition: var(--transition);
        transform-origin: center;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Improved Button Stacking */
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .btn-secondary {
        margin-left: 0;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Grid Improvements */
    .programs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .teachers-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Form Improvements */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Footer Improvements */
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .hero {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    /* Single column layouts */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .program-card {
        padding: 1.5rem;
    }
    
    .teacher-card {
        padding: 1.5rem;
    }
    
    /* Improved photo frames for mobile */
    .photo-frame {
        border-radius: 12px;
    }
    
    /* Better touch targets */
    .nav-menu a {
        padding: 1.25rem 2rem;
    }
    
    .btn {
        padding: 1.25rem 2rem;
        min-height: 55px;
        font-size: 1.1rem;
    }
    
    /* Text sizing improvements */
    p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .feature-list li {
        font-size: 1rem;
    }
}

/* Very Small Mobile */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .program-card,
    .teacher-card {
        padding: 1rem;
    }
}

/* Orientation-specific styles */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .nav-menu {
        top: 60px;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-background {
        background-image: url('../images/hero-bg@2x.jpg');
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #f5f5f7;
        --secondary: #1d1d1f;
        --text: #f5f5f7;
        --text-light: #a1a1a6;
        --white: #1d1d1f;
        --gray: #2d2d2f;
    }
    
    .navbar {
        background: rgba(29, 29, 31, 0.95);
    }
    
    .program-card,
    .teacher-card {
        background: #2d2d2f;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #2d2d2f;
        border-color: #3d3d3f;
        color: var(--text);
    }
}

/* Loading states for buttons */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced focus states for accessibility */
.btn:focus,
.nav-menu a:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .photo-frame,
    .program-card,
    .teacher-card {
        transition: none;
    }
    
    .notification {
        animation: none;
    }
}

