/* assets/css/custom.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ========================================================
   THEME PALETTES & DAY/NIGHT VARIABLES
   ======================================================== */

/* 1. Default: Night Mode (Mode Malam - Obsidian / Deep Navy) */
:root, body, body:not(.light-mode) {
    --bg-page: #09090b;
    --bg-viewport: #111116;
    --bg-header: rgba(17, 17, 22, 0.94);
    --bg-nav: rgba(17, 17, 22, 0.96);
    --bg-card: #18181b;
    --bg-subcard: rgba(39, 39, 42, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.09);
    --card-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #172554 100%);
    --card-border: rgba(59, 130, 246, 0.3);
    --card-shadow: 0 12px 30px -5px rgba(37, 99, 235, 0.35);
    --active-nav: #38bdf8;
    --primary-btn: linear-gradient(135deg, #2563eb, #3b82f6);
}

/* 2. Light Mode (Mode Siang - Warna Cerah & Bersih Ala M-Banking Modern) */
body.light-mode {
    --bg-page: #edf2f7;
    --bg-viewport: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.96);
    --bg-nav: rgba(255, 255, 255, 0.97);
    --bg-card: #ffffff;
    --bg-subcard: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-gradient: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0284c7 100%);
    --card-border: rgba(255, 255, 255, 0.3);
    --card-shadow: 0 14px 28px -6px rgba(37, 99, 235, 0.35);
    --active-nav: #2563eb;
    --primary-btn: linear-gradient(135deg, #2563eb, #0284c7);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
    background-color: var(--bg-page);
    color: var(--text-primary);
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

/* Mobile Frame simulation on Desktop */
.mobile-viewport {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    background-color: var(--bg-viewport);
    border-color: var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wide-viewport {
    max-width: 1200px !important;
    margin: 0 auto;
}

/* M-Banking Gradient Card */
.mbanking-card {
    background: var(--card-gradient) !important;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--card-border) !important;
    box-shadow: var(--card-shadow) !important;
    transition: all 0.3s ease;
}

.mbanking-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.mbanking-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-nav) !important;
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 40;
    transition: max-width 0.3s ease, background 0.25s ease;
}

.wide-viewport ~ .bottom-nav,
body.is-wide .bottom-nav {
    max-width: 1200px;
}

/* Floating Action Button (Center Dock) */
.fab-center {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-btn) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fab-center:active {
    transform: translateX(-50%) scale(0.95);
}

/* Quick Action Circle Buttons */
.quick-action-btn {
    transition: transform 0.15s ease, filter 0.15s ease;
}
.quick-action-btn:active {
    transform: scale(0.92);
}

/* Active Nav indicator color dynamically */
.bottom-nav-item.active-nav-item {
    color: var(--active-nav) !important;
    font-weight: 700;
}

/* Pulse animation for low stock */
@keyframes alertPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}
.pulse-alert {
    animation: alertPulse 2s infinite ease-in-out;
}

/* ========================================================
   LIGHT MODE (MODE SIANG) OVERRIDES
   ======================================================== */
body.light-mode header {
    background-color: var(--bg-header) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-mode .text-slate-100 {
    color: #0f172a !important;
}
body.light-mode .text-slate-200 {
    color: #1e293b !important;
}
body.light-mode .text-slate-300 {
    color: #334155 !important;
}
body.light-mode .text-slate-400 {
    color: #64748b !important;
}
body.light-mode .text-slate-500 {
    color: #94a3b8 !important;
}

/* Light surface containers */
body.light-mode .bg-slate-900,
body.light-mode .bg-slate-900\/80,
body.light-mode .bg-slate-900\/90 {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.04);
}

body.light-mode .bg-slate-800,
body.light-mode .bg-slate-800\/50,
body.light-mode .bg-slate-800\/60,
body.light-mode .bg-slate-800\/70,
body.light-mode .bg-slate-800\/80 {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .bg-slate-700,
body.light-mode .bg-slate-700\/60,
body.light-mode .bg-slate-700\/70 {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
}

body.light-mode .border-slate-800,
body.light-mode .border-slate-800\/60,
body.light-mode .border-slate-800\/40,
body.light-mode .border-slate-700,
body.light-mode .border-slate-700\/40,
body.light-mode .border-slate-700\/50,
body.light-mode .border-slate-700\/60 {
    border-color: #e2e8f0 !important;
}

/* Modals in light mode */
body.light-mode .slide-up.bg-slate-900 {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    border-color: #2563eb !important;
    background-color: #ffffff !important;
}

/* Table rows in light mode */
body.light-mode .report-row:hover {
    background-color: #f8fafc !important;
}
body.light-mode tbody tr {
    border-color: #f1f5f9 !important;
}

/* Receipt Struk Digital */
.digital-receipt {
    background: #ffffff;
    color: #1e293b;
    position: relative;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.digital-receipt::before,
.digital-receipt::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--bg-viewport, #0f172a);
    border-radius: 50%;
    top: 60%;
}
.digital-receipt::before { left: -10px; }
.digital-receipt::after { right: -10px; }

.receipt-dash {
    border-bottom: 2px dashed #cbd5e1;
}

/* Print View Formatting */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .mobile-viewport {
        max-width: 100% !important;
        box-shadow: none !important;
        background: #ffffff !important;
        padding-bottom: 0 !important;
    }
    header, .bottom-nav, #view-mode-btn, .no-print, button {
        display: none !important;
    }
    .tab-page {
        display: block !important;
    }
}

/* Micro animations */
.slide-up {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-up-sheet {
    animation: slideUpSheet 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ========================================================
   SHOPEE POS & VISUAL SALES CATALOG STYLES
   ======================================================== */
.shopee-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}
.shopee-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -4px rgba(238, 77, 45, 0.18), 0 4px 8px -2px rgba(0, 0, 0, 0.1);
    border-color: rgba(238, 77, 45, 0.5);
}
.shopee-card:active {
    transform: scale(0.98);
}
.shopee-img-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: rgba(15, 23, 42, 0.6);
}
.shopee-img-box img {
    transition: transform 0.35s ease;
}
.shopee-card:hover .shopee-img-box img {
    transform: scale(1.06);
}
.shopee-badge-sale {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #f9532d, #ee4d2d);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(238, 77, 45, 0.4);
    letter-spacing: 0.3px;
    z-index: 2;
}
.shopee-btn-buy {
    background: linear-gradient(135deg, #f9532d, #ee4d2d);
    color: #ffffff;
    font-weight: 700;
    transition: all 0.2s ease;
}
.shopee-btn-buy:hover {
    background: linear-gradient(135deg, #ea421b, #d93816);
    box-shadow: 0 6px 14px rgba(238, 77, 45, 0.35);
}
.shopee-price-text {
    color: #ee4d2d !important;
    font-weight: 800;
}

/* Light mode specific for Shopee catalog */
body.light-mode .shopee-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
body.light-mode .shopee-card:hover {
    border-color: #f9532d !important;
    box-shadow: 0 10px 22px rgba(238, 77, 45, 0.15) !important;
}
body.light-mode .shopee-img-box {
    background-color: #f1f5f9;
}
body.light-mode #modal-shopee-order > div {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
body.light-mode #shopee-modal-name {
    color: #0f172a !important;
}
body.light-mode #modal-shopee-order .bg-slate-800,
body.light-mode #modal-shopee-order .bg-slate-900 {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-mode #modal-shopee-order input,
body.light-mode #modal-shopee-order select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
body.light-mode .shopee-channel-pill {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}
body.light-mode .shopee-channel-pill.active {
    background-color: #fff7ed !important;
    border-color: #f9532d !important;
    color: #ea580c !important;
}

.fade-in {
    animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
