/* ============================================================
   Fashion DSMS — Global Stylesheet
   ============================================================
   Primary: #F23B77 | Secondary: #212529 | Background: #FFFFFF
   Font: Outfit (Google Fonts)
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
    --primary: #F23B77;
    --primary-light: #f75d94;
    --primary-dark: #d42a63;
    --primary-bg: rgba(242, 59, 119, 0.08);
    --secondary: #212529;
    --bg: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-card: #FFFFFF;
    --border: #E9ECEF;
    --text: #212529;
    --text-muted: #6C757D;
    --text-light: #ADB5BD;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
    --transition: all 0.2s ease;
    --font: 'Outfit', sans-serif;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg-light);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Sidebar Layout ──────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand img {
    height: 28px;
}

.sidebar-brand .brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
}

.sidebar-brand .brand-text span {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 12px 6px;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav .nav-link:hover {
    background: var(--bg-light);
    color: var(--text);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ─────────────────────────────────────────────── */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--secondary);
}

.topbar-left .breadcrumb-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Hamburger (mobile) ──────────────────────────────────── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text);
    cursor: pointer;
    padding: 4px 8px;
}

/* ── Page Content ────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 28px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background: rgba(40,167,69,0.1); color: var(--success); }
.stat-icon.warning { background: rgba(255,193,7,0.1); color: var(--warning); }
.stat-icon.info    { background: rgba(23,162,184,0.1); color: var(--info); }
.stat-icon.danger  { background: rgba(220,53,69,0.1); color: var(--danger); }

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    box-shadow: 0 4px 12px rgba(242, 59, 119, 0.3);
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 8px 18px;
    transition: var(--transition);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-draft             { background: #E9ECEF; color: #495057; }
.badge-in_review         { background: rgba(23,162,184,0.12); color: #117a8b; }
.badge-revision_requested { background: rgba(255,193,7,0.15); color: #856404; }
.badge-approved          { background: rgba(40,167,69,0.12); color: #1e7e34; }
.badge-rejected          { background: rgba(220,53,69,0.12); color: #bd2130; }
.badge-pending           { background: #E9ECEF; color: #495057; }
.badge-processing        { background: rgba(23,162,184,0.12); color: #117a8b; }
.badge-success           { background: rgba(40,167,69,0.12); color: #1e7e34; }
.badge-error             { background: rgba(220,53,69,0.12); color: #bd2130; }

/* ── Tables ──────────────────────────────────────────────── */
.table {
    font-size: 0.88rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom-width: 1px;
    padding: 12px 16px;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(242, 59, 119, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--secondary);
    margin-bottom: 6px;
}

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, #fff 100%);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card .auth-logo img {
    height: 32px;
    margin-bottom: 10px;
}

.auth-card .auth-logo h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

.auth-card .auth-logo h2 span {
    color: var(--primary);
}

.auth-card .auth-logo p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Sample Card (grid item) ─────────────────────────────── */
.sample-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.sample-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.sample-card .sample-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2.5rem;
}

.sample-card .sample-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sample-card .sample-body {
    padding: 14px 16px;
}

.sample-card .sample-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sample-card .sample-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Image Viewer with Annotations ───────────────────────── */
.render-viewer {
    position: relative;
    display: inline-block;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-light);
}

.render-viewer img {
    width: 100%;
    display: block;
}

.annotation-pin {
    position: absolute;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(242,59,119,0.4);
    transition: var(--transition);
    z-index: 10;
}

.annotation-pin:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

/* ── Version Timeline ────────────────────────────────────── */
.version-timeline {
    position: relative;
    padding-left: 28px;
}

.version-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.version-item {
    position: relative;
    padding-bottom: 20px;
}

.version-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary);
}

.version-item.inactive::before {
    background: var(--border);
    box-shadow: 0 0 0 2px var(--border);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.88rem;
    color: var(--text-light);
    max-width: 360px;
    margin: 0 auto 20px;
}

/* ── Activity Feed ───────────────────────────────────────── */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item .activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.activity-item .activity-text {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
}

.activity-item .activity-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Upload Dropzone ─────────────────────────────────────── */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-light);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.dropzone i {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.dropzone.dragover i {
    color: var(--primary);
}

.dropzone p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.dropzone .dropzone-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 6px;
}

/* ── Image Preview Thumbnail ─────────────────────────────── */
.img-preview-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

/* ── Overlay (sidebar mobile) ────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* ── Bottom Nav (mobile native-app feel) ─────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 1050;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav .bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.bottom-nav .bottom-nav-item i {
    font-size: 1.15rem;
}

.bottom-nav .bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav .bottom-nav-item:hover {
    color: var(--primary);
}

/* ── Loading Spinner ─────────────────────────────────────── */
.spinner-pink {
    color: var(--primary) !important;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    /* Show bottom nav on mobile */
    .bottom-nav {
        display: block;
    }

    /* Add bottom padding for bottom nav */
    .page-content {
        padding: 16px;
        padding-bottom: 80px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .topbar-left h1 {
        font-size: 1.1rem;
    }

    /* Stat cards stack nicely */
    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 28px 24px;
    }

    .page-content {
        padding: 12px;
        padding-bottom: 80px;
    }

    .sample-card .sample-img {
        height: 160px;
    }
}

/* ── Utility ─────────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.bg-primary-light { background: var(--primary-bg) !important; }
.border-primary { border-color: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm { font-size: 0.85rem; }
.fs-xs { font-size: 0.75rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ── Pulse animation for processing status ───────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
