/* Responsive Design System */

html, body {
    overflow-x: hidden !important;
}

/* Breakpoints */
:root {
    --breakpoint-xs: 480px;
    --breakpoint-sm: 768px;
    --breakpoint-md: 992px;
    --breakpoint-lg: 1200px;
    --breakpoint-xl: 1400px;
}

/* Container Responsive */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

@media (max-width: 1199px) {
    .container {
        max-width: 960px;
        padding: 0 var(--spacing-lg);
    }
}

@media (max-width: 991px) {
    * {
        max-width: 100%;
    }
    
    .container {
        max-width: 720px;
        padding: 0 var(--spacing-md);
    }
}

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

@media (max-width: 479px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
        
    .preloader-logo {
        width: 300px; /* adjust as needed */
        height: 200px;
    }
}

/* Navigation Responsive */
@media (max-width: 991px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background: var(--primary-black);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 100px var(--spacing-lg) var(--spacing-lg);
        transition: right var(--transition-normal);
        z-index: var(--z-modal);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--gradient-primary);
        z-index: -1;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: var(--spacing-md) 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-cta {
        margin-top: var(--spacing-xl);
    }
    
    .nav-toggle {
        display: flex;
        z-index: var(--z-modal);
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

@media (max-width: 767px) {
    .nav-container {
        padding: var(--spacing-md);
    }
    
    .nav-logo h2 {
        font-size: 1.5rem;
    }

    .nav-logo-img {
        margin-left: 10px;
    }
    
    .logo-tagline {
        font-size: 0.7rem;
    }
}

/* Hero Section Responsive */
@media (max-width: 991px) {
    .hero {
        height: 100vh;
        min-height: 600px;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-md);
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

@media (max-width: 767px) {
    .hero {
        height: 170vh;
        min-height: 500px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
        margin-bottom: var(--spacing-md);
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .stat-item {
        padding: var(--spacing-md);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .scroll-indicator {
        bottom: var(--spacing-lg);
    }
}

@media (max-width: 479px) {
    .hero {
        height: 150vh;
        min-height: 450px;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .cta-btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.9rem;
    }
}

/* Section Spacing Responsive */
@media (max-width: 991px) {
    .about-section,
    .branches-section,
    .services-section,
    .gallery-section,
    .membership-section,
    .instagram-section,
    .contact-section,
    .final-cta {
        padding: calc(var(--spacing-xxl) * 0.8) 0;
    }
    
    .section-header {
        margin-bottom: calc(var(--spacing-xxl) * 0.8);
    }
}

@media (max-width: 767px) {
    .about-section,
    .branches-section,
    .services-section,
    .gallery-section,
    .membership-section,
    .instagram-section,
    .contact-section,
    .final-cta {
        padding: calc(var(--spacing-xxl) * 0.6) 0;
    }
    
    .section-header {
        margin-bottom: calc(var(--spacing-xxl) * 0.6);
    }
    
    .section-header h2 {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
    }
}

@media (max-width: 479px) {
    .about-section,
    .branches-section,
    .services-section,
    .gallery-section,
    .membership-section,
    .instagram-section,
    .contact-section,
    .final-cta {
        padding: calc(var(--spacing-xxl) * 0.5) 0;
    }
    
    .section-header {
        margin-bottom: calc(var(--spacing-xxl) * 0.5);
    }

    .branches-grid,.gallery-grid,.trainers-grid,.services-grid {
        grid-template-columns: 1fr !important;
    }

    img {
        width: 100%;
        object-fit: cover;
    }
}

/* About Section Responsive */
@media (max-width: 991px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .about-visual {
        order: -1;
    }
    
    .image-stack {
        height: 400px;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    .about-features {
        gap: var(--spacing-md);
    }
    
    .feature-item {
        padding: var(--spacing-md);
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .feature-item i {
        font-size: 2rem;
        margin-top: 0;
    }
    
    .image-stack {
        height: 300px;
    }
    
    .image-card.floating {
        width: 60%;
        height: 50%;
    }
}

@media (max-width: 479px) {
    .feature-item {
        padding: var(--spacing-sm);
    }
    
    .image-stack {
        height: 250px;
    }
    
    .achievement-badge {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        padding: var(--spacing-sm);
        font-size: 0.8rem;
    }
}

/* Branches Section Responsive */
@media (max-width: 991px) {
    .branches-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .branch-card.featured {
        transform: none;
    }
}

@media (max-width: 767px) {
    .branches-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .branch-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .branch-image {
        height: 250px;
    }
    
    .branch-content h3 {
        font-size: 1.5rem;
    }
    
    .branch-features {
        gap: var(--spacing-xs);
    }
    
    .branch-features span {
        font-size: 0.85rem;
    }
    
    .branch-info {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
}

@media (max-width: 479px) {
    .branch-image {
        height: 200px;
    }
    
    .branch-content {
        padding: var(--spacing-md);
    }
    
    .branch-content h3 {
        font-size: 1.3rem;
    }
    
    .featured-badge {
        top: var(--spacing-sm);
        left: var(--spacing-sm);
        padding: 4px var(--spacing-sm);
        font-size: 0.8rem;
    }
}

/* Services Section Responsive */
@media (max-width: 991px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-lg);
    }
}

@media (max-width: 767px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .service-card {
        padding: var(--spacing-lg);
        max-width: 400px;
        margin: 0 auto;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 479px) {
    .service-card {
        padding: var(--spacing-md);
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .service-card h3 {
        font-size: 1.1rem;
    }
}

/* Gallery Section Responsive */
@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }
    
    .gallery-filter {
        gap: var(--spacing-sm);
    }
    
    .filter-btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.9rem;
    }
}

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .gallery-filter {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 479px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .gallery-overlay {
        padding: var(--spacing-md);
    }
    
    .gallery-overlay h4 {
        font-size: 1rem;
    }
    
    .gallery-overlay p {
        font-size: 0.85rem;
    }
}

/* Membership Section Responsive */
@media (max-width: 991px) {
    .membership-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .membership-card.popular {
        transform: none;
    }
}

@media (max-width: 767px) {
    .membership-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .membership-card {
        max-width: 350px;
        margin: 0 auto;
        padding: var(--spacing-lg);
    }
    
    .membership-toggle {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .amount {
        font-size: 2.5rem;
    }
}

@media (max-width: 479px) {
    .membership-card {
        padding: var(--spacing-md);
    }
    
    .amount {
        font-size: 2rem;
    }
    
    .plan-features li {
        font-size: 0.9rem;
    }
    
    .popular-badge {
        font-size: 0.8rem;
        padding: 4px var(--spacing-sm);
    }
}

/* Instagram Section Responsive */
@media (max-width: 991px) {
    .instagram-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .insta-post {
        height: 150px;
    }
}

@media (max-width: 767px) {
    .instagram-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .insta-post {
        height: 120px;
    }
    
    .insta-overlay i {
        font-size: 1.5rem;
    }
    
    .insta-overlay span {
        font-size: 0.8rem;
    }
}

@media (max-width: 479px) {
    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .insta-post {
        height: 150px;
    }
}

/* Contact Section Responsive */
@media (max-width: 991px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .contact-info {
        order: 2;
    }
    
    .contact-form {
        order: 1;
    }
}

@media (max-width: 767px) {
    .contact-card {
        padding: var(--spacing-lg);
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .contact-form {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 479px) {
    .contact-card {
        padding: var(--spacing-md);
        text-align: center;
    }
    
    .contact-form {
        padding: var(--spacing-md);
    }
    
    .branch-item {
        font-size: 0.85rem;
    }
}

/* Footer Responsive */
@media (max-width: 991px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .footer {
        padding: calc(var(--spacing-xxl) * 0.8) 0 var(--spacing-lg);
    }
}

@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .footer {
        padding: calc(var(--spacing-xxl) * 0.6) 0 var(--spacing-lg);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .footer-links {
        gap: var(--spacing-md);
    }

    .footer-logo-img {
        margin-left: 0;
    }
    
    .branch-info {
        gap: var(--spacing-md);
    }
    
    .newsletter-form {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 479px) {
    .footer-logo h3 {
        font-size: 1.5rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        margin-top: var(--spacing-xs);
    }
}

/* Back to Top Responsive */
@media (max-width: 767px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        font-size: 1rem;
    }
}

@media (max-width: 479px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
        font-size: 0.9rem;
    }
}

/* Component Responsive */
@media (max-width: 767px) {
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
        margin: 5% auto;
    }
    
    .tabs .tab-nav {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .tab-btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .accordion-header {
        padding: var(--spacing-md);
        font-size: 0.95rem;
    }
    
    .accordion-content.active {
        padding: var(--spacing-md);
    }
    
    .timeline {
        padding-left: var(--spacing-lg);
    }
    
    .timeline-item {
        padding-left: var(--spacing-lg);
    }
    
    .timeline-content {
        padding: var(--spacing-md);
    }
}

@media (max-width: 479px) {
    .modal-content {
        width: 98%;
        padding: var(--spacing-md);
    }
    
    .dropdown-content {
        min-width: 150px;
        left: auto;
        right: 0;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .page-btn {
        padding: 6px 10px;
        min-width: 35px;
        font-size: 0.9rem;
    }
    
    .alert {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
}

/* Utility Responsive Classes */
@media (max-width: 991px) {
    .hide-md { display: none !important; }
    .show-md { display: block !important; }
}

@media (max-width: 767px) {
    .hide-sm { display: none !important; }
    .show-sm { display: block !important; }
    .text-center-sm { text-align: center !important; }
}

@media (max-width: 479px) {
    .hide-xs { display: none !important; }
    .show-xs { display: block !important; }
    .text-center-xs { text-align: center !important; }
}

/* Print Styles */
@media print {
    .navbar,
    .back-to-top,
    .nav-toggle,
    .scroll-indicator,
    .whatsapp-btn,
    .cta-btn,
    .social-links,
    .instagram-section,
    .final-cta {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black !important;
        background: white !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
    }
    
    .hero {
        height: auto;
        padding: 2rem 0;
        background: white !important;
    }
    
    .hero-content {
        color: black !important;
    }
    
    .section-tag {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .branch-card,
    .service-card,
    .membership-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    a {
        color: black !important;
        text-decoration: underline;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-black: #000000;
        --secondary-black: #000000;
        --primary-yellow: #ffff00;
        --secondary-yellow: #ffff00;
        --white: #ffffff;
        --medium-gray: #000000;
        --dark-gray: #000000;
    }
    
    .branch-overlay,
    .gallery-overlay,
    .insta-overlay {
        background: rgba(0, 0, 0, 0.9) !important;
    }
    
    .glass,
    .glass-dark {
        background: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .parallax-layer {
        transform: none !important;
    }
    
    .float,
    .pulse,
    .bounce {
        animation: none !important;
    }
    
    .particles {
        display: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light-gray: #2d2d2d;
        --medium-gray: #cccccc;
        --dark-gray: #ffffff;
    }
    
    body {
        background-color: var(--primary-black);
        color: var(--white);
    }
    
    .service-card,
    .membership-card,
    .contact-card,
    .modal-content {
        background: var(--secondary-black);
        color: var(--white);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: var(--secondary-black);
        color: var(--white);
        border-color: #444;
    }
}

/* Landscape Orientation */
@media (max-width: 991px) and (orientation: landscape) {
    .hero {
        height: 100vh;
    }
    
    .hero-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }
    
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-sm);
    }
    
    .stat-item {
        padding: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .cta-btn,
    .nav-link,
    .branch-card,
    .service-card,
    .gallery-item {
        transform: none !important;
    }
    
    .branch-overlay,
    .gallery-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.7);
    }
    
    .tooltip::before,
    .tooltip::after {
        display: none;
    }
    
    .dropdown:hover .dropdown-content {
        display: none;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: no-preference) {
    .animate-on-scroll {
        animation: fadeInUp 0.8s ease forwards;
    }
}

/* Focus Visible */
@supports selector(:focus-visible) {
    *:focus {
        outline: none;
    }
    
    *:focus-visible {
        outline: 2px solid var(--primary-yellow);
        outline-offset: 2px;
    }
}

/* Container Queries (Future-proofing) */
@supports (container-type: inline-size) {
    .responsive-container {
        container-type: inline-size;
    }
    
    @container (max-width: 400px) {
        .card-responsive {
            padding: var(--spacing-sm);
        }
    }
}