/* ========================================
   UNIVERSAL RESPONSIVE DESIGN
   ======================================== */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-text h1 {
        font-size: 5rem;
    }
    
    .program-card {
        padding: 30px;
    }
}

/* Desktop (1024px - 1199px) */
@media (max-width: 1199px) and (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
    
    .hero-text h1 {
        font-size: 4.5rem;
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .slogan-text {
        font-size: 1.8rem;
    }
    
    .sub-nav .container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .hero {
        min-height: 70vh;
    }
    
    .hero-content {
        width: 60%;
        padding: 30px;
    }
    
    .hero-text h1 {
        font-size: 3.5rem;
    }
    
    .hero-text p {
        font-size: 1.1rem;
    }
    
    .hero-dop-image {
        width: 40%;
        opacity: 0.95;
    }
    
    .program-levels {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .program-details {
        grid-template-columns: 1fr;
    }
    
    .application-forms {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pricing-table,
    .schedule-table,
    .transport-table {
        font-size: 0.9rem;
    }
    
    .pricing-table th,
    .schedule-table th,
    .transport-table th {
        padding: 15px 10px;
        font-size: 1rem;
    }
    
    .pricing-table td,
    .schedule-table td,
    .transport-table td {
        padding: 12px 8px;
    }
    
    .transport-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .loyalty-benefits {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gift-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gift-cards-display {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 30px 20px;
        width: 90%;
    }
    
    .logo-text {
        font-size: 2.5rem;
    }
    
    .nav-link {
        font-size: 1rem;
    }
    
    .sub-nav-link {
        font-size: 0.9rem;
    }
}

/* Tablet Portrait (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .slogan-text {
        font-size: 1.5rem;
    }
    
    .sub-nav .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero {
        min-height: 60vh;
        flex-direction: column;
    }
    
    .hero-content {
        width: 100%;
        padding: 20px;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .gymnast-image {
        display: none;
    }
    
    .hero-dop-image {
        width: 100%;
        height: 40%;
        top: auto;
        bottom: 0;
        opacity: 0.9;
    }
    
    .program-levels {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .program-details {
        grid-template-columns: 1fr;
    }
    
    .application-forms {
        flex-direction: column;
        align-items: center;
    }
    
    .pricing-table,
    .schedule-table,
    .transport-table {
        font-size: 0.8rem;
    }
    
    .pricing-table th,
    .schedule-table th,
    .transport-table th {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .pricing-table td,
    .schedule-table td,
    .transport-table td {
        padding: 10px 6px;
    }
    
    .transport-info {
        grid-template-columns: 1fr;
    }
    
    .loyalty-benefits {
        grid-template-columns: 1fr;
    }
    
    .gift-options {
        grid-template-columns: 1fr;
    }
    
    .gift-cards-display {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px 15px;
        width: 95%;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .sub-nav-link {
        font-size: 0.8rem;
    }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .slogan-text {
        font-size: 1.2rem;
    }
    
    .sub-nav .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero {
        min-height: 50vh;
    }
    
    .hero-content {
        padding: 15px;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
        line-height: 1.1;
    }
    
    .hero-text p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .hero-dop-image {
        height: 30%;
        opacity: 0.8;
    }
    
    .programs h2,
    .pricing h2,
    .schedule h2,
    .transportation h2,
    .loyalty h2,
    .gift-cards h2 {
        font-size: 1.8rem;
    }
    
    .program-levels {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .level {
        font-size: 1.3rem;
    }
    
    .arrow {
        font-size: 1rem;
    }
    
    .program-details {
        grid-template-columns: 1fr;
    }
    
    .application-forms {
        flex-direction: column;
        align-items: center;
    }
    
    .pricing-table,
    .schedule-table,
    .transport-table {
        font-size: 0.7rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .pricing-table th,
    .schedule-table th,
    .transport-table th {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    
    .pricing-table td,
    .schedule-table td,
    .transport-table td {
        padding: 6px 4px;
    }
    
    .transport-info {
        grid-template-columns: 1fr;
    }
    
    .loyalty-benefits {
        grid-template-columns: 1fr;
    }
    
    .gift-options {
        grid-template-columns: 1fr;
    }
    
    .gift-cards-display {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        margin: 2% auto;
        padding: 15px 10px;
        width: 98%;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .modal-content h2 {
        font-size: 1.3rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .submit-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .secure-invitation {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }
    
    .logo-text {
        font-size: 1.8rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .sub-nav-link {
        font-size: 0.7rem;
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .container {
        padding: 0 5px;
    }
    
    .hero-text h1 {
        font-size: 1.5rem;
    }
    
    .hero-text p {
        font-size: 0.8rem;
    }
    
    .program-card {
        padding: 10px;
    }
    
    .modal-content {
        padding: 10px 5px;
    }
    
    .slogan-text {
        font-size: 1rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATION
   ======================================== */

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {
    .secure-invitation,
    .submit-btn,
    .application-btn,
    .nav-link,
    .sub-nav-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .modal-content {
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .image-card,
    .site-image-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-dop-image,
    .gymnast-image {
        background-size: cover;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: 40vh;
    }
    
    .hero-content {
        padding: 10px;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .hero-dop-image {
        height: 50%;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #2c2c2c;
        color: #ffffff;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #3c3c3c;
        color: #ffffff;
        border-color: #555555;
    }
}
