/* ============================================================
   FAZA SMM PANEL - Responsive Mobile Styles v1
   ============================================================ */

/* ============================================================
   BASE RESPONSIVE
   ============================================================ */

html { font-size: 16px; }
@media (max-width: 1024px) { html { font-size: 15px; } }
@media (max-width: 768px) { html { font-size: 14px; } }
@media (max-width: 480px) { html { font-size: 13px; } }

.container { padding: 0 24px; }
@media (max-width: 768px) { .container { padding: 0 16px; } }
@media (max-width: 480px) { .container { padding: 0 12px; } }

/* ============================================================
   MOBILE NAVBAR
   ============================================================ */

.mobile-menu-toggle {
    display: none; background: none; border: none; color: var(--text-primary);
    font-size: 1.5rem; cursor: pointer; padding: 8px; line-height: 1;
    z-index: 1001;
}

@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    
    .navbar .container { height: 60px; }
    .navbar-brand { font-size: 1.2rem; }
    .navbar-brand .brand-icon { width: 32px; height: 32px; font-size: 1rem; }
    
    .nav-links {
        position: fixed; top: 0; right: -280px; width: 280px; height: 100vh;
        background: var(--bg-card); flex-direction: column;
        padding: 80px 24px 24px; gap: 4px; z-index: 1000;
        border-left: 1px solid var(--border);
        transition: right .3s ease; box-shadow: -4px 0 20px rgba(0,0,0,.3);
    }
    .nav-links.mobile-open { right: 0; }
    .nav-links a {
        width: 100%; padding: 12px 16px; font-size: 1rem;
        border-radius: var(--radius-sm);
    }
    .nav-links .btn { justify-content: center; margin-top: 8px; }
    
    /* Mobile overlay */
    .nav-overlay {
        display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,.5); z-index: 999;
    }
    .nav-overlay.active { display: block; }
}

/* ============================================================
   MOBILE DASHBOARD SIDEBAR
   ============================================================ */

@media (max-width: 768px) {
    .dashboard-layout { padding-top: 60px; }
    
    .dashboard-sidebar {
        position: fixed; top: 0; left: -280px; width: 280px; height: 100vh;
        background: var(--bg-card); border-right: 1px solid var(--border);
        padding: 80px 16px 24px; z-index: 1001; transition: left .3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,.3);
    }
    .dashboard-sidebar.mobile-open { left: 0; }
    
    .dashboard-main { margin-left: 0; padding: 16px; }
    
    /* Mobile bottom nav bar */
    .mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--bg-card); border-top: 1px solid var(--border);
        padding: 8px 4px; z-index: 100; justify-content: space-around;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    .mobile-bottom-nav a {
        display: flex; flex-direction: column; align-items: center;
        gap: 2px; padding: 6px 8px; border-radius: var(--radius-sm);
        color: var(--text-muted); font-size: .6rem; font-weight: 600;
        text-decoration: none; transition: all .2s; min-width: 50px;
    }
    .mobile-bottom-nav a i { font-size: 1.2rem; }
    .mobile-bottom-nav a.active { color: var(--primary-light); }
    .mobile-bottom-nav a:hover { color: var(--text-primary); }
    
    .dashboard-main { padding-bottom: 80px; }
}

/* ============================================================
   HERO SECTION - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .hero { padding: 100px 0 40px; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: .95rem; margin-bottom: 24px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 280px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-number { font-size: 1.3rem; }
    .stat-card .stat-icon { font-size: 1.5rem; }
}

/* ============================================================
   SERVICE GRID - RESPONSIVE
   ============================================================ */

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

@media (max-width: 1024px) {
    .service-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
}

@media (max-width: 768px) {
    .service-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .service-card .service-img { height: 100px; }
    .service-card .service-body { padding: 12px; }
    .service-card .service-name { font-size: .85rem; }
    .service-card .service-price { font-size: .95rem; }
}

@media (max-width: 480px) {
    .service-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .service-card .service-img { height: 80px; font-size: 2rem!important; }
    .service-card .service-body { padding: 10px; }
    .service-card .service-name { font-size: .8rem; }
    .service-card .service-price { font-size: .85rem; }
    .service-card .service-min { font-size: .65rem; }
    .service-card .service-cat { font-size: .65rem; margin-bottom: 4px; }
}

/* ============================================================
   CATEGORY TABS - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .category-tabs {
        gap: 6px; padding-bottom: 4px; margin-bottom: 16px;
        -webkit-overflow-scrolling: touch;
    }
    .category-tab {
        padding: 8px 14px; font-size: .8rem;
    }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header h1 { font-size: 1.4rem; }
    .search-box { max-width: 100%; width: 100%; }
}

/* ============================================================
   MODAL - FULLSCREEN ON MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-content {
        max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 85vh;
    }
    .modal-header { padding: 20px 20px 0; }
    .modal-body { padding: 20px; }
    .modal-footer { padding: 12px 20px; }
    .modal-header h2 { font-size: 1.1rem; }
}

/* ============================================================
   AUTH PAGES - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .auth-page { padding: 16px; align-items: flex-start; padding-top: 80px; }
    .auth-box { padding: 28px; border-radius: var(--radius-lg); }
    .auth-box .auth-logo h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .auth-box { padding: 20px; }
}

/* ============================================================
   TABLES - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        margin: 0 -16px; padding: 0 16px;
    }
    .table { font-size: .8rem; min-width: 600px; }
    .table th, .table td { padding: 10px 12px; white-space: nowrap; }
    
    /* Card-based table for very small screens */
    .table-card-view { display: none; }
}

@media (max-width: 480px) {
    .table { min-width: 500px; }
}

/* ============================================================
   BALANCE CARD - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .balance-card { padding: 24px; border-radius: var(--radius-md); margin-bottom: 20px; }
    .balance-card .balance-amount { font-size: 1.8rem; }
    .balance-card .balance-actions { flex-wrap: wrap; }
    .balance-card .balance-actions .btn { flex: 1; min-width: 80px; justify-content: center; }
}

@media (max-width: 480px) {
    .balance-card { padding: 20px; }
    .balance-card .balance-amount { font-size: 1.5rem; }
}

/* ============================================================
   DASHBOARD STATS - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .dash-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
    .dash-stat { padding: 16px; }
    .dash-stat .dash-stat-icon { width: 32px; height: 32px; font-size: 1rem; }
    .dash-stat .dash-stat-number { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .dash-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dash-stat { padding: 12px; }
}

/* ============================================================
   DEPOSIT PAGE - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .deposit-page-grid { grid-template-columns: 1fr!important; }
    .deposit-options { grid-template-columns: 1fr; }
    .qris-preview { max-width: 200px; }
}

/* ============================================================
   ADMIN PANEL - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .dashboard-sidebar { width: 260px; position: fixed; left: -280px!important; }
    .dashboard-sidebar.mobile-open { left: 0!important; }
    .dashboard-main { margin-left: 0; padding: 16px; }
    .filter-row { flex-direction: column; gap: 8px; }
    .filter-row .search-box { max-width: 100%; width: 100%; }
    
    /* Inline admin nav */
    .admin-mobile-top {
        display: flex; overflow-x: auto; gap: 6px; padding: 8px 0;
        -webkit-overflow-scrolling: touch;
    }
    .admin-mobile-top a {
        flex-shrink: 0; padding: 8px 14px; border-radius: var(--radius-full);
        background: var(--bg-surface); border: 1px solid var(--border);
        color: var(--text-secondary); font-size: .8rem; font-weight: 600;
        text-decoration: none; white-space: nowrap;
    }
    .admin-mobile-top a.active {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white; border-color: transparent;
    }
}

/* ============================================================
   CARDS & SECTIONS - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .card-header { padding: 16px; }
    .card-header h3 { font-size: 1rem; }
    .card-body { padding: 16px; }
    .card-footer { padding: 12px 16px; }
    
    .glass-card { padding: 16px; }
    
    .section-title { font-size: 1.3rem; }
    
    .grid-2, .grid-3 { grid-template-columns: 1fr!important; gap: 12px!important; }
}

/* ============================================================
   ORDER ITEMS - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .order-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .order-item .order-info { width: 100%; }
    .order-item .order-status { align-self: flex-start; }
    .order-list { gap: 6px; }
}

/* ============================================================
   FOOTER - MOBILE
   ============================================================ */

@media (max-width: 768px) {
    footer { padding: 20px 16px!important; font-size: .8rem!important; }
}

/* ============================================================
   GENERAL RESPONSIVE UTILITIES
   ============================================================ */

@media (max-width: 768px) {
    .hide-mobile { display: none!important; }
    .text-center-mobile { text-align: center!important; }
    .gap-mobile { gap: 8px!important; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none!important; }
    .mobile-bottom-nav { display: none!important; }
}

/* ============================================================
   SAFE AREA NOTCH SUPPORT
   ============================================================ */

@supports (padding: env(safe-area-inset-bottom)) {
    .dashboard-main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
    .mobile-bottom-nav { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   LANDSCAPE PHONE FIXES
   ============================================================ */

@media (max-height: 480px) and (orientation: landscape) {
    .hero { padding: 80px 0 30px; }
    .hero h1 { font-size: 1.4rem; }
    .auth-page { padding-top: 60px; }
    .auth-box { padding: 16px; }
    .modal-content { max-height: 90vh; }
    .dashboard-sidebar { width: 200px; }
}

/* ============================================================
   TABLET (768-1024px)
   ============================================================ */

@media (min-width: 768px) and (max-width: 1024px) {
    .dashboard-sidebar { width: 220px; }
    .dashboard-main { margin-left: 220px; padding: 24px; }
    .service-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .hero h1 { font-size: 2.5rem; }
}
