/* public/css/admin-dashboard.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --bs-primary-rgb: 111, 66, 193;
    --bs-primary: #6f42c1;
    --sidebar-bg: #2c3e50;
    --sidebar-link-hover: #34495e;
    --body-bg: #f4f7fc;
    --sidebar-width: 260px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg);
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1030;
    background-color: var(--sidebar-bg);
    color: #ecf0f1;
    transform: translateX(calc(-1 * var(--sidebar-width)));
    transition: transform 0.3s ease-in-out;
}

.sidebar .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link {
    font-weight: 500;
    color: #bdc3c7;
    padding: 0.8rem 1.5rem;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--sidebar-link-hover);
    color: #fff;
    border-left-color: var(--bs-primary);
}

.sidebar .nav-link .bi {
    margin-right: 0.85rem;
    font-size: 1.1rem;
    width: 24px;
}

.sidebar .logout-btn {
    color: #e74c3c;
    border-color: #e74c3c;
}

.sidebar .logout-btn:hover {
    background-color: #e74c3c;
    color: #fff;
}

/* Main Content Styles */
.main-content {
    width: 100%;
    padding: 1rem;
    transition: margin-left 0.3s ease-in-out;
}

/* Mobile Header */
.mobile-header {
    display: flex; /* Ditampilkan oleh media query */
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 1020;
    margin: -1rem -1rem 1rem -1rem; /* Kompensasi padding */
}

/* =================================== */
/* === RESPONSIVE STYLES START HERE === */
/* =================================== */

/* Tampilan DESKTOP (Layar besar, > 992px) */
@media (min-width: 991.98px) {
    .sidebar {
        transform: translateX(0); /* Selalu tampilkan sidebar */
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .mobile-header {
        display: none; /* Sembunyikan header mobile di desktop */
    }
}

/* Tampilan TABLET & MOBILE (Layar kecil, < 992px) */
@media (max-width: 991.98px) {
    .sidebar.active {
        transform: translateX(0); /* Tampilkan sidebar saat aktif */
    }
}

/* Tampilan MOBILE (Layar sangat kecil, < 768px) */
@media (max-width: 767.98px) {
    /* Sembunyikan header tabel asli */
    .table thead {
        display: none;
    }

    /* Ubah setiap baris menjadi block/card */
    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: .5rem;
        padding: .5rem;
        background-color: #fff;
    }

    .table td {
        text-align: right;
        padding: .5rem;
        padding-left: 50%;
        position: relative;
        border: none;
    }

    /* Buat label dari header tabel menggunakan pseudo-element */
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: .5rem;
        width: 45%;
        padding-right: 1rem;
        text-align: left;
        font-weight: bold;
        color: #555;
    }

    /* Memberi label pada setiap kolom tabel */
    #pending-payment-table-body td:nth-of-type(1)::before { content: "Username"; }
    #pending-payment-table-body td:nth-of-type(2)::before { content: "No. WhatsApp"; }
    #pending-payment-table-body td:nth-of-type(3)::before { content: "Paket"; }
    #pending-payment-table-body td:nth-of-type(4)::before { content: "Tgl Beli"; }
    #pending-payment-table-body td:nth-of-type(5)::before { content: "Aksi"; }

    #member-table-body td:nth-of-type(1)::before { content: "No."; }
    #member-table-body td:nth-of-type(2)::before { content: "Username"; }
    #member-table-body td:nth-of-type(3)::before { content: "Email"; }
    #member-table-body td:nth-of-type(4)::before { content: "No. WhatsApp"; }
    #member-table-body td:nth-of-type(5)::before { content: "Jml Paket"; }
    #member-table-body td:nth-of-type(6)::before { content: "Aksi"; }

    #expired-member-table-body td:nth-of-type(1)::before { content: "No."; }
    #expired-member-table-body td:nth-of-type(2)::before { content: "Username"; }
    #expired-member-table-body td:nth-of-type(3)::before { content: "Paket Terakhir"; }
    #expired-member-table-body td:nth-of-type(4)::before { content: "Tgl Kedaluwarsa"; }
    #expired-member-table-body td:nth-of-type(5)::before { content: "Aksi"; }

    #non-member-table-body td:nth-of-type(1)::before { content: "No."; }
    #non-member-table-body td:nth-of-type(2)::before { content: "Username"; }
    #non-member-table-body td:nth-of-type(3)::before { content: "Email"; }
    #non-member-table-body td:nth-of-type(4)::before { content: "No. WhatsApp"; }
    #non-member-table-body td:nth-of-type(5)::before { content: "Aksi"; }

    #review-table-body td:nth-of-type(1)::before { content: "Username"; }
    #review-table-body td:nth-of-type(2)::before { content: "Rating"; }
    #review-table-body td:nth-of-type(3)::before { content: "Ulasan"; }
    #review-table-body td:nth-of-type(4)::before { content: "Aksi"; }
    
    .table td:last-child {
        text-align: center;
        padding-left: .5rem; /* Reset padding untuk kolom aksi */
    }
}
