/* ============================================================
   VintedIMS — Styles
   ============================================================ */

:root {
    --teal: #14b8a6;
    --teal-light: #2dd4bf;
    --coral: #f43f5e;
    --amber: #f59e0b;
    --bg: #09090b;
    --surface: #18181b;
    --border: #27272a;
    --text: #f4f4f5;
    --muted: #71717a;
}

* { box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

/* ── Typography ─────────────────────────────────────────── */
.font-display { font-family: 'Syne', sans-serif; }
.font-700 { font-weight: 700; }
.font-800 { font-weight: 800; }
.font-600 { font-weight: 600; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
}

/* ── Nav links ──────────────────────────────────────────── */
.nav-link {
    color: #71717a;
}
.nav-link:hover {
    background-color: #27272a;
    color: #e4e4e7;
}
.nav-link.active {
    background-color: rgba(20, 184, 166, 0.12);
    color: var(--teal);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--teal) 0%, #0d9488 100%);
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.3);
}
.btn-primary:active {
    transform: translateY(0);
}

/* ── Form inputs ────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.form-input {
    width: 100%;
    background-color: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #f4f4f5;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'DM Sans', sans-serif;
}
.form-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.form-input option {
    background-color: #18181b;
}

/* ── Stat cards ─────────────────────────────────────────── */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.stat-glow {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    right: -20px;
    top: -20px;
    filter: blur(30px);
    opacity: 0.4;
}
.stat-glow.teal { background: var(--teal); }
.stat-glow.coral { background: var(--coral); }
.stat-glow.amber { background: var(--amber); }

/* ── Skeleton loader ─────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #27272a 25%, #3f3f46 50%, #27272a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Item card ───────────────────────────────────────────── */
.item-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    animation: cardIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(8px);
}
.item-card:hover {
    border-color: #3f3f46;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.item-card.stale {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}
@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Status badges ───────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.status-warehouse { background: rgba(113,113,122,0.15); color: #a1a1aa; }
.status-listed { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-sold { background: rgba(20,184,166,0.15); color: #2dd4bf; }
.status-shipped { background: rgba(168,85,247,0.15); color: #c084fc; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-content {
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-overlay.hidden { display: none !important; }

/* ── Toast notifications ──────────────────────────────────── */
.toast {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: auto;
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.toast.removing {
    animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}
.toast-success { border-color: rgba(20,184,166,0.4); }
.toast-error { border-color: rgba(244,63,94,0.4); }
.toast-info { border-color: rgba(59,130,246,0.4); }

/* ── QR Reader custom ──────────────────────────────────────── */
#qr-reader video { border-radius: 0.75rem; }
#qr-reader__dashboard_section_csr button {
    background: var(--teal) !important;
    color: white !important;
    border: none !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
}

/* ── Label print area ──────────────────────────────────────── */
.label-card {
    background: white;
    color: black;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-family: monospace;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    break-inside: avoid;
}
.label-card .label-id {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.1em;
}
.label-card .label-name {
    font-size: 9px;
    color: #555;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── View transitions ──────────────────────────────────────── */
.view-content {
    animation: viewIn 0.25s ease forwards;
}
.view-content.hidden { display: none; }
@keyframes viewIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Finance bars ──────────────────────────────────────────── */
.finance-bar {
    height: 6px;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Print styles ──────────────────────────────────────────── */
@media print {
    body > *:not(.print-area-wrapper) { display: none !important; }
    .print-area-wrapper {
        display: block !important;
        position: fixed;
        inset: 0;
        background: white;
    }
    .print-area {
        display: grid !important;
        background: white;
        padding: 10mm;
    }
    .label-card {
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    header, .sidebar, #sidebarOverlay, #toastContainer { display: none !important; }
    #view-labels { display: block !important; }
    .no-print { display: none !important; }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* ── Drag over image area ─────────────────────────────────── */
#imageUploadArea.drag-over {
    border-color: var(--teal);
    background: rgba(20, 184, 166, 0.05);
}
