/* Whoknowher — Smooth Slate Theme (Eye-friendly) + Print Layout */
:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --bg-row-odd: #1e293b;
    --bg-row-even: #0f172a;
    --bg-row-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e1;
    --text-dim: #94a3b8;
    --accent-main: #38bdf8;
    --accent-dark: #0284c7;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --border-color: #334155;
    --border-bright: #38bdf8;
    --tokopedia: #03ac0e;
    --shopee: #ee4d2d;
    --tiktok: #000000;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.75);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
.top-bar {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.main-header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-badge {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 2px solid var(--accent-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-main) 0%, var(--accent-dark) 100%);
    box-shadow: 0 0 16px var(--accent-glow);
}

.brand-text h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-text span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}

.search-bar {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 11px 18px 11px 42px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-dim);
}

.search-bar input:focus {
    border-color: var(--accent-main);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-main);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-main);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    background: #7dd3fc;
    transform: translateY(-2px);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent-main);
    color: var(--accent-main);
}

/* Subfolder Nav Pills */
.subfolder-nav {
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    overflow-x: auto;
}

.subfolder-list {
    display: flex;
    gap: 8px;
    list-style: none;
    white-space: nowrap;
}

.subfolder-list a {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.subfolder-list a:hover,
.subfolder-list a.active {
    background: var(--accent-main);
    color: #0f172a;
    border-color: var(--accent-main);
    font-weight: 700;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Section Headings */
.section-header {
    margin: 32px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* 10 Category Circle Grid */
.category-grid-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 32px 18px;
}

@media (max-width: 992px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
}

.cat-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-main);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.cat-circle {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #fff;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.cat-item:hover .cat-circle {
    background: var(--accent-main);
    border-color: var(--accent-main);
    color: #0f172a;
    box-shadow: 0 0 20px var(--accent-glow);
}

.cat-circle svg {
    width: 42px;
    height: 42px;
}

.cat-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cat-count {
    font-size: 0.8rem;
    color: var(--accent-main);
    font-weight: 600;
}

/* Simulasi Preview Table */
.sim-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 40px;
}

.sim-toolbar {
    background: var(--bg-elevated);
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.sim-table {
    width: 100%;
    border-collapse: collapse;
}

.sim-row {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.sim-row:nth-child(even) {
    background-color: var(--bg-row-even);
}

.sim-row:nth-child(odd) {
    background-color: var(--bg-row-odd);
}

.sim-row:hover {
    background-color: var(--bg-row-hover);
}

.sim-cell-num {
    width: 44px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-main);
    padding: 16px 8px;
    vertical-align: top;
}

.sim-cell-thumb {
    width: 80px;
    padding: 12px 10px;
    vertical-align: middle;
}

.sim-thumb-box {
    width: 64px;
    height: 64px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sim-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sim-cell-info {
    padding: 12px 16px;
    vertical-align: middle;
}

.sim-cat-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-main);
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.sim-prod-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.sim-prod-name {
    font-weight: 600;
}

.mini-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 800;
}

.icon-spec { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-color); }
.icon-google { background: var(--bg-elevated); color: var(--accent-main); border: 1px solid var(--border-color); font-family: Georgia, serif; }

.badge-ready {
    background: var(--accent-dark);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Affiliate Marketplace Badges */
.affiliate-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.mp-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.mp-btn:hover { transform: translateY(-1px); opacity: 0.9; }
.mp-tokopedia { background-color: var(--tokopedia); }
.mp-shopee { background-color: var(--shopee); }
.mp-tiktok { background-color: var(--tiktok); border: 1px solid #334155; }
.mp-btn svg { width: 14px; height: 14px; fill: currentColor; }

.sim-select-dropdown {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    max-width: 100%;
    outline: none;
}
.sim-select-dropdown:focus { border-color: var(--accent-main); }

.sim-cell-qty {
    width: 110px;
    text-align: center;
    padding: 12px 10px;
}

.qty-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    background: var(--bg-main);
    color: var(--text-primary);
}

.sim-cell-unitprice {
    width: 140px;
    text-align: right;
    font-size: 0.86rem;
    color: var(--text-muted);
    padding: 12px 16px;
    white-space: nowrap;
}

.sim-cell-subtotal {
    width: 150px;
    text-align: right;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--accent-main);
    padding: 12px 20px;
    white-space: nowrap;
}

.sim-footer {
    padding: 20px 24px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.sim-note {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.sim-tdp-box {
    background: var(--bg-main);
    border: 1px solid var(--accent-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-main);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sim-grand-total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-grand-total span {
    color: var(--accent-main);
}

/* Filter Bar & Product Cards */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.brand-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.brand-pill {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
}

.brand-pill:hover,
.brand-pill.active {
    background: var(--accent-main);
    color: #0f172a;
    border-color: var(--accent-main);
    font-weight: 800;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.prod-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.prod-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-main);
    transform: translateY(-4px);
}

.prod-card-top {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.prod-card-img {
    width: 88px;
    height: 88px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-main);
}

.prod-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.prod-card-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-main);
    margin-top: 8px;
}

.prod-card-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mp-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mp-bar .mp-btn {
    flex: 1;
    justify-content: center;
    padding: 8px;
    font-size: 0.78rem;
}

.btn-sim-pick {
    width: 100%;
    justify-content: center;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.btn-sim-pick:hover {
    background: var(--accent-main);
    border-color: var(--accent-main);
    color: #0f172a;
}

/* Modal / Notification Toast */
.toast-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 999;
    display: none;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-main);
}

.toast-msg.error {
    border-left-color: #ef4444;
}

footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 60px;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-align: center;
}

/* -------------------------------------
   PRINT LAYOUT MODAL / STYLES 
   ------------------------------------- */

.print-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.print-modal-content {
    background: #ffffff; /* White background for print preview */
    color: #000000;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
}

.print-header {
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.print-header h1 {
    font-size: 1.8rem;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 5px;
}

.print-header p {
    color: #475569;
    font-size: 0.9rem;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.print-table th, .print-table td {
    border: 1px solid #cbd5e1;
    padding: 10px;
    text-align: left;
    font-size: 0.85rem;
}

.print-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
}

.print-table td.qty-col, .print-table td.price-col, .print-table td.subtotal-col {
    text-align: right;
}

.print-total-section {
    display: flex;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 15px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Actual Print CSS Rules */
@media print {
    body * {
        visibility: hidden;
    }
    .print-modal-content, .print-modal-content * {
        visibility: visible;
    }
    .print-modal-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        padding: 0;
        box-shadow: none;
        background: transparent;
    }
    .print-actions {
        display: none; /* Hide buttons when printing */
    }
}

@media (max-width: 768px) {
    .sim-table, .sim-table tbody, .sim-row, .sim-row td { display: block; width: 100%; }
    .sim-row { padding: 16px; }
    .sim-cell-num { display: inline-block; width: auto; padding: 0 0 10px 0; }
    .sim-cell-unitprice, .sim-cell-subtotal, .sim-cell-qty { text-align: left; width: auto; display: inline-block; padding: 6px 10px; }
}
