/**
 * Admin Responsive CSS untuk Semua Layanan
 * Support: Desktop, Tablet, Mobile
 */

/* ========================================
   MOBILE TOGGLE BUTTON
   ======================================== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: none;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    transform: scale(1.05);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ========================================
   SIDEBAR BASE
   ======================================== */
.sidebar {
    position: fixed;
    z-index: 1000;
    width: 260px;
    min-height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
}

/* ========================================
   TABLET & MOBILE (max-width: 992px)
   ======================================== */
@media (max-width: 992px) {
    .mobile-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 20px !important;
        padding-top: 70px !important;
    }
    
    .footer-text,
    footer,
    .text-center.text-muted.py-3 {
        margin-left: 0 !important;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Forms */
    .form-control,
    .form-select {
        font-size: 16px !important;
    }
    
    /* Cards */
    .stat-card,
    .card-custom {
        margin-bottom: 15px;
    }
}

/* ========================================
   MOBILE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    /* Typography */
    h4, .h4 {
        font-size: 1.1rem;
    }
    
    /* Sidebar */
    .sidebar .brand {
        padding: 15px 20px;
        font-size: 1.1rem;
    }
    
    .sidebar .nav-link {
        padding: 10px 20px;
        margin: 3px 10px;
        font-size: 0.9rem;
    }
    
    /* Header area */
    .main-content > .d-flex.justify-content-between {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start !important;
    }
    
    /* Stat cards */
    .stat-card {
        padding: 15px;
    }
    
    .stat-card .number {
        font-size: 1.5rem;
    }
    
    .stat-card .label {
        font-size: 0.8rem;
    }
    
    .stat-card .icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    /* Cards */
    .card-body {
        padding: 15px;
    }
    
    .card-header {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    /* Tables */
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
        white-space: nowrap;
    }
    
    .table .btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    /* Filter forms */
    .card-body form.row {
        flex-direction: column;
        gap: 10px;
    }
    
    .card-body form.row > div {
        width: 100% !important;
        max-width: 100% !important;
        flex: none;
    }
    
    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    /* Alerts */
    .alert {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    /* Student items */
    .student-item {
        padding: 10px;
    }
    
    .student-item img,
    .student-photo {
        width: 35px;
        height: 35px;
    }
    
    .student-photo-placeholder,
    .placeholder-img {
        width: 35px;
        height: 35px;
    }
}

/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    .main-content {
        padding: 15px !important;
        padding-top: 65px !important;
    }
    
    /* Stats 2 columns */
    .row > .col-md-3 {
        width: 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Smaller text */
    .stat-card .number {
        font-size: 1.3rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    /* Hide action text */
    .btn .btn-text {
        display: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .sidebar,
    .mobile-toggle,
    .sidebar-overlay,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
}
