/* =============================================
   ARTWORK CHECKER PRO - Cloud Edition
   Design System & Styles
   ============================================= */

:root {
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    min-height: 100vh;
}

/* ---- HEADER ---- */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left { display: flex; align-items: center; gap: 1.5rem; }

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo .accent { color: var(--primary); }
.logo .badge {
    font-size: 0.6rem;
    background: var(--success);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.realtime-dot {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    display: inline-block;
}
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

.header-right { display: flex; align-items: center; gap: 1rem; }

.stats-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ---- SEARCH BAR ---- */
.search-container {
    position: relative;
    width: 320px;
}
.search-container input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}
.search-container input:focus { border-color: var(--primary); }
.search-container svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px; height: 16px;
}

/* ---- CONFIG BANNER ---- */
.config-banner {
    background: var(--bg-card);
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
    align-items: end;
}
.config-field { flex: 1; }
.config-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}
.config-field input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    font-size: 0.85rem;
}
.config-field input:focus { border-color: var(--primary); }

/* ---- BUTTONS ---- */
.btn {
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger-light); }

/* ---- MAIN CONTENT ---- */
.main { padding: 1.5rem 2rem; max-width: 1800px; margin: 0 auto; }

/* ---- SKU GROUP ---- */
.sku-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s;
}
.sku-group:hover { box-shadow: var(--shadow-lg); }

/* ---- SKU SIDEBAR ---- */
.sku-sidebar {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border-right: 1px solid var(--border);
    padding-right: 1.5rem;
}
.sku-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ---- IMAGE BOXES (Checkerboard for transparency) ---- */
.image-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d4d8e0;
    background-image:
        linear-gradient(45deg, #bcc2cc 25%, transparent 25%),
        linear-gradient(-45deg, #bcc2cc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #bcc2cc 75%),
        linear-gradient(-45deg, transparent 75%, #bcc2cc 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}
.image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}
.image-box .label {
    position: absolute;
    top: 0; left: 0;
    background: var(--primary);
    padding: 3px 10px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    border-bottom-right-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mockup-container { display: flex; flex-direction: column; gap: 0.8rem; }

/* ---- CARDS SCROLL ---- */
.cards-scroll {
    flex: 1;
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.cards-scroll::-webkit-scrollbar { height: 5px; }
.cards-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ---- ORDER CARD ---- */
.order-card {
    flex: 0 0 330px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.order-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-artwork {
    height: 280px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d4d8e0;
    background-image:
        linear-gradient(45deg, #bcc2cc 25%, transparent 25%),
        linear-gradient(-45deg, #bcc2cc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #bcc2cc 75%),
        linear-gradient(-45deg, transparent 75%, #bcc2cc 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-artwork img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.size-info {
    background: #f1f5f9;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.size-ok { color: var(--success); }
.size-warn { color: var(--danger); background: var(--danger-light); }

.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.7rem;
}

.order-id { font-size: 0.95rem; font-weight: 800; }
.size-badge {
    font-size: 0.7rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.cs-note {
    background: var(--danger-light);
    border-left: 3px solid var(--danger);
    padding: 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    color: #991b1b;
}

.custom-info {
    background: #f8fafc;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    border: 1px solid var(--border);
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}
.card-actions .btn { flex: 1; justify-content: center; }

/* ---- MODAL ---- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15,23,42,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    width: 400px;
    box-shadow: var(--shadow-lg);
}
.modal h2 { color: var(--danger); margin-bottom: 1rem; font-size: 1.2rem; }
.modal textarea {
    width: 100%;
    height: 100px;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    resize: none;
    font-family: inherit;
}
.modal textarea:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 0.8rem; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* ---- HOVER PREVIEW ---- */
#hoverPreview {
    position: fixed;
    display: none;
    z-index: 9999;
    pointer-events: none;
    background: white;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
}
#hoverPreview img {
    max-width: 650px;
    max-height: 650px;
    object-fit: contain;
}

/* ---- LOADING ---- */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.85);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.loading-screen.active { display: flex; }
.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 36px; height: 36px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
}
.empty-state h2 { color: var(--text-main); margin-top: 1rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .header { padding: 0.5rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .main { padding: 1rem; }
    .sku-group { flex-direction: column; }
    .sku-sidebar { flex: none; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 1rem 0; }
    .search-container { width: 100%; }
}
