/* ============================================
   TokoTutup - Dark Navy 3D Premium Theme
   ============================================ */

/* --- Tokens --- */
:root {
    --bg-deep: #060a14;
    --bg-base: #0a0f1e;
    --bg-card: rgba(12, 18, 36, 0.85);
    --bg-card-solid: #0c1224;
    --bg-glass: rgba(15, 25, 50, 0.55);
    --bg-hover: rgba(30, 50, 80, 0.4);
    --bg-input: rgba(10, 18, 35, 0.9);
    --accent: #3b82f6;
    --accent-bright: #60a5fa;
    --accent2: #8b5cf6;
    --accent3: #06b6d4;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --accent2-glow: rgba(139, 92, 246, 0.25);
    --cyan-glow: rgba(6, 182, 212, 0.2);
    --text: #e8edf5;
    --text-secondary: #94a3b8;
    --text-dim: #536378;
    --border: rgba(100, 130, 180, 0.1);
    --border-hover: rgba(100, 150, 220, 0.2);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 18px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --spring: cubic-bezier(.16, 1, .3, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Mesh gradient background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 15% 10%, rgba(59, 130, 246, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 85% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
    z-index: -2;
    pointer-events: none;
}

/* --- Dot grid overlay --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(100, 150, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: -1;
    pointer-events: none;
}

/* --- Grain texture --- */
.grain::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
    border-radius: inherit;
    z-index: 1;
}

/* --- Container --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* --- Premium scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 150, 220, 0.15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 150, 220, 0.3); }

/* === NAVBAR === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(6, 10, 20, 0.7);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
    padding: 0;
    transition: all 0.3s var(--spring);
}
.navbar.scrolled {
    background: rgba(6, 10, 20, 0.92);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.logo {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s var(--spring);
    position: relative;
}
.nav-links a:hover {
    color: var(--text);
    background: var(--bg-hover);
}
/* Mobile hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border: none;
    background: none;
}
.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* === HERO === */
.hero {
    padding: 120px 20px 60px;
    text-align: center;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.8rem;
    color: var(--accent-bright);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}
.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}
.hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #60a5fa 40%, #a78bfa 70%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === CATEGORY CARDS === */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 30px 0 60px;
}
.cat-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s var(--spring);
    transform-style: preserve-3d;
    perspective: 800px;
}
/* Gradient border glow */
.cat-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, transparent 30%, rgba(59,130,246,0.4) 50%, transparent 70%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}
/* Top accent bar */
.cat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    opacity: 0;
    transition: opacity 0.4s, left 0.4s, right 0.4s;
}
.cat-card:hover {
    transform: translateY(-6px) rotateX(2deg) rotateY(-1deg);
    box-shadow:
        0 8px 25px rgba(0,0,0,0.3),
        0 0 40px rgba(59,130,246,0.08);
    border-color: var(--border-hover);
}
.cat-card:hover::before { opacity: 1; }
.cat-card:hover::after { opacity: 1; left: 10%; right: 10%; }
.cat-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.cat-name {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.cat-count {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* === PRODUCT GRID === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
    padding: 24px 0 80px;
}
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.35s var(--spring);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--spring);
}
.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 20px rgba(59,130,246,0.06);
}
.product-card:hover::after { transform: scaleX(1); }
.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    flex: 1;
}
.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 4px;
}
.product-price::before { content: 'Rp '; font-size: 0.85rem; }

/* === FORM CARD === */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    max-width: 480px;
    margin: 80px auto 60px;
    position: relative;
    overflow: hidden;
}
.form-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
}
.form-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff, var(--accent-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 16px 0 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
input, select {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    transition: all 0.3s var(--spring);
}
input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(59,130,246,0.1);
}
input::placeholder { color: var(--text-dim); }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s var(--spring);
    text-decoration: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.2px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 4px 15px var(--accent-glow), 0 1px 3px rgba(0,0,0,0.2);
    width: 100%;
    margin-top: 24px;
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.12), rgba(0,0,0,0.08));
    pointer-events: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--accent-glow), 0 2px 6px rgba(0,0,0,0.2);
}
.btn-primary:active { transform: translateY(0); }
.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    border-radius: 8px;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-pending { background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-success { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.badge-failed { background: rgba(239,68,68,0.12); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }

/* === TABLE === */
.table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    white-space: nowrap;
}
th {
    color: var(--text-dim);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(0,0,0,0.15);
}

/* === PAGE HEADER === */
.page-header {
    padding: 90px 0 20px;
}
.page-header h1 {
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.5px;
}
.breadcrumb {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.breadcrumb a { color: var(--accent-bright); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* === STATUS PAGE === */
.status-icon { font-size: 3rem; margin-bottom: 12px; }
.status-order-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* === LOADING SPINNER === */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === FLOAT ANIMATION === */
@keyframes subtle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.float { animation: subtle-float 5s ease-in-out infinite; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(6, 10, 20, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 12px;
        gap: 4px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        opacity: 0;
        transition: all 0.4s var(--spring);
        pointer-events: none;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .nav-links a {
        padding: 14px 16px;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
    }
    .hero { padding: 100px 16px 40px; }
    .hero h1 { font-size: 2rem; letter-spacing: -1px; }
    .hero p { font-size: 0.95rem; }
    .categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 20px 0 40px;
    }
    .cat-card { padding: 22px 12px; }
    .cat-icon { font-size: 1.8rem; }
    .cat-name { font-size: 0.85rem; }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 16px 0 60px;
    }
    .product-card { padding: 14px; }
    .product-name { font-size: 0.82rem; }
    .product-price { font-size: 1.05rem; }
    .product-price::before { font-size: 0.75rem; }
    .form-card {
        margin: 70px 12px 40px;
        padding: 28px 20px;
        border-radius: var(--radius);
    }
    .page-header { padding: 76px 0 16px; }
    .page-header h1 { font-size: 1.5rem; }
    .table-wrap { border-radius: var(--radius-sm); }
    th, td { padding: 10px 12px; font-size: 0.8rem; }
}

@media (max-width: 400px) {
    .categories { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.7rem; }
}

/* === SCROLLBAR for mobile === */
@media (max-width: 768px) {
    ::-webkit-scrollbar { width: 3px; }
}

/* === SAFE AREA (notch) === */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar { padding-top: env(safe-area-inset-top); }
    .footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
