/* ======================================
   MOBILE RESPONSIVE - ScoutIA
   Hamburger sidebar + full mobile layout
   ====================================== */

/* Hamburger button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.05);
}

/* Sidebar overlay - not used, close handled via document click */

/* ===== TABLET: 769px - 1024px ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-logo h1,
    .sidebar-logo span,
    .sidebar-logo > span,
    .nav-section-title,
    .nav-item span {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 1rem;
    }
    .main-content {
        margin-left: 70px;
    }
}

/* ===== MOBILE: < 768px ===== */
@media (max-width: 768px) {
    /* Show hamburger */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Sidebar: off-canvas drawer */
    .sidebar {
        width: 260px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200 !important;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Restore sidebar text when open */
    .sidebar.open .sidebar-logo h1,
    .sidebar.open .sidebar-logo span,
    .sidebar.open .sidebar-logo > span,
    .sidebar.open .nav-section-title,
    .sidebar.open .nav-item span {
        display: block !important;
    }
    .sidebar.open .nav-item {
        justify-content: flex-start !important;
        padding: 0.75rem !important;
    }

    /* Main content: full width */
    .main-content {
        margin-left: 0 !important;
    }

    /* Header */
    .header {
        padding: 0.75rem 1rem !important;
        gap: 8px;
    }
    .header-title {
        font-size: 1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-badge {
        display: none !important;
    }

    /* Content area */
    .content {
        padding: 1rem !important;
    }

    /* ---- Dashboard ---- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    .stat-card {
        padding: 1rem !important;
    }
    .stat-card-value {
        font-size: 1.5rem !important;
    }
    .stat-card-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.95rem !important;
    }
    .charts-grid,
    .tables-grid {
        grid-template-columns: 1fr !important;
    }
    .goals-grid {
        grid-template-columns: 1fr !important;
    }

    /* ---- Jogos ---- */
    .date-selector {
        gap: 0.4rem !important;
    }
    .date-btn {
        padding: 0.45rem 0.7rem !important;
        font-size: 0.75rem !important;
    }
    .date-picker {
        font-size: 0.8rem !important;
        padding: 0.45rem 0.75rem 0.45rem 2.2rem !important;
    }
    .league-filters {
        gap: 0.35rem !important;
    }
    .league-chip {
        padding: 0.35rem 0.65rem !important;
        font-size: 0.7rem !important;
    }
    .match-card-main {
        padding: 0.65rem !important;
        gap: 0.25rem !important;
    }
    .match-team-logo {
        width: 24px !important;
        height: 24px !important;
    }
    .match-team-name {
        font-size: 0.75rem !important;
    }
    .match-score {
        font-size: 1rem !important;
    }
    .match-center-info {
        min-width: 65px !important;
    }
    .league-group-header {
        padding-bottom: 0.5rem !important;
        gap: 0.5rem !important;
    }
    .league-group-logo {
        width: 22px !important;
        height: 22px !important;
    }
    .league-group-name {
        font-size: 0.85rem !important;
    }
    .stat-row {
        grid-template-columns: 35px 1fr auto 1fr 35px !important;
        gap: 0.35rem !important;
    }
    .stat-value-left,
    .stat-value-right {
        font-size: 0.7rem !important;
    }
    .stat-name {
        font-size: 0.65rem !important;
    }

    /* ---- Classificacao ---- */
    .leagues-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .league-card {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.8rem !important;
        gap: 0.5rem !important;
    }
    .league-card i {
        font-size: 0.85rem !important;
    }
    .league-header-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 1rem !important;
        gap: 0.75rem !important;
    }
    .league-header-logo {
        width: 44px !important;
        height: 44px !important;
    }
    .league-header-meta {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    .standings-table {
        min-width: 650px !important;
    }
    .standings-table thead th,
    .standings-table tbody td {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.75rem !important;
    }
    .team-cell img {
        width: 20px !important;
        height: 20px !important;
    }
    .team-cell span {
        font-size: 0.8rem !important;
    }
    .form-badge {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.55rem !important;
    }

    /* ---- Confronto ---- */
    .selector-card {
        padding: 1.25rem !important;
    }
    .selector-header h2 {
        font-size: 1.1rem !important;
    }
    .selector-header p {
        font-size: 0.8rem !important;
    }
    .teams-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .vs-divider {
        flex-direction: row !important;
    }
    .vs-badge {
        width: 40px !important;
        height: 40px !important;
        font-size: 0.85rem !important;
    }
    .team-display {
        min-height: 110px !important;
        padding: 1rem !important;
    }
    .team-display-logo {
        width: 48px !important;
        height: 48px !important;
    }
    .team-display-name {
        font-size: 0.95rem !important;
    }
    .btn-analyze {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.9rem !important;
        width: 100%;
        justify-content: center;
    }
    .search-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem !important;
        font-size: 0.85rem !important;
    }

    /* H2H match header */
    .match-header-card {
        padding: 1.25rem !important;
    }
    .match-header .match-team img {
        width: 48px !important;
        height: 48px !important;
    }
    .match-header .match-team-name {
        font-size: 0.9rem !important;
    }
    .match-center {
        padding: 0 0.5rem !important;
    }
    .match-total {
        font-size: 2rem !important;
    }
    .match-label {
        font-size: 0.7rem !important;
    }

    /* Probability bar */
    .probability-bar {
        height: 38px !important;
    }
    .prob-segment {
        font-size: 0.7rem !important;
        min-width: 40px !important;
    }
    .legend-value {
        font-size: 1.1rem !important;
    }
    .legend-label {
        font-size: 0.65rem !important;
    }

    /* Insights grid */
    .insights-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .insight-card {
        padding: 0.75rem 0.6rem !important;
    }
    .insight-value {
        font-size: 1.2rem !important;
    }
    .insight-label {
        font-size: 0.68rem !important;
    }

    /* Form grid */
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .form-card {
        padding: 1rem !important;
    }
    .form-badges {
        flex-wrap: wrap !important;
    }

    /* H2H match row list */
    .matches-card .match-row {
        padding: 0.6rem !important;
        gap: 0.25rem !important;
    }
    .matches-card .match-date {
        width: auto !important;
        font-size: 0.7rem !important;
    }

    /* Markets / Bet Builder */
    .markets-header h2 {
        font-size: 1rem !important;
    }
    .market-group-header {
        padding: 0.75rem 1rem !important;
    }
    .mg-title {
        font-size: 0.85rem !important;
    }
    .market-group-body {
        padding: 0 0.75rem 0.75rem !important;
    }
    .market-options {
        grid-template-columns: 1fr !important;
    }
    .market-options.score-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)) !important;
    }
    .market-row {
        grid-template-columns: 1fr !important;
    }
    .market-row .mr-label {
        padding: 0.4rem 0.75rem !important;
    }
    .market-row .mr-btns {
        border-left: none !important;
        border-top: 1px solid var(--border-color);
    }
    .market-btn {
        padding: 0.7rem 0.75rem !important;
    }

    /* ---- Team Profile ---- */
    .team-hero {
        flex-direction: column !important;
        text-align: center !important;
        padding: 1.25rem !important;
        gap: 1rem !important;
    }
    .team-hero-logo {
        width: 80px !important;
        height: 80px !important;
    }
    .team-hero-name {
        font-size: 1.4rem !important;
    }
    .team-hero-meta {
        justify-content: center !important;
        gap: 0.75rem !important;
        font-size: 0.78rem !important;
    }
    .team-leagues {
        justify-content: center !important;
    }
    .two-col {
        grid-template-columns: 1fr !important;
    }
    .league-selector {
        gap: 6px !important;
    }
    .league-tab {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }
    .league-tab img {
        width: 14px !important;
        height: 14px !important;
    }
    .match-row .match-date {
        width: 55px !important;
        font-size: 0.68rem !important;
    }
    .match-row .match-team .name {
        max-width: 70px !important;
        font-size: 0.75rem !important;
    }
    .match-row .match-score {
        font-size: 0.85rem !important;
        padding: 3px 6px !important;
        min-width: 40px !important;
    }
    .winrate-legend {
        gap: 0.75rem !important;
        font-size: 0.7rem !important;
        flex-wrap: wrap !important;
    }
    .goals-bar-label {
        width: 70px !important;
        font-size: 0.75rem !important;
    }
    .goals-bar-fill {
        font-size: 0.65rem !important;
    }

    /* ---- Times / Search ---- */
    .results-grid {
        grid-template-columns: 1fr !important;
    }
    .search-box input {
        padding: 14px 16px 14px 44px !important;
        font-size: 1rem !important;
    }

    /* ---- Lang selector ---- */
    .lang-current {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
    .lang-current img {
        width: 16px !important;
        height: 12px !important;
    }
    .lang-arrow {
        font-size: 0.5rem !important;
    }

    /* ---- Footer ---- */
    .site-footer {
        padding: 1.5rem 1rem 0.75rem !important;
        margin-top: 2rem !important;
    }
    .footer-inner {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
    }

    /* ---- Betslip full width ---- */
    .betslip {
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        border-radius: 12px 12px 0 0 !important;
    }
    .betslip-body {
        max-height: 300px !important;
    }

}

/* ===== VERY SMALL: < 400px ===== */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .insights-grid {
        grid-template-columns: 1fr !important;
    }
    .leagues-grid {
        grid-template-columns: 1fr !important;
    }
    .header-title {
        font-size: 0.9rem !important;
    }
    .probability-legend {
        gap: 0.5rem !important;
    }
    .legend-value {
        font-size: 1rem !important;
    }
}

/* ===== LEGAL PAGES ===== */
@media (max-width: 768px) {
    .legal-container,
    .about-container {
        padding: 1.5rem 1rem !important;
    }
    .legal-header h1 {
        font-size: 1.4rem !important;
    }
    .about-logo h1 {
        font-size: 1.8rem !important;
    }
    .about-logo img {
        width: 40px !important;
        height: 40px !important;
    }
    .features-grid {
        grid-template-columns: 1fr !important;
    }
}
