/* ============================================================
   PixelVault — Dark UI · Orange accent (#ff5a00) · Glassmorphism
   ============================================================ */

:root {
    --bg:        #050505;
    --bg-2:      #0a0a0c;
    --panel:     rgba(20, 20, 24, 0.55);
    --panel-2:   rgba(28, 28, 34, 0.75);
    --border:    rgba(255, 255, 255, 0.08);
    --border-2:  rgba(255, 255, 255, 0.14);
    --text:      #eef0f2;
    --muted:     #9aa0a6;
    --accent:    #ff5a00;
    --accent-2:  #ff7a2c;
    --accent-soft: rgba(255, 90, 0, 0.15);
    --danger:    #ff4d5a;
    --ok:        #29d391;
    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 20px 60px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    color: var(--text);
    font-family: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    background:
        radial-gradient(1200px 600px at 12% -10%, rgba(255, 90, 0, 0.22), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(255, 90, 0, 0.10), transparent 55%),
        linear-gradient(180deg, #050505 0%, #08080a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    letter-spacing: 0.1px;
    -webkit-font-smoothing: antialiased;
}

/* Grain overlay */
body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.35;
    mix-blend-mode: overlay;
    z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #000; }

/* ---------- Nav ---------- */
.nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 40px;
    max-width: 1280px; margin: 0 auto;
}
.nav nav { display: flex; gap: 10px; align-items: center; }
.brand {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 18px; letter-spacing: 1.2px;
    color: var(--text); text-transform: uppercase;
}
.brand:hover { color: var(--text); }
.brand-dot {
    width: 12px; height: 12px; border-radius: 3px;
    background: var(--accent);
    box-shadow: 0 0 22px var(--accent);
    display: inline-block;
    transform: rotate(45deg);
}
.who { color: var(--muted); margin-right: 10px; }
.badge {
    display: inline-block; margin-left: 6px;
    padding: 2px 8px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
}

/* ---------- Glass card ---------- */
.glass {
    background: var(--panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #0a0000;
    font-weight: 700;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.15s ease;
    text-decoration: none;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); color: #0a0000; }
.btn:active { transform: translateY(0); }
.btn.big { padding: 14px 26px; font-size: 14px; }
.btn.tiny { padding: 6px 12px; font-size: 11px; }
.btn.block { display: flex; width: 100%; }
.btn.ghost {
    background: transparent; color: var(--text);
    border-color: var(--border-2);
}
.btn.ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.btn.danger {
    background: transparent; color: var(--danger);
    border-color: rgba(255, 77, 90, 0.4);
}
.btn.danger:hover { background: rgba(255, 77, 90, 0.12); color: var(--danger); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------- Landing ---------- */
.hero {
    max-width: 1180px; margin: 40px auto 80px; padding: 0 24px;
    display: grid; place-items: center;
}
.hero-card {
    padding: 56px 56px 44px;
    max-width: 940px;
    width: 100%;
    animation: rise 0.7s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
    margin-bottom: 18px;
}
.hero-card h1 {
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.02;
    margin: 4px 0 18px;
    font-weight: 800;
    letter-spacing: -1px;
}
.accent { color: var(--accent); }
.lead {
    color: var(--muted);
    font-size: 16px; line-height: 1.7;
    max-width: 640px;
}
.cta-row { margin: 26px 0 40px; display: flex; gap: 12px; flex-wrap: wrap; }

.feature-grid {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.feature-grid li {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    display: flex; flex-direction: column; gap: 4px;
}
.feature-grid strong { color: var(--text); font-size: 14px; }
.feature-grid span { color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- Auth ---------- */
.auth-wrap {
    max-width: 480px; margin: 40px auto 80px; padding: 0 20px;
}
.auth-card {
    padding: 36px 32px;
    animation: rise 0.5s cubic-bezier(.2,.7,.3,1) both;
}
.auth-card h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.3px; }
.auth-card .muted { margin: 0 0 22px; font-size: 13px; }
.auth-card label {
    display: block;
    font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 14px;
}
.auth-card input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s, background-color 0.15s;
}
.auth-card input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,90,0,0.06);
}
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid var(--border-2);
}
.alert.ok  { background: rgba(41, 211, 145, 0.10); color: var(--ok);     border-color: rgba(41, 211, 145, 0.3); }
.alert.err { background: rgba(255, 77, 90, 0.10);  color: var(--danger); border-color: rgba(255, 77, 90, 0.3); }

/* ---------- Dashboard ---------- */
.dash-wrap {
    max-width: 1280px; margin: 20px auto 80px; padding: 0 24px;
    display: flex; flex-direction: column; gap: 24px;
}
.stat-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.stat {
    padding: 22px 24px;
    display: flex; flex-direction: column; gap: 4px;
}
.stat-num { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat span:last-child { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }

.upload-card, .gallery-card { padding: 28px; }
.upload-head { margin-bottom: 20px; }
.upload-head h2 { margin: 0 0 4px; font-size: 20px; }
.upload-head .muted { margin: 0; font-size: 12px; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    padding: 48px 24px;
    border: 1.5px dashed var(--border-2);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}
.dropzone:hover { background: rgba(255, 90, 0, 0.05); border-color: var(--accent); }
.dropzone.drag  { background: rgba(255, 90, 0, 0.10); border-color: var(--accent); transform: scale(1.005); }
.dz-icon {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: grid; place-items: center;
    font-size: 22px; font-weight: 900;
    margin-bottom: 6px;
}
.dz-title { font-size: 16px; }
.dz-hint  { font-size: 12px; }

.queue {
    margin-top: 18px;
    display: flex; flex-direction: column; gap: 8px;
}
.queue-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    font-size: 13px;
}
.queue-item .qi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .qi-size { color: var(--muted); font-size: 12px; }
.queue-item .qi-remove {
    background: none; border: none; color: var(--danger);
    font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px;
}

.upload-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- Gallery ---------- */
.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255,255,255,0.02);
    display: flex; flex-direction: column;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--border-2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.thumb {
    display: block;
    aspect-ratio: 4/3;
    background: #0f0f12;
    overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.thumb:hover img { transform: scale(1.04); }

.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card-title {
    font-size: 13px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-meta { font-size: 11px; color: var(--muted); }

.url-row {
    display: flex; gap: 6px; align-items: center;
}
.url-row input {
    flex: 1; min-width: 0;
    padding: 7px 10px;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
}

.del-form { margin-top: 4px; }

.empty {
    padding: 60px 20px; text-align: center; color: var(--muted);
    border: 1px dashed var(--border-2); border-radius: var(--radius);
}
.empty-icon { font-size: 34px; color: var(--accent); margin-bottom: 10px; }

/* ---------- Viewer ---------- */
.view-wrap {
    max-width: 1100px; margin: 40px auto 80px; padding: 0 24px;
}
.view-card {
    padding: 24px;
    display: grid; grid-template-columns: 2fr 1fr; gap: 24px;
}
.view-img {
    background: #0f0f12;
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    min-height: 300px;
    overflow: hidden;
}
.view-img img { max-width: 100%; max-height: 70vh; display: block; }
.view-meta { display: flex; flex-direction: column; gap: 12px; }
.view-meta h2 { margin: 0; font-size: 20px; word-break: break-word; }
.center-msg { grid-template-columns: 1fr; text-align: center; padding: 60px 20px; }
.center-msg h2 { margin: 0; }

/* ---------- Footer ---------- */
.foot {
    max-width: 1280px; margin: 40px auto 24px; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
    color: var(--muted); font-size: 12px;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(80px);
    background: #14140f;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.25s;
    z-index: 999;
    box-shadow: 0 12px 30px rgba(255, 90, 0, 0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    .nav { padding: 18px 20px; }
    .hero-card { padding: 36px 24px 28px; }
    .stat-row { grid-template-columns: 1fr; }
    .view-card { grid-template-columns: 1fr; }
    .foot { flex-direction: column; gap: 6px; }
}
@media (max-width: 480px) {
    .hero-card h1 { font-size: 34px; }
    .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .card-body { padding: 10px; }
    .brand { font-size: 15px; }
}
