/* =====================================================
   MOBILE RESPONSIVE — GPM League
   Loaded AFTER all other CSS files.
   ===================================================== */

/* ============================
   HAMBURGER MENU BUTTON
   ============================ */
.nav-top-row {
    display: flex;
    justify-content: center; /* centered on desktop */
    align-items: center;
    width: 100%;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 200;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================
   TABLET (max-width: 1024px)
   ============================ */
@media (max-width: 1024px) {
    .container { padding: 0 15px; margin: 25px auto; }
    .admin-grid { grid-template-columns: 1fr 1fr !important; }
    .report-teams-grid { grid-template-columns: 1fr; }
    .report-scores-row { flex-direction: column; }
    .hero-split { gap: 40px; }
}

/* ============================
   MOBILE (max-width: 768px)
   ============================ */
@media (max-width: 768px) {

    /* --- HAMBURGER NAV --- */
    .hamburger { display: block; }
    .nav-top-row { justify-content: space-between; }

    .nav-content { padding: 0 15px; }
    .logo { font-size: 1.2rem; margin-bottom: 0; }

    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 4px;
        padding: 10px 0 5px;
        margin-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    .menu.menu-open {
        display: flex;
    }
    .menu li {
        padding: 10px 15px;
        font-size: 0.9rem;
        border-radius: 8px;
        text-align: left;
        width: 100%;
    }
    .menu li.active {
        transform: none;
    }

    /* --- LAYOUT --- */
    .container { padding: 0 10px; margin: 15px auto; }
    .content-section { padding: 10px 5px; }

    /* --- SECTION HEADERS --- */
    .section-header { margin-bottom: 15px; }
    .section-title { font-size: 1.3rem; }
    .title-underline { width: 40px; }

    /* --- HOME / HERO --- */
    .hero-split { flex-direction: column; gap: 20px; text-align: center; padding: 0; }
    .brand-left { order: 1; }
    .info-right { order: 2; align-items: center; text-align: center; }
    .brand-logo-full, .brand-logo-img { width: 180px !important; max-width: 60vw; margin: 0 auto; }
    .hero-headline { font-size: 1.4rem !important; }
    .season-badge-pill { font-size: 0.7rem; }
    .home-main-layout { padding: 0 5px; width: 100%; }

    .nav-cards-row { 
        flex-direction: column; 
        gap: 8px; 
        width: 100%;
    }
    .nav-glass-card {
        padding: 12px 15px !important;
        flex-direction: row !important;
        gap: 12px;
        min-height: auto !important;
    }
    .nav-glass-card .card-icon { font-size: 1.2rem; }
    .nav-glass-card .card-text h3 { font-size: 0.85rem; }

    .socials-row { gap: 8px; }
    .social-card-mini { font-size: 0.75rem; padding: 6px 10px; }

    /* --- TICKER --- */
    .teams-ticker-wrapper { height: 36px; }
    .ticker-label { font-size: 0.65rem; padding: 0 10px; }
    .hub-team-pill { font-size: 0.7rem; padding: 4px 8px; }
    .hub-team-pill img { width: 16px; height: 16px; }

    /* --- TABLES (horizontal scroll) --- */
    .table-wrapper, .table-responsive, .stats-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -5px;
        padding: 0 5px;
    }
    table { min-width: 550px; font-size: 0.78rem; }
    th { font-size: 0.65rem; padding: 6px 8px; }
    td { padding: 8px; }
    #standings-table-main { min-width: 600px; }

    /* --- STANDINGS LEGEND --- */
    .standings-legend, .bracket-legend {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }
    .legend-item { font-size: 0.7rem; }

    /* --- SCHEDULE --- */
    .matches-grid { grid-template-columns: 1fr !important; gap: 10px; }
    .match-card { padding: 12px; }
    .match-teams-row { flex-direction: column; gap: 8px; }
    .match-time-badge { font-size: 0.75rem; }
    .gpm-tabs { gap: 5px; flex-wrap: wrap; }
    .tab-btn { padding: 6px 12px; font-size: 0.75rem; }

    /* --- TEAMS GRID --- */
    .teams-grid-container { 
        grid-template-columns: 1fr 1fr !important; 
        gap: 8px !important; 
    }
    .team-btn-card {
        padding: 10px !important;
        min-height: auto !important;
    }
    .btn-team-logo { width: 28px !important; height: 28px !important; }
    .team-info-wrap { font-size: 0.75rem; }
    .stars-display { font-size: 0.65rem; }
    .free-agents-card { padding: 12px !important; }
    .free-agents-card h3 { font-size: 0.9rem; }
    .fa-logo { width: 24px !important; height: 24px !important; }

    /* --- TEAM DETAIL --- */
    .team-dashboard-grid { grid-template-columns: 1fr !important; gap: 10px; }
    .dashboard-sidebar { order: 2; }
    .dashboard-main { order: 1; }
    .dashboard-card { padding: 12px; }
    .team-banner-header { padding: 15px; }
    .team-header-logo { width: 50px !important; height: 50px !important; }
    .team-header-text h1 { font-size: 1.2rem; }
    .salary-cap-wrapper { margin: 10px 0; }
    #detail-name { font-size: 1.1rem !important; }

    /* --- STATS LAYOUT --- */
    .stats-grid-layout { flex-direction: column; gap: 15px; }
    .stats-main-col { order: 1; }
    .stats-sidebar-col { order: 2; }
    .sidebar-title { font-size: 0.9rem; }

    /* --- ADMIN PANEL --- */
    .admin-grid { grid-template-columns: 1fr !important; gap: 10px; }
    .admin-card { padding: 12px; }
    .admin-card h3 { font-size: 0.95rem; }
    .score-inputs-large input { width: 50px; font-size: 1.2rem; }
    .match-inputs { flex-direction: column; gap: 8px; }
    .match-inputs select { width: 100%; }
    .admin-visual-bracket { gap: 6px !important; }
    .admin-visual-bracket > div {
        flex: 1 1 80px !important;
        min-width: 80px !important;
        padding: 6px !important;
        font-size: 0.6rem;
    }
    #discord-user-bar, #gm-user-bar { 
        flex-wrap: wrap; 
        gap: 8px;
        padding: 10px;
    }
    #gm-user-bar a { margin-left: 0; margin-top: 5px; }

    /* --- GM PANEL --- */
    #gm-panel .admin-grid { grid-template-columns: 1fr !important; }
    .salary-track { height: 8px; }

    /* --- MATCH REPORT FORM --- */
    .report-scores-row { flex-direction: column; gap: 10px; }
    .report-teams-grid { grid-template-columns: 1fr; gap: 10px; }
    .report-score-inputs input { width: 50px; font-size: 1.2rem; }
    .report-player-stats { gap: 5px; }
    .report-stat-input { min-width: 42px; }
    .report-stat-input input { width: 42px; font-size: 0.8rem; }
    .report-stat-input label { font-size: 0.6rem; }
    .report-actions { flex-direction: column; gap: 8px; }
    .report-actions button { width: 100%; }

    /* --- ADMIN REPORT CARDS --- */
    .admin-report-meta { flex-direction: column; gap: 4px; }
    .admin-report-actions { flex-wrap: wrap; gap: 6px; }
    .admin-report-actions button { flex: 1; min-width: 80px; }
    .rdt-header, .rdt-row { font-size: 0.7rem; grid-template-columns: 1.5fr 0.5fr 0.5fr 0.5fr 1fr; }

    /* --- BRACKET --- */
    .bracket-scroll-wrapper { margin: 0 -10px; padding: 0 10px 15px; }
    .bracket-grid { min-width: 900px; gap: 0; }
    .bracket-round { min-width: 140px; }
    .bracket-round-title { font-size: 0.6rem; padding: 4px 8px; }
    .bracket-match { min-width: 130px; }
    .bracket-team-row { padding: 4px 6px; font-size: 0.7rem; }
    .bracket-team-name { max-width: 85px; font-size: 0.65rem; }
    .bracket-match-label { font-size: 0.55rem; }

    /* --- PLAYOFF BRACKET (old, if still present) --- */
    .tournament-bracket { flex-direction: column; gap: 15px; padding: 15px 5px; }
    .bracket-column { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
    .bracket-match { width: 180px; }

    /* --- MATCH REPORT DETAIL --- */
    .report-stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .report-header-content { flex-direction: column; gap: 10px; text-align: center; }
    .md-score { font-size: 1.5rem; }
    .md-team { font-size: 0.8rem; }
    .md-team img { width: 40px; height: 40px; }

    /* --- LOGIN --- */
    .login-card-styled { padding: 20px 15px; margin: 0 10px; }
    .login-header h3 { font-size: 1.1rem; }
    .btn-login { font-size: 0.9rem; padding: 10px 20px; }

    /* --- BUTTONS --- */
    .btn-primary, .btn-secondary, .btn-danger, .btn-warning {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    .btn-back-schedule { font-size: 0.8rem; padding: 8px 12px; }

    /* --- FORM INPUTS --- */
    .form-group input, .form-group select, .form-group textarea {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    .form-group label { font-size: 0.8rem; }

    /* --- VIDEO --- */
    .video-responsive-container { margin: 10px 0; }

    /* --- TOASTS --- */
    .toast-notification { 
        left: 10px; right: 10px; 
        width: auto; 
        font-size: 0.8rem;
    }
}

/* ============================
   SMALL PHONE (max-width: 480px)
   ============================ */
@media (max-width: 480px) {
    .logo { font-size: 1rem; }
    .menu li { font-size: 0.8rem; padding: 8px 12px; }
    .section-title { font-size: 1.1rem; }
    .hero-headline { font-size: 1.1rem !important; }
    .brand-logo-full, .brand-logo-img { width: 140px !important; }

    table { min-width: 480px; font-size: 0.72rem; }
    th { font-size: 0.6rem; padding: 5px 6px; }
    td { padding: 6px; }

    .teams-grid-container { grid-template-columns: 1fr !important; }

    .bracket-round { min-width: 120px; }
    .bracket-match { min-width: 110px; }
    .bracket-team-name { max-width: 70px; font-size: 0.6rem; }

    .nav-glass-card { padding: 10px 12px !important; }
    .nav-glass-card .card-text h3 { font-size: 0.8rem; }

    .admin-card h3 { font-size: 0.85rem; }
    .admin-visual-bracket > div { min-width: 70px !important; font-size: 0.55rem; }

    .report-stat-input { min-width: 38px; }
    .report-stat-input input { width: 38px; font-size: 0.75rem; }

    .teams-ticker-wrapper { display: none; }
    body { padding-bottom: 0 !important; }
}

/* ============================
   LANDSCAPE PHONE FIX
   ============================ */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar { padding: 8px 0; }
    .logo { font-size: 1rem; margin-bottom: 0; }
    .menu li { padding: 6px 12px; font-size: 0.75rem; }
    .hero-headline { font-size: 1rem !important; }
}
