/* General Styling & Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

:root {
    --main-bg: #f7fafc;
    --sidebar-bg: #1a202c;
    --sidebar-text: #a0aec0;
    --sidebar-active: #4a5568;
    --accent-color: #e53e3e;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafc; /* <-- WARNA INI DIUBAH */
    color: #2C3E50; /* rabs-primary */
}

/* === INDEX.HTML SPECIFIC STYLES === */

.view {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}
.view.active {
    display: block;
}
.swiper-button-next, .swiper-button-prev {
    color: #ffffff;
}
.swiper-pagination-bullet-active {
    background-color: #E74C3C; /* rabs-accent */
}
.filter-buttons::-webkit-scrollbar {
    display: none;
}
.filter-buttons {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.thumbnail-active {
    border-color: #E74C3C; /* rabs-accent */
}
.modal {
    display: none;
}
.modal.flex {
    display: flex;
}

/* === ADMIN-DASHBOARD.EJS SPECIFIC STYLES === */

body.admin-dashboard {
    background-color: var(--main-bg);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-backdrop {
    background-color: rgba(0,0,0,0.5);
}
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.image-preview-item {
    position: relative;
    cursor: grab;
}
.image-preview-item img {
    width: 100px;
    height: 100px;
    object-cover;
    border-radius: 8px;
}
.remove-image-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 12px;
}

/* === CUSTOM NOTIFICATION (SHARED) === */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #2d3748; /* bg-gray-800 */
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
.custom-notification.show {
    opacity: 1;
    transform: translateY(0);
}
.custom-notification.error {
    background-color: var(--accent-color); /* Merah */
}

/* === Shopping Cart Panel === */
.cart-panel-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 49;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.cart-panel-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background-color: white;
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}
.cart-panel.active {
    transform: translateX(0);
}

/* === Cart Counter Badge === */
.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background-color: var(--accent-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(50%, -50%);
}

/* === Shopping Cart Panel === */
.cart-panel-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 49;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.cart-panel-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background-color: white;
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}
.cart-panel.active {
    transform: translateX(0);
}

/* === Cart Counter Badge === */
.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background-color: var(--accent-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(50%, -50%);
}

/* === Payment Popup Modal === */
.payment-modal-iframe {
    width: 100%;
    height: 80vh; /* Tinggi 80% dari viewport */
    border: none;
    border-radius: 0 0 0.5rem 0.5rem; /* Sudut bawah rounded */
}

/* === ADMIN-DASHBOARD PRODUCT CARD STYLING === */
.product-card.sold {
    opacity: 0.65;
    filter: grayscale(50%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.product-card.sold:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* === SOLD PRODUCT STYLING (FRONTEND) === */
.sold-card {
    cursor: default; /* Ubah cursor karena tidak bisa diklik */
}

.sold-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.6); /* Latar belakang putih transparan */
    backdrop-filter: grayscale(80%) blur(1px); /* Efek grayscale dan blur */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none; /* Agar tidak mengganggu event lain jika ada */
}

.sold-badge {
    background-color: #2C3E50; /* Warna rabs-primary */
    color: white;
    font-weight: 900; /* Extra bold */
    font-size: 1.25rem; /* Sedikit lebih besar */
    padding: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    letter-spacing: 0.1em;
    transform: rotate(-10deg); /* Efek miring */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* === LOADING SCREEN STYLES === */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Latar belakang putih solid */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out; /* Efek transisi saat menghilang */
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#spinner {
    width: 120px;
    height: 120px;
    border: 8px solid #e3e3e3;
    border-top-color: #1ABC9C; /* Warna brand (rabs-secondary) */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loader-logo {
    position: absolute;
    width: 80px;
    height: 80px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

    /* CSS untuk View Switcher */
    #product-view-container.view-grid .product-list-view { display: none; }
    #product-view-container.view-grid .product-grid-view { display: block; }
    #product-view-container.view-list .product-grid-view { display: none; }
    #product-view-container.view-list .product-list-view { display: block; }

    /* Style untuk tombol aktif */
    .view-switcher-btn.active {
        background-color: #e2e8f0; /* bg-gray-300 */
        color: #1a202c; /* text-gray-800 */
    }

/* === Filter Panel (Mobile) === */
.filter-panel-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 51; /* Lebih tinggi dari cart panel */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.filter-panel-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 320px;
    background-color: white;
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 52;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}
.filter-panel.active {
    transform: translateX(0);
}

/* === ADMIN DASHBOARD V2 STYLES === */

/* Sembunyikan konten tab secara default (kita pakai 'hidden' dari Tailwind) */
/* .tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
} */

/* Style untuk link sidebar yang aktif */
.tab-link.active {
    background-color: #3B82F6; /* admin-accent */
    color: white;
    font-weight: 600;
}

/* Notifikasi Kustom (jika Anda belum memilikinya) */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #1F2937; /* bg-gray-800 */
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
.custom-notification.show {
    opacity: 1;
    transform: translateY(0);
}
.custom-notification.error {
    background-color: #E74C3C; /* Merah */
}

/* === ADMIN DASHBOARD V2 STYLES === */
body.admin-dashboard {
    background-color: #f3f4f6; /* bg-gray-100 */
}

/* Style untuk link sidebar yang aktif */
.tab-link.active {
    background-color: #3B82F6; /* bg-blue-600 */
    color: white;
    font-weight: 600;
}

/* Badge Notifikasi */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: #EF4444; /* bg-red-500 */
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* === STYLING UNTUK SIDEBAR MOBILE RESPONSIVE === */
#admin-sidebar.sidebar-mobile-open {
    transform: translateX(0);
}

/* === STYLING UNTUK SIDEBAR MOBILE RESPONSIVE === */
#admin-sidebar.sidebar-mobile-open {
    transform: translateX(0);
}

/* === CUSTOM NOTIFICATION (CENTERED) === */
#custom-notification {
    /* Sembunyikan by default */
    display: none;
}
#custom-notification.show {
    /* Tampilkan sebagai flex (untuk centering) */
    display: flex;
}