/* ============================================================
   QP COMMUNITY — shared theme
   Dark / glass / neon system used across every page of the CDN.
   ============================================================ */

:root {
    --qp-bg-1: #0f172a;
    --qp-bg-2: #05070d;
    --qp-glass: rgba(255, 255, 255, 0.04);
    --qp-glass-strong: rgba(255, 255, 255, 0.07);
    --qp-border: rgba(255, 255, 255, 0.1);
    --qp-text: #eef2ff;
    --qp-text-dim: rgba(238, 242, 255, 0.55);
    --qp-accent: #00ff9d;
    --qp-accent-2: #7c5cff;
    --qp-warn: #ffcc00;
    --qp-danger: #ff4d4d;
    --qp-radius: 18px;
    --qp-radius-sm: 10px;
    --qp-font: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.qp-body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, var(--qp-bg-1), var(--qp-bg-2));
    font-family: var(--qp-font);
    color: var(--qp-text);
    display: flex;
    flex-direction: column;
}

/* ---------- layout helpers ---------- */
.qp-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.qp-page {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px;
}

/* ---------- nav ---------- */
.qp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--qp-border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(5, 7, 13, 0.6);
}

.qp-logo {
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 16px;
    text-decoration: none;
    color: var(--qp-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.qp-logo span {
    background: linear-gradient(120deg, var(--qp-accent), var(--qp-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qp-nav-links { display: flex; gap: 10px; align-items: center; }

.qp-nav-links a, .qp-nav-links button {
    color: var(--qp-text-dim);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: var(--qp-radius-sm);
    transition: 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: var(--qp-font);
}

.qp-nav-links a:hover, .qp-nav-links button:hover {
    color: var(--qp-text);
    background: var(--qp-glass);
    border-color: var(--qp-border);
}

.qp-pill {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.15);
    color: #b8a8ff;
    border: 1px solid rgba(124, 92, 255, 0.3);
}

/* ---------- card ---------- */
.qp-card {
    width: 100%;
    max-width: 440px;
    padding: 30px;
    border-radius: var(--qp-radius);
    background: var(--qp-glass);
    border: 1px solid var(--qp-border);
    backdrop-filter: blur(18px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

.qp-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 157, 0.08), transparent 60%);
    animation: qp-rotate 8s linear infinite;
    pointer-events: none;
}

.qp-card > * { position: relative; }

@keyframes qp-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qp-panel {
    border-radius: var(--qp-radius);
    background: var(--qp-glass);
    border: 1px solid var(--qp-border);
    padding: 22px;
    margin-bottom: 20px;
}

/* ---------- text ---------- */
.qp-title { font-size: 20px; font-weight: 800; letter-spacing: 1px; margin: 0 0 4px; }
.qp-sub { font-size: 13px; color: var(--qp-text-dim); margin: 0 0 18px; }
.qp-code {
    font-size: 72px;
    font-weight: 900;
    background: linear-gradient(120deg, var(--qp-accent), var(--qp-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    margin-bottom: 10px;
}

/* ---------- form ---------- */
.qp-field { margin-bottom: 16px; text-align: left; }
.qp-field label {
    display: block;
    font-size: 12px;
    color: var(--qp-text-dim);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.qp-input, .qp-select {
    width: 100%;
    padding: 11px 13px;
    border-radius: var(--qp-radius-sm);
    border: 1px solid var(--qp-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--qp-text);
    font-size: 14px;
    font-family: var(--qp-font);
    outline: none;
    transition: 0.2s ease;
}

.qp-input:focus, .qp-select:focus {
    border-color: var(--qp-accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.12);
}

.qp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--qp-radius-sm);
    border: 1px solid rgba(0, 255, 157, 0.4);
    background: rgba(0, 255, 157, 0.12);
    color: var(--qp-accent);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
}

.qp-btn:hover { background: rgba(0, 255, 157, 0.2); box-shadow: 0 0 16px rgba(0, 255, 157, 0.25); }
.qp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.qp-btn-ghost {
    background: transparent;
    border-color: var(--qp-border);
    color: var(--qp-text-dim);
}
.qp-btn-ghost:hover { background: var(--qp-glass); color: var(--qp-text); box-shadow: none; }

.qp-btn-danger {
    background: rgba(255, 77, 77, 0.12);
    border-color: rgba(255, 77, 77, 0.4);
    color: var(--qp-danger);
}
.qp-btn-danger:hover { background: rgba(255, 77, 77, 0.22); box-shadow: 0 0 16px rgba(255, 77, 77, 0.25); }

.qp-btn-sm { width: auto; padding: 7px 12px; font-size: 12px; }

.qp-error {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    color: #ff8080;
    padding: 10px 12px;
    border-radius: var(--qp-radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}
.qp-error.show { display: block; }

.qp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--qp-border);
    padding: 12px 18px;
    border-radius: var(--qp-radius-sm);
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(10px);
    transition: 0.25s ease;
    pointer-events: none;
    z-index: 50;
}
.qp-toast.show { opacity: 1; transform: translateY(0); }
.qp-toast.error { border-color: rgba(255, 77, 77, 0.4); color: #ff8080; }
.qp-toast.ok { border-color: rgba(0, 255, 157, 0.4); color: var(--qp-accent); }

/* ---------- status bar (index.html) ---------- */
.bar { display: flex; gap: 4px; height: 52px; align-items: flex-end; margin-bottom: 18px; }
.block { width: 10px; height: 10px; border-radius: 4px; background: #2a2a2a; transition: 0.25s ease; }
.footer { display: flex; justify-content: space-between; font-size: 13px; align-items: center; }

.badge { padding: 5px 12px; border-radius: 10px; font-size: 11px; background: #222; transition: 0.3s; }
.online { background: rgba(0, 255, 140, 0.15); color: var(--qp-accent); box-shadow: 0 0 10px rgba(0, 255, 157, 0.3); }
.offline { background: rgba(255, 50, 50, 0.15); color: var(--qp-danger); box-shadow: 0 0 10px rgba(255, 77, 77, 0.3); }

/* ---------- upload dropzone ---------- */
.qp-drop {
    border: 2px dashed var(--qp-border);
    border-radius: var(--qp-radius);
    padding: 36px 20px;
    text-align: center;
    color: var(--qp-text-dim);
    cursor: pointer;
    transition: 0.2s ease;
    margin-bottom: 20px;
}
.qp-drop:hover, .qp-drop.drag { border-color: var(--qp-accent); background: rgba(0, 255, 157, 0.05); color: var(--qp-text); }

/* ---------- upload progress ---------- */
.qp-progress {
    border: 1px solid var(--qp-border);
    border-radius: var(--qp-radius);
    background: rgba(255, 255, 255, 0.02);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.qp-progress-top,
.qp-progress-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--qp-text-dim);
    gap: 10px;
}

.qp-progress-top { margin-bottom: 10px; }
.qp-progress-top #progName {
    color: var(--qp-text);
    font-size: 13px;
    word-break: break-all;
    max-width: 70%;
}
.qp-progress-top #progPct {
    color: var(--qp-accent);
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
}

.qp-progress-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--qp-border);
}

.qp-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--qp-accent), var(--qp-accent-2), var(--qp-accent));
    background-size: 200% 100%;
    box-shadow: 0 0 14px rgba(0, 255, 157, 0.5);
    transition: width 0.2s ease;
    animation: qp-flow 1.4s linear infinite;
}

@keyframes qp-flow {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.qp-progress-bottom #progSpeed { color: var(--qp-text); }
.qp-progress-bottom #progEta { color: var(--qp-accent); font-weight: 600; }

/* ---------- gallery ---------- */
.qp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.qp-file-card {
    border: 1px solid var(--qp-border);
    border-radius: var(--qp-radius-sm);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qp-file-preview {
    width: 100%;
    height: 120px;
    background: #05070d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--qp-text-dim);
    font-size: 11px;
    overflow: hidden;
}
.qp-file-preview img, .qp-file-preview video { width: 100%; height: 100%; object-fit: cover; }

.qp-file-meta { padding: 10px 12px; font-size: 11px; color: var(--qp-text-dim); }
.qp-file-name { font-size: 12px; color: var(--qp-text); word-break: break-all; margin-bottom: 4px; }
.qp-file-actions { display: flex; gap: 6px; padding: 0 12px 12px; }

/* ---------- table ---------- */
.qp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qp-table th, .qp-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--qp-border); }
.qp-table th { color: var(--qp-text-dim); font-weight: 600; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; }
.qp-table tr:last-child td { border-bottom: none; }
.qp-table td.qp-actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.qp-role-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.15);
    color: #b8a8ff;
    border: 1px solid rgba(124, 92, 255, 0.3);
}
.qp-role-badge.admin { background: rgba(255, 204, 0, 0.12); color: var(--qp-warn); border-color: rgba(255, 204, 0, 0.3); }

/* ---------- modal ---------- */
.qp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 13, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
}
.qp-modal-backdrop.show { display: flex; }
.qp-modal { width: 100%; max-width: 380px; margin: 20px; }

/* ---------- misc ---------- */
.qp-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.qp-empty { color: var(--qp-text-dim); font-size: 13px; text-align: center; padding: 30px 0; }
.qp-hidden { display: none !important; }

@media (max-width: 640px) {
    .qp-nav { padding: 12px 16px; }
    .qp-page { padding: 16px; }
    .qp-row { flex-direction: column; align-items: stretch; }
}
