/* ============================================
   WARRIS CORP - RESPONSIVE DESIGN SYSTEM
   Mobile-First • All Platforms Compatible
   ============================================ */

/* ============ GLOBAL RESPONSIVE UTILITIES ============ */

/* Prevent horizontal overflow everywhere */
html, body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Better touch targets on mobile */
@media (pointer: coarse) {
    a, button, .nav-btn, .nav-item, .btn-primary, .btn-secondary {
        min-height: 44px;
    }
}

/* Responsive images everywhere */
img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   HEADBAR / NAVIGATION - MOBILE HAMBURGER
   ============================================ */

/* Mobile hamburger button - hidden by default */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1200;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(247, 31, 134, 0.15);
}

.mobile-menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

/* ========== TABLET (max-width: 900px) ========== */
@media (max-width: 900px) {
    /* Show hamburger */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Reorganize headbar for mobile */
    #headbar-warris {
        padding: 10px 16px !important;
        gap: 0 !important;
    }

    .nav-group.nav-left {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-right: 1px solid rgba(247, 31, 134, 0.15);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 80px 20px 20px;
        gap: 4px;
        z-index: 1100;
        overflow-y: auto;
    }

    .nav-group.nav-left.mobile-open {
        display: flex !important;
        animation: slideInLeft 0.3s ease forwards;
    }

    @keyframes slideInLeft {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }

    .nav-group.nav-left .nav-btn {
        width: 100%;
        text-align: left;
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
        margin: 0 !important;
        border-radius: 12px;
    }

    .nav-group.nav-left .nav-btn:hover {
        background: rgba(247, 31, 134, 0.1);
    }

    .nav-group.nav-right {
        padding-left: 0 !important;
        gap: 6px;
        flex: unset;
    }

    .nav-group.nav-right .nav-btn {
        margin: 0 2px !important;
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
    }

    /* Also add right nav items into the mobile menu */
    .nav-group.nav-right .nav-btn:not(.cart-btn) {
        display: none !important;
    }

    .nav-group.nav-left.mobile-open ~ .nav-group.nav-right .nav-btn:not(.cart-btn) {
        display: none !important;
    }

    .mobile-nav-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-nav-overlay.active {
        pointer-events: auto;
    }

    /* Logo center on mobile */
    #logo-link {
        order: 0;
    }

    #warris-logo {
        height: 50px !important;
    }
}

/* ========== MOBILE SMALL (max-width: 600px) ========== */
@media (max-width: 600px) {
    #headbar-warris {
        padding: 8px 12px !important;
    }

    #warris-logo {
        height: 40px !important;
    }

    .nav-group.nav-right .nav-btn {
        padding: 6px 8px !important;
        font-size: 0.7rem !important;
    }

    .login-cta-btn {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
    }

    .login-cta-btn span {
        display: none;
    }

    .profile-btn {
        padding: 6px 10px !important;
    }

    .profile-name {
        display: none !important;
    }
}


/* ============================================
   INDEX / HOME PAGE - RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    /* Hero Section */
    .hero-section {
        padding: 120px 20px 60px !important;
        min-height: auto !important;
    }

    .hero-title {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle, .hero-description {
        font-size: 1rem !important;
        max-width: 100% !important;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 12px !important;
    }

    .hero-cta .btn-premium,
    .hero-cta .btn-secondary,
    .hero-cta a {
        width: 100%;
        max-width: 300px;
        text-align: center;
        justify-content: center;
    }

    /* Stats Bar */
    .stats-bar {
        gap: 30px !important;
        padding: 30px 20px !important;
        justify-content: center;
    }

    .stat-item {
        text-align: center;
    }

    .stat-number {
        font-size: 1.8rem !important;
    }

    /* Trust Badges */
    .trust-badges-section .trust-badges,
    .trust-badges-section {
        flex-wrap: wrap;
        gap: 10px !important;
        padding: 20px !important;
    }

    /* Features */
    .feature-section {
        padding: 60px 20px !important;
    }

    .section-title {
        font-size: 1.8rem !important;
    }

    .section-subtitle {
        font-size: 0.95rem !important;
        max-width: 100% !important;
    }

    /* Calculator Section - REMOVED, replaced by How It Works */
    .how-it-works-section {
        padding: 40px 16px !important;
    }

    /* App Gallery */
    .app-gallery {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Games Section */
    .games-showcase {
        justify-content: center;
    }

    .game-tile {
        width: 100px !important;
        height: 65px !important;
    }

    /* ===== PRODUCT TAB BAR (Premium / Optimization / Boosting / Free) ===== */
    .produit-buttons {
        width: 90% !important;
        max-width: 100% !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        border-radius: 20px !important;
        padding: 6px !important;
        gap: 6px !important;
    }

    .produit-btn {
        padding: 10px 16px !important;
        font-size: 0.82rem !important;
        gap: 6px !important;
        flex: 1 1 auto !important;
        justify-content: center !important;
        min-width: 0 !important;
    }

    /* Products Section */
    .produits-container,
    .services-grid,
    #products {
        padding: 0 16px !important;
    }

    .single-product {
        max-width: 100% !important;
    }

    .services-container {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .produit-card-body {
        padding: 20px !important;
    }

    .produit-card-price {
        font-size: 1.8rem !important;
    }

    .produit-card-image {
        height: 160px !important;
    }

    /* Comparison Table */
    .comparison-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 12px !important;
        white-space: nowrap;
    }

    /* Reviews Carousel */
    .reviews-carousel {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .reviews-stats {
        gap: 20px !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    .review-card {
        min-width: 280px !important;
        max-width: 300px !important;
    }

    /* Overall Rating */
    .overall-rating {
        flex-wrap: wrap !important;
        gap: 30px !important;
        justify-content: center !important;
    }

    .rating-bars {
        min-width: auto !important;
        width: 100% !important;
    }

    /* How It Works */
    .hiw-timeline {
        gap: 40px !important;
    }
    .hiw-step-content {
        padding: 20px !important;
    }

    /* CTA Section */
    .cta-section {
        padding: 60px 20px !important;
    }

    .cta-title {
        font-size: 1.8rem !important;
    }

    /* Before/After Section */
    .before-after-section {
        padding: 40px 16px !important;
    }

    /* Sections general */
    .section {
        padding: 60px 20px !important;
    }
}

@media (max-width: 500px) {
    .hero-title {
        font-size: 1.7rem !important;
    }

    .hero-subtitle {
        font-size: 0.9rem !important;
    }

    .stat-number {
        font-size: 1.5rem !important;
    }

    .stats-bar {
        gap: 20px !important;
        flex-direction: column;
        align-items: center;
    }

    .game-tile {
        width: 80px !important;
        height: 52px !important;
    }

    .section-title {
        font-size: 1.4rem !important;
    }

    .review-card {
        min-width: 260px !important;
        max-width: 280px !important;
    }

    /* Product tab bar - even smaller */
    .produit-buttons {
        width: 95% !important;
        gap: 4px !important;
        padding: 5px !important;
    }

    .produit-btn {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        gap: 5px !important;
    }

    .produit-btn span {
        display: none !important;
    }

    .produit-btn i {
        font-size: 1rem !important;
    }

    .produit-card-body {
        padding: 16px !important;
    }

    .produit-card-title {
        font-size: 1.1rem !important;
    }

    /* Comparison table - allow wrapping on very small */
    .comparison-table th,
    .comparison-table td {
        white-space: normal !important;
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }

    .comparison-table .plan-price {
        font-size: 1rem !important;
    }

    .table-btn {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
    }

    /* How It Works small */
    .hiw-step {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    .hiw-line { display: none !important; }
    .hiw-step-content { width: 100% !important; }

    /* Footer */
    .premium-footer,
    .footer {
        padding: 40px 16px 20px !important;
    }

    .footer-brand p {
        max-width: 100% !important;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}


/* ============================================
   PRODUCT PAGE - RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .product-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .product-image-section {
        position: relative !important;
        top: auto !important;
    }

    .product-page {
        padding: 100px 20px 40px !important;
    }

    .product-info .price-section {
        flex-wrap: wrap;
    }

    .trust-badges {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons a,
    .cta-buttons button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}


/* ============================================
   LEGAL PAGES (Terms, Privacy, etc.) - RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .legal-content {
        padding: 0 16px !important;
    }

    .legal-container {
        padding: 30px 20px !important;
    }

    .legal-section h2 {
        font-size: 1.3rem !important;
    }

    .page-hero {
        padding: 120px 20px 40px !important;
    }

    .hero-title {
        font-size: 1.8rem !important;
    }

    .hero-subtitle {
        font-size: 0.95rem !important;
    }
}


/* ============================================
   ABOUT PAGE - RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .content-image {
        order: -1;
    }

    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 500px) {
    .stats-grid-4 {
        grid-template-columns: 1fr !important;
    }
}


/* ============================================
   TEAM PAGE - RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .team-grid,
    .leadership-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 20px !important;
    }
}

@media (max-width: 500px) {
    .team-grid,
    .leadership-grid {
        grid-template-columns: 1fr !important;
    }

    .team-card {
        max-width: 100%;
    }
}


/* ============================================
   FAQ PAGE - RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .faq-container {
        padding: 0 16px !important;
    }

    .faq-question {
        font-size: 0.95rem !important;
        padding: 16px !important;
    }

    .faq-answer {
        padding: 0 16px 16px !important;
    }
}


/* ============================================
   SUCCESS PAGE - RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .success-section {
        padding: 120px 20px 40px !important;
    }

    .success-container {
        padding: 30px 20px !important;
    }

    .success-actions {
        flex-direction: column;
        gap: 12px !important;
    }

    .success-actions a,
    .success-actions button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}


/* ============================================
   DISCORD WIDGET - RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .discord-widget {
        width: 95vw !important;
        max-width: 100% !important;
        right: 2.5vw !important;
        bottom: 10px !important;
    }
}


/* ============================================
   INFO MODAL - RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .modal-wrapper {
        width: 95vw !important;
        max-width: 100% !important;
        max-height: 85vh !important;
    }

    .modal-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .tab-btn {
        font-size: 0.8rem !important;
        padding: 8px 12px !important;
    }
}


/* ============================================
   MODAL - GENERAL RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .modal-content {
        width: 95% !important;
        max-width: 95vw !important;
        margin: 20px auto;
        padding: 24px 20px !important;
    }
}


/* ============================================
   FLOATING BUTTONS - RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .floating-buttons {
        bottom: 16px !important;
        right: 16px !important;
    }

    .floating-btn {
        width: 44px !important;
        height: 44px !important;
    }
}


/* ============================================
   TOAST NOTIFICATIONS - RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .toast-container {
        left: 16px !important;
        right: 16px !important;
        bottom: 16px !important;
    }

    .toast {
        min-width: unset !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}


/* ============================================
   UTILITY CLASSES FOR RESPONSIVE
   ============================================ */

/* Hide/Show based on breakpoints */
@media (max-width: 900px) {
    .hide-mobile { display: none !important; }
}
@media (min-width: 901px) {
    .show-mobile-only { display: none !important; }
}
@media (max-width: 600px) {
    .hide-small-mobile { display: none !important; }
}

/* Responsive text */
@media (max-width: 768px) {
    .responsive-text-sm { font-size: 0.875rem !important; }
    .responsive-text-xs { font-size: 0.75rem !important; }
}

/* Container padding on mobile */
@media (max-width: 768px) {
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ============================================
   SCROLL & ANIMATION PERFORMANCE MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Reduce heavy animations on mobile for performance */
    .warris-bg::before,
    .warris-bg::after {
        animation-duration: 40s !important;
    }

    .particles-container {
        display: none !important;
    }

    .grid-overlay {
        background-size: 30px 30px !important;
    }

    /* Reduce blur for performance */
    .noise-overlay {
        opacity: 0.02 !important;
    }
}

/* Force animations even when Windows animations are disabled */
/* WARRIS needs its animations to look professional */
@media (prefers-reduced-motion: reduce) {
    /* Override: keep all WARRIS animations running */
    .warris-bg::before,
    .warris-bg::after {
        animation-duration: 25s !important;
        animation-iteration-count: infinite !important;
    }
    .grid-overlay {
        animation-duration: 8s !important;
        animation-iteration-count: infinite !important;
    }
    .grid-overlay::before {
        animation-duration: 20s !important;
        animation-iteration-count: infinite !important;
    }
    /* Keep scroll behavior smooth */
    html { scroll-behavior: smooth !important; }
    /* Keep all transitions and animations alive */
    *, *::before, *::after {
        animation-duration: revert !important;
        animation-iteration-count: revert !important;
        transition-duration: revert !important;
        scroll-behavior: revert !important;
    }
    /* Re-enable specific critical animations */
    .fade-up, .slide-left, .slide-right, .scale-in {
        transition-duration: 0.8s !important;
    }
    .reviews-track {
        animation-duration: 40s !important;
        animation-iteration-count: infinite !important;
    }
    .fps-bar {
        transition-duration: 2s !important;
    }
    .ring-fill {
        transition-duration: 1.2s !important;
    }
    .mascot-float {
        animation-duration: 6s !important;
        animation-iteration-count: infinite !important;
    }
    .boost-arrow {
        animation-duration: 2s !important;
        animation-iteration-count: infinite !important;
    }
    .play-button {
        animation-duration: 2s !important;
        animation-iteration-count: infinite !important;
    }
    .online-dot {
        animation-duration: 2s !important;
        animation-iteration-count: infinite !important;
    }
}
