/**
 * G-Class Dashboard Responsive Styles
 */

/* Tablet Landscape */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        grid-template-areas: none !important;
    }
    .dashboard-grid > * {
        grid-column: 1 / -1 !important;
        grid-area: auto !important;
        width: 100% !important;
        min-width: 0; /* prevent wide min-content children (.h-scroll-container) from stretching the 1fr grid track */
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    html {
        overflow-x: hidden; /* safety net: block page-level horizontal scroll */
    }
    body {
        overflow-x: hidden;
    }
    .dashboard-tabs {
        max-width: 100%;
        min-width: 0;
    }
    html { font-size: 13px; }
    .site-header {
        position: relative;
    }
    .header-inner { flex-wrap: wrap; }
    .header-search { order: 3; width: 100%; margin-top: 8px; }
    .header-search .search-input { width: 100%; }
    .header-actions { gap: 4px; }
    .header-actions .btn { padding: 4px 8px; font-size: 0.8rem; }
    .nav-toggle {
        display: block;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        position: absolute;
        right: 15px;
        top: 15px;
        z-index: 1001;
    }
    .nav-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: #fff;
        margin: 5px 0;
        transition: all 0.3s;
    }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg, #1A237E);
        padding: 20px;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        gap: 0;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-menu li a { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .hero-section,
    .dashboard-hero {
        padding: 30px 15px;
    }
    .hero-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .hero-stat-card { padding: 12px; }
    .stat-icon { font-size: 1.5rem; }
    .stat-value { font-size: 1.2rem; }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .tab-header { overflow-x: auto; flex-wrap: nowrap; }
    .tab-btn { white-space: nowrap; padding: 8px 12px; font-size: 0.8rem; }
    .ranking-widget { position: static; }
    .h-scroll-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .posts-grid,
    .dashboard-posts-grid { grid-template-columns: 1fr; }
    .dash-card-grid { grid-template-columns: 1fr 1fr; }
    .circle-icons-grid { grid-template-columns: repeat(4,1fr); gap: 8px; }
    .circle-icon { width: 48px; height: 48px; font-size: 1.2rem; }
    .footer-widgets { grid-template-columns: 1fr; }
    .footer-stats { flex-wrap: wrap; gap: 16px; }
    .footer-stats .stat-item { flex: 0 0 calc(50% - 8px); }
    .dashboard-page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .dashboard-filters { width: 100%; }
    .filter-search,.filter-sort { flex: 1; }
    .single-header .post-title { font-size: 1.5rem; }
    .dashboard-meta { flex-wrap: wrap; gap: 8px; }
    .post-actions { flex-direction: column; }
    .post-actions .btn { text-align: center; }
    .data-table { font-size: 0.8rem; }
    .data-table th,.data-table td { padding: 6px; }
    .text-list-item { flex-wrap: wrap; }
    .btn-list { width: 100%; text-align: center; margin-top: 8px; }
    .sidebar-right {
        display: block;
        width: 100%;
    }
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    .hero-section h1,
    .dashboard-hero h1 {
        font-size: 1.5rem;
    }
    .section-title {
        font-size: 1.2rem;
    }
    .hero-stats-grid { grid-template-columns: 1fr; }
    .dash-card-grid { grid-template-columns: 1fr; }
    .circle-icons-grid { grid-template-columns: repeat(2,1fr); }
    .h-scroll-item { flex: 0 0 120px; }
    .scroll-thumb { width: 120px; height: 120px; }
    .dashboard-tabs {
        flex-wrap: wrap;
    }
    .dashboard-tabs button {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}
