/* ============================================================
   XXPRONOHUB — Admin Panel Stylesheet
   Premium dark dashboard aesthetic
   ============================================================ */

.admin-body {
    background: var(--bg-0);
    min-height: 100vh;
}

/* ---------- HEADER ---------- */
.admin-header {
    background: rgba(11,14,22,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-1);
    position: sticky;
    top: 0;
    z-index: 40;
}
.admin-header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
    flex-wrap: wrap;
}

.admin-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-left: 20px;
}
.admin-nav a {
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--text-3);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all .2s var(--ease);
    white-space: nowrap;
}
.admin-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-1);
}
.admin-nav a.active {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 6px 18px rgba(236,72,153,0.35);
}

.admin-header__actions {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ---------- LAYOUT ---------- */
.admin-main {
    padding: 36px 24px 80px;
    position: relative;
    z-index: 1;
}
.admin-main h1 {
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-main h1::before {
    content: '';
    width: 5px;
    height: 30px;
    border-radius: 5px;
    background: var(--grad-primary);
    box-shadow: 0 0 20px rgba(236,72,153,0.5);
}

.admin-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border-1);
    color: var(--text-4);
    font-size: 0.85rem;
    margin-top: 60px;
}

/* ---------- LOGIN ---------- */
.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(800px 500px at 20% 0%, rgba(255,45,85,0.10), transparent 60%),
        radial-gradient(800px 500px at 80% 100%, rgba(59,130,246,0.10), transparent 60%);
    position: relative;
}
.admin-login-box {
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 40px 32px;
    animation: slideUp .5s var(--ease-bounce);
}
.admin-login-box h1 {
    margin: 20px 0 26px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    justify-content: center;
}
.admin-login-box h1::before { display: none; }
.admin-login-box form { text-align: left; }
.admin-login-box .logo { justify-content: center; }

/* ---------- STAT GRID ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.stat-card {
    background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
    border: 1px solid var(--border-1);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: all .3s var(--ease);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-3);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.stat-card span {
    color: var(--text-3);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.stat-card strong {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, #c3c9d8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card--highlight {
    border-color: rgba(236,72,153,0.4);
    background: linear-gradient(180deg, rgba(236,72,153,0.10), rgba(59,130,246,0.05));
    box-shadow: 0 0 0 1px rgba(236,72,153,0.15) inset, 0 12px 32px rgba(236,72,153,0.15);
}
.stat-card--highlight strong {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- QUICK ACTIONS ---------- */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

/* ---------- PAGE HEAD ---------- */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-head h1 { margin: 0; }

/* ---------- TABLE ---------- */
.table-wrap {
    overflow-x: auto;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table th, .table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-1);
    vertical-align: middle;
}
.table th {
    background: rgba(255,255,255,0.03);
    color: var(--text-3);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.82rem;
    color: var(--h-pink-2);
    background: rgba(236,72,153,0.08);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(236,72,153,0.15);
}

.table-thumb {
    width: 72px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-2);
}
.table-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-3);
    color: var(--text-4);
    font-size: 1.2rem;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.inline-form { display: inline; }

/* ---------- BADGES ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.badge--green, .badge--completed, .badge--active {
    background: rgba(16,185,129,0.12);
    color: #6ee7b7;
    border-color: rgba(16,185,129,0.30);
}
.badge--yellow, .badge--pending {
    background: rgba(245,158,11,0.12);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.30);
}
.badge--red, .badge--failed {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.30);
}
.badge--gray, .badge--expired, .badge--voided, .badge--inactive {
    background: rgba(148,163,184,0.10);
    color: #cbd5e1;
    border-color: rgba(148,163,184,0.25);
}

/* ---------- FILTER TABS ---------- */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-tabs a {
    padding: 8px 16px;
    border: 1px solid var(--border-1);
    border-radius: 999px;
    color: var(--text-3);
    font-size: 0.84rem;
    font-weight: 600;
    transition: all .2s var(--ease);
    background: rgba(255,255,255,0.02);
}
.filter-tabs a:hover {
    border-color: var(--border-3);
    color: var(--text-1);
    background: rgba(255,255,255,0.05);
}
.filter-tabs a.active {
    background: var(--grad-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 18px rgba(236,72,153,0.35);
}

/* ---------- FORM CARD ---------- */
.form-card {
    max-width: 780px;
    padding: 32px;
}
.form-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 24px 0 12px;
    color: var(--text-1);
    letter-spacing: -0.01em;
}
.form-card hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-2), transparent);
    margin: 28px 0 20px;
}

/* ---------- CURRENT INFO ---------- */
.current-info {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.current-info code {
    background: rgba(236,72,153,0.10);
    color: var(--h-pink-2);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.82rem;
}
.preview-thumb {
    width: 140px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-2);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
    .admin-header__inner {
        padding: 12px 0;
        min-height: auto;
    }
    .admin-nav {
        width: 100%;
        order: 3;
        margin-left: 0;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .admin-nav::-webkit-scrollbar { display: none; }
    .admin-header__actions { margin-left: auto; }
    .admin-main { padding: 24px 16px 60px; }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 1.35rem; }
    .form-card { padding: 24px 20px; }
    .table th, .table td { padding: 10px 12px; font-size: 0.82rem; }
    .table-thumb { width: 56px; height: 34px; }
    .quick-actions .btn { flex: 1 1 auto; }
}


/* ============================================================
   VIDEO UPLOAD UI
   ============================================================ */

.form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-1);
}
.form-section:last-of-type { border-bottom: 0; padding-bottom: 0; }

.form-section__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-2);
    letter-spacing: -0.01em;
}

.required { color: var(--x-red); }

/* ---------- Dropzone ---------- */
.dropzone {
    position: relative;
    border: 2px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    background: rgba(0,0,0,0.20);
    transition: all .25s var(--ease);
}
.dropzone.is-dragover {
    border-color: var(--h-pink);
    background: rgba(236,72,153,0.10);
    box-shadow: 0 0 0 4px rgba(236,72,153,0.15);
}
.dropzone.has-file {
    padding: 18px;
    border-style: solid;
    border-color: rgba(16,185,129,0.4);
    background: rgba(16,185,129,0.04);
}

/* Hide the actual file input — the visible <label> triggers it */
.dropzone__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.dropzone__icon {
    font-size: 2.4rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(236,72,153,0.35));
    line-height: 1;
}
.dropzone__text {
    font-size: 1rem;
    color: var(--text-2);
    margin-bottom: 14px;
    line-height: 1.5;
}
.dropzone__text strong { color: var(--text-1); display: block; }

/* THE VISIBLE BROWSE BUTTON — works on all devices */
.dropzone__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    min-height: 46px;
    background: var(--grad-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all .2s var(--ease);
    box-shadow: 0 8px 24px rgba(255,45,85,0.30);
    margin-bottom: 12px;
    text-decoration: none;
    border: 0;
    line-height: 1;
}
.dropzone__btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(255,45,85,0.45);
}
.dropzone__btn:active { transform: translateY(0) scale(0.98); }
.dropzone__btn:focus-visible {
    outline: 2px solid var(--h-pink);
    outline-offset: 3px;
}

.dropzone__hint { font-size: 0.78rem; display: block; }

/* ---------- Preview ---------- */
.dropzone__preview {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    position: relative;
    flex-wrap: wrap;
}
.dropzone__preview--thumb img {
    width: 100px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-2);
    background: #000;
}
.dropzone__player {
    width: 220px;
    max-width: 100%;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-2);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.dropzone__player video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 140px;
    background: #000;
}
.dropzone__preview-info { flex: 1; min-width: 0; }
.dropzone__preview-name {
    font-weight: 600;
    color: var(--text-1);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropzone__preview-meta { margin-top: 4px; font-size: 0.8rem; }
.dropzone__remove {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.30);
    color: #fca5a5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s var(--ease);
    flex-shrink: 0;
}
.dropzone__remove:hover {
    background: rgba(239,68,68,0.25);
    transform: rotate(90deg);
    color: white;
}

/* ---------- Checkbox ---------- */
.checkbox-label--big {
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-sm);
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
}
.checkbox-label--big input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--h-pink);
    flex-shrink: 0;
}
.checkbox-label--big span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.95rem;
    font-weight: 400;
}

/* ---------- Progress ---------- */
.upload-progress { margin: 22px 0; }
.upload-progress__bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.upload-progress__fill {
    height: 100%;
    width: 0%;
    background: var(--grad-primary);
    border-radius: 999px;
    transition: width .3s var(--ease);
    box-shadow: 0 0 12px rgba(236,72,153,0.6);
}

/* ---------- Overlay ---------- */
.upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.upload-overlay__box {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border-3);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    animation: slideUp .35s var(--ease-bounce);
}
.upload-overlay__box h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; }

/* ============================================================
   RESPONSIVE — works on 320px → 4K
   ============================================================ */
@media (max-width: 640px) {
    .dropzone { padding: 22px 14px; }
    .dropzone__icon { font-size: 2rem; }
    .dropzone__text { font-size: 0.94rem; }
    .dropzone__btn {
        width: 100%;
        padding: 14px 18px;
        font-size: 1rem;
        min-height: 50px;
    }
    .dropzone__preview { flex-direction: column; text-align: center; }
    .dropzone__player { width: 100%; }
    .dropzone__preview--thumb img { width: 100%; height: auto; max-height: 180px; }
    .dropzone__remove {
        position: absolute;
        top: -8px;
        right: -8px;
        background: rgba(239,68,68,0.9);
        color: white;
        box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    }
    .form-card { padding: 20px 16px; }
}

@media (max-width: 380px) {
    .dropzone__btn { font-size: 0.92rem; padding: 12px 14px; }
}