/* Enhanced Responsive Styles for Team Crew Basketball League */

/* Very small devices */
@media (max-width: 420px) {
    /* Full mobile optimization */
    body {
        padding: 0;
        margin: 0;
        overflow-x: hidden;
    }
    
    .navbar {
        padding: 5px 10px;
        min-height: 60px;
    }
    
    .nav-tab {
        padding: 4px 6px;
        font-size: 0.7rem;
        margin: 1px;
        min-width: 60px;
        text-align: center;
    }
    
    .navbar-logo {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .navbar-logo img {
        height: 25px;
        margin: 0 auto;
    }
    
    /* Content adjustments with reduced spacing */
    .hero-content h1 {
        font-size: 1.8rem !important;
        line-height: 1.2;
        margin-bottom: 10px !important;
    }
    
    .team-grid, .coach-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
        padding: 5px;
    }
    
    .tournament-container {
        padding: 5px;
    }
    
    .tournament-tile {
        margin: 5px 0;
        padding: 10px;
    }
    
    .social-posts-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
        padding: 5px;
    }
}

/* Mobile (portrait phones) */
@media (max-width: 576px) {
    /* Full mobile responsiveness */
    * {
        box-sizing: border-box;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Navbar mobile optimization */
    .navbar {
        padding: 8px 10px;
        width: 100%;
    }
    
    .navbar-logo img {
        height: 35px;
    }
    
    .horizontal-nav {
        margin-top: 10px;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }
    
    .nav-tab {
        padding: 6px 8px;
        font-size: 0.75rem;
        margin: 2px;
        min-width: 70px;
        text-align: center;
    }
    
    .navbar .container {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
    }
    
    /* Content mobile optimization with reduced spacing */
    .hero-content h1 {
        font-size: 2rem !important;
        text-align: center;
        padding: 0 10px;
        margin-bottom: 10px !important;
    }
    
    .hero-content p {
        font-size: 1rem;
        text-align: center;
        padding: 0 10px;
        margin-bottom: 15px !important;
    }
    
    .hero-btns {
        flex-direction: column;
        gap: 8px;
        margin-top: 10px !important;
    }
    
    /* Reduce spacing for all content containers */
    .container {
        padding: 0 10px !important;
    }
    
    .teams-section, .coaching-section, .schedule-section, 
    .news-section, .contact-section, .merchandise-section {
        padding: 10px 0 !important;
    }
    
    .team-card, .coach-card {
        margin-bottom: 15px !important;
        padding: 10px !important;
    }
    
    .social-post-card {
        margin-bottom: 10px !important;
        padding: 10px !important;
    }
    
    .tournament-card {
        margin-bottom: 10px !important;
        padding: 10px !important;
    }
    
    /* Reduce banner padding */
    .banner-content {
        padding: 20px 10px !important;
    }
    
    /* Compact grade tabs */
    .grade-tabs {
        padding: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .grade-tab {
        padding: 8px 12px !important;
        margin: 2px !important;
    }
        padding: 0 15px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .game-teams {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Grid layouts for mobile */
    .team-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 15px;
        width: 100%;
    }
    
    .coach-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 15px;
        width: 100%;
    }
    
    .social-posts-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 15px;
        width: 100%;
    }
    
    /* Tournament tiles mobile */
    .tournament-container {
        padding: 15px;
        width: 100%;
    }
    
    .tournament-tile {
        width: 100%;
        margin: 15px 0;
        padding: 20px;
    }
    
    /* Form elements mobile */
    .contact-form {
        padding: 15px;
        width: 100%;
    }
    
    .contact-form input,
    .contact-form textarea {
        width: 100% !important;
        max-width: 100%;
    }
    
    /* Embedded store mobile */
    .embedded-store-frame {
        width: 100% !important;
        height: 600px !important;
        margin: 10px 0;
    }
    
    .game-vs {
        margin: 10px 0;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
    }
}

/* Small devices (landscape phones) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Horizontal Navbar styles for small devices */
    .navbar-logo img {
        height: 36px;
    }
    
    .horizontal-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .nav-tab {
        padding: 8px 12px;
        font-size: 0.85rem;
        margin: 2px;
    }
    
    /* Content styles */
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
}

/* Medium devices (tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Horizontal Navbar styles for tablets */
    .navbar-logo img {
        height: 38px;
    }
    
    .nav-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Content styles */
    .hero-content h1 {
        font-size: 3.5rem;
    }
}

/* Large devices (desktops) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Desktop navbar styles */
    .navbar-logo img {
        height: 40px;
    }
    
    .nav-tab {
        padding: 10px 15px;
    }
    
    /* Content styles */
    .hero-content h1 {
        font-size: 3.8rem;
    }
}

/* Extra large devices (large desktops) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Ensure navbar tabs have proper spacing on large screens */
    .horizontal-nav {
        margin-left: 20px;
    }
    
    .nav-tab {
        margin: 0 3px;
    }
}

/* Ensure gallery looks good on all devices */
@media (max-width: 767.98px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Prevent vertical stretching of cards on different screen sizes */
@media (max-width: 991.98px) {
    .row {
        row-gap: 30px;
    }
}

/* Ensure proper image sizes on mobile */
@media (max-width: 767.98px) {
    .team-preview-image,
    .news-image,
    .coach-image,
    .product-image {
        height: 180px;
    }
    
    /* Ensure tables scroll on mobile */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile padding adjustments */
    section {
        padding: 50px 0;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
}
