/* Responsive Styles */

/* Large desktop (1200px+) - default styles in component CSS */

/* Medium desktop / Small laptop */
@media (max-width: 1200px) {
    .combined-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Charts grid responsive */
@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .combined-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop - ensure nav menu is visible */
@media (min-width: 769px) {
    .nav-menu {
        display: flex !important;
    }

    .hamburger-btn {
        display: none !important;
    }
}

/* Tablet and mobile */
@media (max-width: 768px) {
    .nav-inner {
        padding: 0 12px;
    }

    /* Hide desktop nav menu, show hamburger */
    .nav-menu {
        display: none !important;
    }

    /* Show hamburger button */
    .hamburger-btn {
        display: flex !important;
    }

    /* Hide all nav action buttons on mobile (logout available in mobile menu) */
    .nav-actions .btn-secondary {
        display: none !important;
    }

    .lang-switcher {
        display: none;
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

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

    .modal-content {
        width: 95% !important;
        max-height: 90vh !important;
        margin: 20px;
    }

    .main {
        padding: 16px;
    }

    .card {
        padding: 16px;
    }

    .api-input {
        min-width: 100%;
    }

    .performer-cards,
    .combined-performer-cards {
        grid-template-columns: 1fr;
    }

    /* Table responsive - horizontal scroll */
    .table-container {
        font-size: 13px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th, td {
        padding: 8px 12px;
        white-space: nowrap;
    }

    /* Make first column sticky on tables */
    .users-table th:first-child,
    .users-table td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 1;
    }

    /* Date presets wrap better */
    .date-presets {
        justify-content: flex-start;
    }

    .date-preset-btn {
        flex: 0 1 auto;
    }

    /* Combined dashboard adjustments */
    .combined-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-date-info {
        flex-direction: column;
        align-items: flex-start !important;
    }

    /* Help page adjustments */
    .help-controls {
        flex-direction: column;
        gap: 12px;
    }

    .help-categories {
        flex-wrap: wrap;
    }

    .help-grid {
        grid-template-columns: 1fr;
    }
}

/* Large mobile */
@media (max-width: 600px) {
    .combined-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-secondary {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modal tabs scroll horizontally */
    .modal-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .modal-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Performer card stats */
    .performer-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .filters-grid {
        grid-template-columns: 1fr !important;
    }

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

    .combined-stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-actions {
        gap: 8px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Ensure minimum touch targets */
    .btn,
    .nav-link,
    .date-preset-btn,
    .help-category-btn,
    input[type="checkbox"],
    select {
        min-height: 44px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 10px;
    }

    .modal-stats {
        grid-template-columns: 1fr 1fr;
    }

    /* Card header adjustments */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-title {
        font-size: 16px;
    }

    /* Page headers */
    .combined-page-title,
    .help-page-title {
        font-size: 20px;
    }

    /* Actions row stack */
    .actions-row {
        flex-direction: column;
    }

    .actions-row .btn {
        width: 100%;
        justify-content: center;
    }

    /* Sales stat cards */
    .sales-stat-value {
        font-size: 20px;
    }

    /* Help page */
    .help-search-input {
        width: 100%;
    }

    .help-category-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Very small mobile */
@media (max-width: 360px) {
    .main {
        padding: 12px;
    }

    .card {
        padding: 12px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 18px;
    }

    /* Hide some secondary info on very small screens */
    .stats-secondary {
        display: none;
    }

    .performer-card .performer-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Print styles */
@media print {
    .nav,
    .loading-overlay,
    .modal-overlay,
    .mobile-menu,
    .mobile-menu-overlay,
    .hamburger-btn,
    .status,
    .btn,
    .lang-switcher {
        display: none !important;
    }

    .main {
        max-width: 100%;
        padding: 0;
    }

    .card {
        border: none;
        box-shadow: none;
        break-inside: avoid;
    }

    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page {
        display: block !important;
    }
}
