/* Responsive Design Fixes for HorizonsLife */

/* ===== MOBILE NAVIGATION FIXES ===== */
@media (max-width: 600px) {
    /* Navbar positioning fix */
    .navbar {
        width: 98% !important;
        top: 20px !important;
        padding: 0.5rem !important;
        transform: translateX(-50%) !important;
    }
    
    .navbar.scrolled {
        transform: translateX(-50%) translateY(-3px) !important;
    }
    
    /* Mobile menu fixes */
    .nav-menu {
        position: fixed !important;
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-top: 1px solid rgba(0, 153, 255, 0.2) !important;
        padding: 1rem 0 !important;
        transform: translateY(-100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
        z-index: 999 !important;
        display: block !important;
    }
    
    .nav-menu.active {
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Burger menu fixes */
    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        width: 30px !important;
        height: 25px !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        padding: 0 !important;
        z-index: 1001 !important;
    }
    
    .nav-toggle span {
        display: block !important;
        width: 100% !important;
        height: 3px !important;
        background: var(--white) !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px) !important;
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0 !important;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px) !important;
    }
    
    /* Hide desktop menu on mobile */
    .nav-menu:not(.active) {
        display: none !important;
    }
}

/* ===== SMALL MOBILE FIXES (≤480px) ===== */
@media (max-width: 480px) {
    /* Container spacing */
    .container {
        padding: 0 15px !important;
    }
    
    /* Hero section fixes */
    .hero-content {
        padding: 1rem !important;
        gap: 1.5rem !important;
        text-align: center !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-description {
        font-size: 0.9rem !important;
    }
    
    /* Button fixes */
    .btn {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.9rem !important;
        width: 100% !important;
        margin: 0.5rem 0 !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    /* Footer fixes */
    .footer-content {
        flex-direction: column !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    .footer-links {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .footer-links a {
        padding: 0.5rem 1rem !important;
        border-radius: 8px !important;
        background: rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(0, 153, 255, 0.1) !important;
        transition: all 0.3s ease !important;
        display: block !important;
    }
    
    .footer-links a:hover {
        background: rgba(0, 153, 255, 0.1) !important;
        border-color: rgba(0, 153, 255, 0.3) !important;
        transform: translateY(-2px) !important;
    }
    
    /* Grid fixes */
    .features-grid,
    .about-text,
    .join-steps,
    .contact-info,
    .quick-links-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Card fixes */
    .feature-card,
    .feature-item,
    .step,
    .contact-item,
    .quick-link-card {
        padding: 1.5rem !important;
        margin: 0 !important;
    }
    
    /* 404 page fixes */
    .error-visual {
        width: 150px !important;
        height: 150px !important;
    }
    
    .error-visual i {
        font-size: 3rem !important;
    }
    
    .error-message {
        font-size: 2rem !important;
    }
    
    .help-content {
        flex-direction: column !important;
        gap: 2rem !important;
    }
    
    .help-options {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .help-option {
        padding: 1rem !important;
    }
}

/* ===== TABLET FIXES (≤768px) ===== */
@media (max-width: 768px) {
    /* Leaderboard fixes */
    .route-tabs {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .route-tab {
        width: 100% !important;
        padding: 1rem !important;
    }
    
    .leaderboard-item {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }
    
    .player-info {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    .player-stats {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 1rem !important;
    }
    
    /* Team section fixes */
    .rank-members {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .member-card {
        padding: 1rem !important;
    }
    
    .player-head {
        width: 50px !important;
        height: 50px !important;
    }
    
    .player-name {
        font-size: 0.9rem !important;
    }
    
    .player-rank {
        font-size: 0.8rem !important;
    }
    
    /* Community stats fixes */
    .community-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-info .stat-number {
        font-size: 1.5rem !important;
    }
}

/* ===== LARGE TABLET FIXES (≤1024px) ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    .hero-content {
        grid-template-columns: 1fr 1fr !important;
        gap: 3rem !important;
        padding: 3rem 2rem !important;
    }
    
    .about-text {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    
    .join-steps {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
    }
    
    .contact-info {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
}

/* ===== FACTION PAGE FIXES ===== */
@media (max-width: 600px) {
    .faction-content-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .requirements-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .members-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .faction-symbol {
        width: 120px !important;
        height: 120px !important;
    }
    
    .faction-symbol i {
        font-size: 3rem !important;
    }
}

/* ===== ABOUT PAGE FIXES ===== */
@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .story-timeline {
        flex-direction: column !important;
        gap: 2rem !important;
    }
    
    .timeline-item {
        width: 100% !important;
        text-align: center !important;
    }
    
    .mission-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .features-showcase .features-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ===== GENERAL RESPONSIVE FIXES ===== */
@media (max-width: 600px) {
    /* Hide desktop elements on mobile */
    .nav-menu:not(.active) {
        display: none !important;
    }
    
    /* Ensure proper text wrapping */
    .player-name,
    .player-rank,
    .section-title,
    .hero-title {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Fix horizontal scrolling */
    body {
        overflow-x: hidden !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 15px !important;
    }
    
    /* Fix image scaling */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix button touch targets */
    .btn,
    .nav-link,
    .dropdown-item {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ===== PERFORMANCE FIXES ===== */
@media (max-width: 600px) {
    /* Reduce animations on mobile for better performance */
    .hero-logo-img,
    .particles,
    .minecraft-world {
        animation-duration: 2s !important;
    }
    
    /* Optimize backdrop filters */
    .navbar,
    .nav-menu,
    .feature-card,
    .content-card {
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
} 