@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800&display=swap');

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
    /* Backgrounds */
    --bg-base:    #070b14;
    --bg-surface: #0d1120;
    --bg-card:    #111827;
    --bg-card-2:  #1a2235;
    --bg-hover:   #1e2a40;
    --bg-input:   #0f1828;

    /* Borders */
    --border:         rgba(255,255,255,0.07);
    --border-med:     rgba(255,255,255,0.12);
    --border-accent:  rgba(99,102,241,0.4);

    /* Accent (Indigo) */
    --accent:       #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #818cf8;
    --accent-dim:   rgba(99,102,241,0.15);
    --accent-glow:  rgba(99,102,241,0.3);

    /* Text */
    --text-1: #f0f4ff;
    --text-2: #8b9cc8;
    --text-3: #4a5275;

    /* Status colors */
    --green:   #10b981;
    --green-bg: rgba(16,185,129,0.12);
    --red:     #ef4444;
    --red-bg:  rgba(239,68,68,0.12);
    --yellow:  #f59e0b;
    --yellow-bg: rgba(245,158,11,0.12);

    /* Platform colors */
    --tiktok:    #fe2c55;
    --shopee:    #ee4d2d;
    --facebook:  #1877f2;
    --instagram: #e1306c;
    --line:      #06c755;
    --youtube:   #ff0000;

    /* Spacing & Shape */
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow:    0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-accent: 0 4px 24px rgba(99,102,241,0.25);

    /* Transitions */
    --tr: 0.2s ease;
    --tr-slow: 0.35s ease;

    /* Layout */
    --sidebar-w: 260px;
    --topbar-h: 64px;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-1);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--accent); }

img, video { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.text-muted  { color: var(--text-2); }
.text-tiny   { font-size: 12px; color: var(--text-3); }
.text-center { text-align: center; }

/* =============================================
   LAYOUT
   ============================================= */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.grid-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* Flex helpers */
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--tr);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card-2);
    color: var(--text-1);
    border-color: var(--border-med);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
    color: var(--text-1);
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-card-2);
    color: var(--text-1);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); width: 36px; height: 36px; justify-content: center; }

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--tr), box-shadow var(--tr);
}

.card:hover { border-color: var(--border-med); }

.card-glass {
    background: rgba(17,24,39,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-med);
    border-radius: var(--radius-lg);
}

.card-hover {
    cursor: pointer;
    transition: all var(--tr-slow);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-med);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    padding: 11px 16px;
    font-size: 15px;
    transition: border-color var(--tr), box-shadow var(--tr);
    outline: none;
}
.form-control::placeholder { color: var(--text-3); }
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Checkboxes */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-med);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    transition: all var(--tr);
    font-size: 14px;
    user-select: none;
}
.checkbox-item:hover { border-color: var(--border-accent); }
.checkbox-item input { display: none; }
.checkbox-item.checked {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent-light);
}

/* =============================================
   BADGES
   ============================================= */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red   { background: var(--red-bg);   color: var(--red);   }
.badge-accent { background: var(--accent-dim); color: var(--accent-light); }

/* =============================================
   PUBLIC NAVBAR
   ============================================= */
.pub-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7,11,20,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: var(--topbar-h);
}

.pub-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-1);
}

.nav-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

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

/* =============================================
   HERO / PAGE HEADERS
   ============================================= */
.hero {
    padding: 80px 24px 60px;
    text-align: center;
    background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,0.2) 0%, transparent 60%);
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 20px;
}
.hero h1 { margin-bottom: 16px; }
.hero p { color: var(--text-2); max-width: 500px; margin: 0 auto 32px; font-size: 16px; }

/* =============================================
   SEARCH BAR
   ============================================= */
.search-bar {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}
.search-bar input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-med);
    border-radius: 50px;
    color: var(--text-1);
    padding: 12px 20px 12px 48px;
    font-size: 15px;
    outline: none;
    transition: border-color var(--tr), box-shadow var(--tr);
}
.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-bar .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 18px;
    pointer-events: none;
}

/* =============================================
   PLATFORM FILTER TABS
   ============================================= */
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 24px;
    margin-bottom: 32px;
}
.filter-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--tr);
}
.filter-tab:hover { border-color: var(--border-med); color: var(--text-1); }
.filter-tab.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-light);
}

/* =============================================
   PRODUCT CARDS (Public)
   ============================================= */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--tr-slow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.product-thumbnail {
    aspect-ratio: 16/9;
    background: var(--bg-surface);
    overflow: hidden;
    position: relative;
}
.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-thumbnail img { transform: scale(1.05); }
.product-thumbnail .thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111827 0%, #1a2235 100%);
    font-size: 48px;
}

.product-info {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-1);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-desc {
    font-size: 13px;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-3);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.product-platforms { display: flex; gap: 6px; flex-wrap: wrap; }
.product-file-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--text-2);
}

/* =============================================
   MEDIA GRID (Public view)
   ============================================= */
.media-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all var(--tr-slow);
    group: true;
}
.media-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--border-med);
}

.media-thumb {
    aspect-ratio: 1;
    background: var(--bg-surface);
    overflow: hidden;
    position: relative;
}
.media-thumb img, .media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.media-card:hover .media-thumb img,
.media-card:hover .media-thumb video { transform: scale(1.08); }

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    transition: background var(--tr);
}
.media-card:hover .video-overlay { background: rgba(0,0,0,0.2); }
.play-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-size: 16px;
    backdrop-filter: blur(4px);
    transition: transform var(--tr);
}
.media-card:hover .play-icon { transform: scale(1.1); }

.media-card-info {
    padding: 12px 14px;
}
.media-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.media-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.media-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-med);
    background: var(--bg-card-2);
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--tr);
}
.media-action-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-light);
}
.media-action-btn.copied {
    background: var(--green-bg);
    border-color: var(--green);
    color: var(--green);
}

/* Media type icon in corner */
.media-type-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(8px);
}
.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-inner {
    display: flex;
    gap: 0;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-med);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.lightbox-overlay.active .lightbox-inner { transform: scale(1); }

.lightbox-media {
    flex: 1;
    min-width: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 80vh;
    position: relative;
}
.lightbox-media img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}
.lightbox-media video {
    max-width: 100%;
    max-height: 80vh;
}

.lightbox-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-card);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    border-left: 1px solid var(--border);
}
.lightbox-title {
    font-size: 16px;
    font-weight: 700;
    word-break: break-word;
}
.lightbox-meta { display: flex; flex-direction: column; gap: 8px; }
.lightbox-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-2);
}
.lightbox-meta-row span:last-child { color: var(--text-1); font-weight: 500; }
.lightbox-platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.lightbox-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--border-med);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-1);
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: background var(--tr);
}
.lightbox-close:hover { background: rgba(239,68,68,0.7); }

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(17,24,39,0.8);
    border: 1px solid var(--border-med);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-1);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--tr);
    z-index: 10;
}
.lightbox-nav-btn:hover { background: var(--bg-hover); }
.lightbox-nav-prev { left: 12px; }
.lightbox-nav-next { right: 12px; }
.lightbox-nav-btn:disabled { opacity: 0.3; cursor: default; }

/* =============================================
   ADMIN LAYOUT (Sidebar)
   ============================================= */
.admin-wrap {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    overflow-y: auto;
    transition: transform var(--tr-slow);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 0;
    margin-bottom: 28px;
}
.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.sidebar-brand-text { font-size: 16px; font-weight: 800; }
.sidebar-brand-sub { font-size: 11px; color: var(--text-3); font-weight: 400; }

.sidebar-nav { flex: 1; padding: 0 12px; }
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-3);
    padding: 0 8px;
    margin: 16px 0 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--tr);
    margin-bottom: 2px;
}
.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-1);
}
.sidebar-link.active {
    background: var(--accent-dim);
    color: var(--accent-light);
    font-weight: 600;
}
.sidebar-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}
.sidebar-link .nav-badge {
    margin-left: auto;
    background: var(--accent-dim);
    color: var(--accent-light);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-storage {
    padding: 16px;
    margin: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.sidebar-storage-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}
.storage-bar {
    background: var(--border);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.storage-bar-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.storage-bar-fill.warning { background: linear-gradient(90deg, var(--yellow), #f97316); }
.storage-bar-fill.danger  { background: linear-gradient(90deg, var(--red), #f97316); }
.storage-numbers { font-size: 11px; color: var(--text-3); }

.sidebar-footer {
    padding: 12px 12px 20px;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text-3); }

/* =============================================
   ADMIN CONTENT AREA
   ============================================= */
.admin-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    display: flex;
    flex-direction: column;
}
.page-title h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-3);
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb-sep { color: var(--text-3); }

.admin-main { padding: 32px; flex: 1; }

/* =============================================
   STAT CARDS
   ============================================= */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color var(--tr);
}
.stat-card:hover { border-color: var(--border-med); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.stat-icon.accent  { background: var(--accent-dim); }
.stat-icon.green   { background: var(--green-bg); }
.stat-icon.yellow  { background: var(--yellow-bg); }
.stat-icon.red     { background: var(--red-bg); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* =============================================
   STORAGE DASHBOARD CARD
   ============================================= */
.storage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.storage-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.storage-detail-bar {
    background: var(--border);
    border-radius: 100px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}
.storage-detail-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--accent) 0%, #8b5cf6 100%);
    position: relative;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.storage-detail-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}
.storage-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.storage-stat {
    background: var(--bg-card-2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid var(--border);
}
.storage-stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.storage-stat-value { font-size: 1.1rem; font-weight: 700; }

/* =============================================
   DRAG & DROP UPLOAD ZONE
   ============================================= */
.dropzone {
    border: 2px dashed var(--border-med);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--tr);
    background: var(--bg-input);
    position: relative;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.dropzone.dragover {
    transform: scale(1.01);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.dropzone-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    transition: transform var(--tr);
}
.dropzone:hover .dropzone-icon, .dropzone.dragover .dropzone-icon {
    transform: scale(1.1) translateY(-4px);
}
.dropzone-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}
.dropzone-sub { font-size: 13px; color: var(--text-2); }
.dropzone-sub em { color: var(--text-3); font-style: normal; }
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

/* =============================================
   UPLOAD QUEUE
   ============================================= */
.upload-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.upload-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}
.upload-item.success { border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.05); }
.upload-item.error   { border-color: rgba(239,68,68,0.4);  background: rgba(239,68,68,0.05); }

.upload-item-name { font-size: 13px; font-weight: 600; word-break: break-all; }
.upload-item-size { font-size: 12px; color: var(--text-3); }
.upload-progress-wrap {
    grid-column: 1 / -1;
    background: var(--border);
    border-radius: 100px;
    height: 4px;
    overflow: hidden;
}
.upload-progress-bar {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
}
.upload-item.success .upload-progress-bar { background: var(--green); width: 100%; }
.upload-item.error   .upload-progress-bar { background: var(--red); }
.upload-status { font-size: 12px; font-weight: 600; }
.upload-item.success .upload-status { color: var(--green); }
.upload-item.error   .upload-status { color: var(--red); }

/* =============================================
   MEDIA ADMIN GRID
   ============================================= */
.media-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.media-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--tr);
}
.media-admin-card:hover { border-color: var(--border-med); }
.media-admin-thumb {
    aspect-ratio: 1;
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
}
.media-admin-thumb img, .media-admin-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-admin-actions {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--tr);
}
.media-admin-card:hover .media-admin-actions { opacity: 1; }
.media-admin-info { padding: 10px 12px; }
.media-admin-name {
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.media-admin-size { font-size: 11px; color: var(--text-3); }

/* =============================================
   TABLE
   ============================================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: var(--bg-surface); }
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--tr); }
tbody tr:hover { background: var(--bg-hover); }
.table-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-surface);
}
.table-actions { display: flex; gap: 6px; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-med);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    transform: translateY(20px);
    transition: transform 0.2s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-2);
    font-size: 16px;
    transition: all var(--tr);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* =============================================
   FLASH / ALERTS
   ============================================= */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash-success { background: var(--green-bg);  border-color: rgba(16,185,129,0.3);  color: var(--green); }
.flash-error   { background: var(--red-bg);    border-color: rgba(239,68,68,0.3);   color: var(--red); }
.flash-warning { background: var(--yellow-bg); border-color: rgba(245,158,11,0.3);  color: var(--yellow); }
.flash-icon { font-weight: 700; font-size: 16px; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.auth-page {
    min-height: 100vh;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-image:
        radial-gradient(ellipse 60% 50% at 20% 30%, rgba(99,102,241,0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(139,92,246,0.08) 0%, transparent 50%);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-med);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}
.auth-logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 24px var(--accent-glow);
}
.auth-logo-title { font-size: 22px; font-weight: 800; }
.auth-logo-sub { font-size: 13px; color: var(--text-2); }
.auth-form button[type="submit"] { width: 100%; margin-top: 8px; padding: 13px; font-size: 15px; }

.auth-divider {
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
    margin: 16px 0;
}
.show-password-toggle {
    position: relative;
}
.show-password-toggle .form-control { padding-right: 48px; }
.toggle-pw-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color var(--tr);
}
.toggle-pw-btn:hover { color: var(--text-2); }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-2);
}
.empty-icon { font-size: 56px; margin-bottom: 16px; display: block; }
.empty-state h3 { margin-bottom: 8px; color: var(--text-1); }
.empty-state p { font-size: 14px; color: var(--text-2); margin-bottom: 24px; }

/* =============================================
   PRODUCT HEADER (Product Page)
   ============================================= */
.product-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 32px 0;
}
.product-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.product-header-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-surface);
    flex-shrink: 0;
}
.product-header-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-header-info h1 { font-size: 1.6rem; margin-bottom: 6px; }
.product-header-info p { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-med);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: all;
    animation: toastIn 0.3s ease;
    max-width: 320px;
}
.toast.toast-success { border-color: rgba(16,185,129,0.4); color: var(--green); }
.toast.toast-error   { border-color: rgba(239,68,68,0.4);  color: var(--red); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* =============================================
   MOBILE SIDEBAR TOGGLE
   ============================================= */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    color: var(--text-1);
    transition: all var(--tr);
}
.sidebar-toggle:hover { background: var(--bg-hover); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    backdrop-filter: blur(2px);
}
.sidebar-backdrop.active { display: block; }

/* =============================================
   PAGE SECTION HEADERS
   ============================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-title { font-size: 16px; font-weight: 700; }

/* =============================================
   UTILITY CLASSES
   ============================================= */
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =============================================
   FOOTER
   ============================================= */
.pub-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
    margin-top: auto;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeIn 0.4s ease forwards;
}
.animate-in-delay-1 { animation-delay: 0.05s; opacity: 0; }
.animate-in-delay-2 { animation-delay: 0.10s; opacity: 0; }
.animate-in-delay-3 { animation-delay: 0.15s; opacity: 0; }
.animate-in-delay-4 { animation-delay: 0.20s; opacity: 0; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    :root { --sidebar-w: 240px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .storage-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }

    /* Sidebar becomes off-canvas */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-toggle { display: flex; }
    .admin-content { margin-left: 0; }
    .admin-topbar { padding: 0 16px; }
    .admin-main { padding: 16px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .storage-stats-grid { grid-template-columns: 1fr; }
    .lightbox-inner { flex-direction: column; max-width: 100%; max-height: 100vh; }
    .lightbox-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 200px; }
    .auth-card { padding: 28px 20px; }
    .hero { padding: 48px 16px 32px; }
    .product-header-inner { flex-wrap: wrap; }
    .filter-tabs { padding: 0 16px; }
    .container { padding: 0 16px; }
}

@media (max-width: 480px) {
    .grid-auto { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .media-admin-grid { grid-template-columns: repeat(2, 1fr); }
}
