/* Enhanced Mobile-First CSS for F.A.C.T.S */

/* Base responsive improvements for all screen sizes */
@media (max-width: 1200px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-section {
        padding: 100px 0 80px;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Tablet and small desktop responsive design */
@media (max-width: 992px) {
    .hero-section {
        padding: 80px 0 60px;
        margin-top: 80px;
    }
    
    .page-header {
        padding: 100px 0 40px;
        margin-top: 80px;
    }
    
    .feature-box {
        margin-bottom: 30px;
        padding: 30px 20px;
    }
    
    .week-card {
        margin-bottom: 25px;
    }
    
    .pricing-card {
        margin-bottom: 30px;
        padding: 30px 25px;
    }
    
    .trainer-card {
        margin-bottom: 30px;
        padding: 25px;
    }
    
    .trainer-img {
        width: 180px;
        height: 180px;
    }
    
    .contact-info-card, .contact-form-card {
        margin-bottom: 25px;
        padding: 30px;
    }
}

/* Mobile-first responsive design improvements */
@media (max-width: 768px) {
    /* Container and spacing adjustments */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    section {
        padding: 50px 0;
    }

    /* Navigation improvements */
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        border-radius: 0.375rem;
        transition: background-color 0.3s ease;
        font-size: 1rem;
    }

    .navbar-nav .nav-link:hover {
        background-color: rgba(0, 123, 255, 0.1);
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .logo-img {
        max-height: 50px;
    }

    /* Hero section mobile optimization */
    .hero-section {
        padding: 80px 0 60px;
        margin-top: 70px;
        text-align: center;
    }

    .hero-section h1, .hero-title {
        font-size: 1.9rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .hero-section .lead, .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    
    .session-info, .class-size-note {
        font-size: 0.95rem;
        padding: 8px 12px;
        margin-bottom: 1rem;
        display: block;
        text-align: center;
    }
    
    .page-header {
        padding: 100px 0 40px;
        margin-top: 70px;
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 1.9rem;
        line-height: 1.3;
    }

    /* Video player mobile optimization */
    .video-container {
        position: relative;
        width: 100%;
        height: 0;
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
        margin: 1rem 0;
    }

    .video-container video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0.5rem;
    }

    /* Form improvements for mobile */
    .contact-form,
    .booking-form {
        padding: 1rem;
        margin: 1rem 0;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.375rem;
    }

    /* Content sections mobile layout */
    .section-title {
        font-size: 1.7rem;
        line-height: 1.3;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .feature-box {
        padding: 25px 15px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .week-card {
        margin-bottom: 20px;
    }
    
    .week-header {
        padding: 15px;
        text-align: center;
    }
    
    .week-number {
        position: static;
        display: inline-block;
        margin-bottom: 10px;
    }
    
    .week-header h3 {
        font-size: 1.2rem;
        padding-right: 0;
    }
    
    .week-content {
        padding: 15px;
    }
    
    .pricing-card {
        padding: 20px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .trainer-card {
        padding: 20px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .trainer-img {
        width: 150px;
        height: 150px;
        margin-bottom: 15px;
    }
    
    .trainer-name {
        font-size: 1.2rem;
    }
    
    .trainer-credentials {
        font-size: 0.9rem;
    }
    
    .contact-info-card, .contact-form-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    /* Statistics mobile layout */
    .program-stats {
        justify-content: center;
        text-align: center;
    }
    
    .stat-item {
        flex: 0 0 50%;
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .stat-number {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* About page content */
    .about-content {
        padding: 0 10px;
        text-align: center;
    }
    
    .about-content .btn {
        margin-bottom: 15px;
        width: 100%;
        text-align: center;
    }

    /* Button improvements */
    .btn {
        min-height: 44px; /* Touch-friendly minimum */
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        border-radius: 0.375rem;
        transition: all 0.3s ease;
    }
    
    /* Enhanced CTA section mobile styling */
    .cta-section {
        padding: 50px 0;
    }
    
    .cta-section h2 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .cta-section p {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 1.5rem;
    }
    
    .cta-section .btn-primary {
        min-height: 50px !important;
        font-size: 1rem !important;
        padding: 14px 32px !important;
        width: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-top: 10px !important;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
        border: none !important;
        color: #1a1a1a !important;
        font-weight: 600 !important;
        box-shadow: 
            0 6px 24px rgba(0, 0, 0, 0.12),
            0 3px 12px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
        border-radius: 50px !important;
        text-decoration: none !important;
        letter-spacing: 0.3px !important;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    .cta-section .btn-primary:hover,
    .cta-section .btn-primary:focus,
    .cta-section .btn-primary:active {
        background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
        color: #ffffff !important;
        transform: translateY(-3px) scale(1.01) !important;
        box-shadow: 
            0 8px 28px rgba(46, 204, 113, 0.25),
            0 4px 16px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
        letter-spacing: 0.5px !important;
    }

    .btn-primary {
        background: linear-gradient(135deg, #007bff, #0056b3);
        border: none;
        box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    }

    /* Card layout improvements */
    .card {
        border: none;
        border-radius: 0.75rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        margin-bottom: 1.5rem;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    /* Typography improvements */
    .section-heading {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1rem;
        text-align: center;
    }

    .text-muted {
        color: #6c757d !important;
    }

    /* Loading states */
    .loading {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 3px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        border-top-color: #fff;
        animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }
}

/* Small mobile devices (320px - 480px) */
@media (max-width: 480px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .hero-section {
        padding: 60px 0 40px;
        margin-top: 60px;
    }
    
    .hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 1.2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1.2rem;
    }
    
    .page-header {
        padding: 80px 0 30px;
        margin-top: 60px;
    }
    
    .page-header h1 {
        font-size: 1.6rem;
    }
    
    .feature-box {
        padding: 20px 10px;
        margin-bottom: 15px;
    }
    
    .feature-icon {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 1.2rem;
    }
    
    .week-card {
        margin-bottom: 15px;
    }
    
    .week-header {
        padding: 12px;
    }
    
    .week-header h3 {
        font-size: 1.1rem;
    }
    
    .week-content {
        padding: 12px;
    }
    
    .pricing-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .trainer-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .trainer-img {
        width: 120px;
        height: 120px;
    }
    
    .trainer-name {
        font-size: 1.1rem;
    }
    
    .contact-info-card, .contact-form-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .stat-item {
        flex: 0 0 100%;
        margin-bottom: 10px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .form-control {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .session-info, .class-size-note {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .logo-img {
        max-height: 45px;
    }
    
    section {
        padding: 40px 0;
    }
    
    /* Enhanced CTA section for extra small devices */
    .cta-section {
        padding: 35px 0 !important;
    }
    
    .cta-section h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.7rem !important;
    }
    
    .cta-section p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1rem !important;
    }
    
    .cta-section .btn-primary {
        min-height: 44px !important;
        font-size: 0.9rem !important;
        padding: 10px 24px !important;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
        border: none !important;
        color: #1a1a1a !important;
        font-weight: 600 !important;
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.12),
            0 2px 6px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
        border-radius: 30px !important;
        text-transform: none !important;
        letter-spacing: 0.3px !important;
        text-decoration: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        backdrop-filter: blur(4px) !important;
    }
    
    /* Enhanced CTA section for small mobile */
    .cta-section {
        padding: 40px 0 !important;
    }
    
    .cta-section h2 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.8rem !important;
    }
    
    .cta-section p {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1.2rem !important;
    }
    
    .cta-section .btn-primary {
        min-height: 48px !important;
        font-size: 0.95rem !important;
        padding: 12px 28px !important;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
        border: none !important;
        color: #1a1a1a !important;
        font-weight: 600 !important;
        box-shadow: 
            0 5px 20px rgba(0, 0, 0, 0.12),
            0 2px 8px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
        border-radius: 40px !important;
        text-decoration: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        letter-spacing: 0.3px !important;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        backdrop-filter: blur(6px) !important;
    }
}

/* Extra small devices (below 360px) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .feature-box {
        padding: 15px 8px;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.1rem;
    }
    
    .trainer-img {
        width: 100px;
        height: 100px;
    }
    
    .pricing-card, .week-card, .trainer-card {
        padding: 12px;
    }
    
    .contact-info-card, .contact-form-card {
        padding: 12px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-height: 36px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .logo-img {
        max-height: 40px;
    }
}

/* Tablet landscape mode optimizations */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .container {
        max-width: 90%;
    }
    
    .hero-section {
        padding: 100px 0 60px;
        margin-top: 80px;
    }
    
    .page-header {
        padding: 80px 0 40px;
        margin-top: 80px;
    }
    
    .feature-box {
        padding: 25px 20px;
        margin-bottom: 20px;
    }
    
    .pricing-card {
        padding: 25px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .navbar-collapse {
        padding: 10px;
    }
}

/* Medium tablet portrait mode */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .hero-section {
        padding: 120px 0 80px;
        margin-top: 80px;
    }
    
    .feature-box {
        padding: 30px 25px;
        margin-bottom: 25px;
    }
    
    .pricing-card {
        padding: 30px;
        margin-bottom: 25px;
    }
    
    .trainer-img {
        width: 160px;
        height: 160px;
    }
    
    .contact-info-card, .contact-form-card {
        padding: 25px;
    }
}

/* Desktop enhancements */
@media (min-width: 1025px) {
    .hero-section {
        padding: 4rem 0;
    }

    .hero-section h1 {
        font-size: 2.75rem;
        font-weight: 700;
    }

    .hero-section .lead {
        font-size: 1.25rem;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus improvements for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 1px solid #000;
    }

    .btn-primary {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
