@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
    --bg: #0b0b0f;
    --surface: #111116;
    --surface2: #18181f;
    --border: rgba(255,255,255,0.08);
    --border2: rgba(255,255,255,0.14);
    --text: #f0f0f5;
    --muted: rgba(240,240,245,0.45);
    --muted2: rgba(240,240,245,0.25);
    --white: #ffffff;
    --input: rgba(255,255,255,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Stars ─────────────────────────────────────── */
.stars-canvas {
    position: fixed; inset: 0; z-index: 0;
    background: #0b0b0f;
}
.stars-canvas canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
}


/* ── Layout ────────────────────────────────────── */
.app {
    position: relative; z-index: 2;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
}

.error-box {
    background: rgba(255, 70, 70, 0.14);
    border: 1px solid rgba(255, 70, 70, 0.28);
    color: #ffffff;
    padding: 18px 20px;
    border-radius: 18px;
    margin: 16px 0;
}

.panel {
    width: min(100%, 520px);
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border2);
    border-radius: 28px;
    padding: 40px 34px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.14);
    animation: fadeUp 0.45s cubic-bezier(.22,1,.36,1) both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ──────────────────────────────────────── */
.logo { text-align: center; margin-bottom: 10px; }
.logo-text {
    font-family: 'DM Serif Display', serif;
    font-size: 2.4rem;
    font-weight: 400;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--white);
}
.logo-sub {
    font-size: 0.68rem;
    letter-spacing: 5px;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: 6px;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border2), transparent);
    margin: 28px 0;
}

/* ── Inputs ────────────────────────────────────── */
label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}

input, select {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 18px;
}
input:focus, select:focus {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.07);
}
input::placeholder { color: var(--muted2); }
select option { background: #111116; color: white; }

.field { margin-bottom: 2px; }

/* ── Buttons ───────────────────────────────────── */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(.22,1,.36,1);
}
.btn-primary {
    background: var(--white);
    color: #0b0b0f;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(255,255,255,0.15); }
.btn-secondary {
    background: var(--input);
    border: 1px solid var(--border2);
    color: var(--text);
    margin-top: 10px;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-ghost {
    background: transparent; border: none;
    color: var(--muted); font-size: 0.8rem;
    text-decoration: underline; cursor: pointer;
    width: auto; padding: 0; letter-spacing: 0;
    font-family: inherit;
    transition: color 0.2s;
}
.btn-ghost:hover { color: var(--text); }
.btn-sm {
    padding: 8px 14px;
    font-size: 0.72rem;
    width: auto;
    border-radius: 9px;
    letter-spacing: 1px;
}
.btn-danger  { background: rgba(255,100,100,0.1); border: 1px solid rgba(255,100,100,0.2); color: #ff8a8a; }
.btn-success { background: rgba(120,220,160,0.1); border: 1px solid rgba(120,220,160,0.2); color: #78dca0; }
.btn-orange  { background: rgba(255,255,255,0.07); border: 1px solid var(--border2); color: var(--text); }

/* ── Dashboard ─────────────────────────────────── */
.dash-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 32px;
}
.dash-nick {
    font-family: 'DM Serif Display', serif;
    font-size: 1.8rem;
    font-weight: 400;
}
.dash-role {
    font-size: 0.65rem; letter-spacing: 3px; text-transform: uppercase;
    color: var(--muted); margin-top: 4px;
}

/* ── Stats ─────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 28px; }
.stat-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
}
.stat-box b { display: block; font-size: 1.7rem; font-weight: 700; }
.stat-box span { font-size: 0.65rem; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }

/* ── Section titles ────────────────────────────── */
.section-title {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 3px;
    text-transform: uppercase; color: var(--muted);
    margin: 24px 0 12px;
    display: flex; align-items: center; gap: 10px;
}
.section-title::after {
    content: ''; flex: 1; height: 1px;
    background: var(--border);
}

/* ── Cards ─────────────────────────────────────── */
.release-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 10px;
    display: flex; gap: 14px; align-items: flex-start;
    transition: border-color 0.2s;
}
.release-card:hover { border-color: var(--border2); }

.release-cover {
    width: 64px; height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    overflow: hidden;
}
.release-info { flex: 1; min-width: 0; }
.release-title { font-weight: 600; font-size: 0.97rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.release-meta { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.release-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* ── Badges ────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.badge-pending  { background: rgba(255,220,80,0.1);  color: #ffd84d;  border: 1px solid rgba(255,220,80,0.2); }
.badge-on_ship  { background: rgba(140,180,255,0.1); color: #8cb4ff;  border: 1px solid rgba(140,180,255,0.2); }
.badge-released { background: rgba(120,220,160,0.1); color: #78dca0;  border: 1px solid rgba(120,220,160,0.2); }
.badge-rejected { background: rgba(255,100,100,0.1); color: #ff8a8a;  border: 1px solid rgba(255,100,100,0.2); }

/* ── Audio ─────────────────────────────────────── */
.audio-row {
    display: flex; align-items: center; gap: 9px;
    margin-top: 8px; font-size: 0.78rem; color: var(--muted);
}
.play-btn {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border2);
    color: var(--text); cursor: pointer; font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.15s; flex-shrink: 0;
    font-family: inherit;
}
.play-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.1); }
audio { display: none; }
.dl-link { margin-left: auto; color: var(--muted2); font-size: 0.72rem; text-decoration: none; }
.dl-link:hover { color: var(--text); }

/* ── Upload form ───────────────────────────────── */
.upload-form {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 26px;
    margin-bottom: 8px;
}
.upload-form input { margin-bottom: 16px; }

.file-drop {
    border: 1px dashed var(--border2);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
    font-size: 0.84rem; color: var(--muted);
}
.file-drop:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.03); }
.file-drop input[type=file] { display: none; }
.file-name { color: var(--text); font-weight: 600; margin-top: 5px; font-size: 0.8rem; }

.cover-preview {
    width: 72px; height: 72px; border-radius: 10px;
    object-fit: cover; margin: 0 auto 8px;
    display: block;
}

/* ── Waiting banner ────────────────────────────── */
.waiting-banner {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    margin-bottom: 22px;
}
.waiting-banner .icon { font-size: 2rem; margin-bottom: 10px; }
.waiting-banner p { color: var(--muted); font-size: 0.88rem; margin-top: 6px; line-height: 1.6; }

/* ── Artist card (admin) ───────────────────────── */
.artist-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 8px;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.artist-card-name { font-weight: 600; font-size: 0.95rem; }
.artist-card-spotify { font-size: 0.77rem; color: var(--muted); margin-top: 2px; }

/* ── Progress ──────────────────────────────────── */
.progress-bar {
    width: 100%; height: 3px; background: var(--border);
    border-radius: 3px; overflow: hidden; margin-top: 10px;
}
.progress-fill {
    height: 100%;
    background: var(--white);
    border-radius: 3px;
    transition: width 0.3s;
}

/* ── Admin toggle ──────────────────────────────── */
.admin-toggle-row {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-top: 20px;
}

.theme-switcher {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center;
    margin-top: 16px;
}
.theme-switcher .btn {
    width: auto;
}

/* ── Dash scroll ───────────────────────────────── */
.dash-scroll {
    max-height: 72vh;
    overflow-y: auto;
    padding-right: 4px;
}
.dash-scroll::-webkit-scrollbar { width: 3px; }
.dash-scroll::-webkit-scrollbar-track { background: transparent; }
.dash-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Utils ─────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--muted); font-size: 0.85rem; }
.text-center { text-align: center; }
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }

/* ── Mobile ────────────────────────────────────── */
@media (max-width: 560px) {
    .panel { padding: 28px 22px; border-radius: 22px; }
    .logo-text { font-size: 1.9rem; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .release-card { flex-direction: column; }
}

/* ── Modal ─────────────────────────────────────── */
.modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 20px;
    max-width: 500px; width: 100%;
    max-height: 80vh; overflow-y: auto;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.2rem; }
.modal-close {
    background: none; border: none; color: var(--muted);
    font-size: 1.5rem; cursor: pointer; padding: 0;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }

/* ── Top artists ───────────────────────────────── */
.top-artists-list { display: flex; flex-direction: column; gap: 8px; }
.artist-rank {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}
.rank-number {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--white); color: #0b0b0f;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.artist-info { flex: 1; }
.artist-name { font-weight: 600; font-size: 0.9rem; }
.artist-stats { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ── Chat ──────────────────────────────────────── */
.chat-container { max-height: 400px; overflow-y: auto; margin-bottom: 16px; }
.chat-message {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.chat-nick { font-weight: 600; font-size: 0.8rem; color: var(--muted); }
.chat-text { margin-top: 4px; font-size: 0.9rem; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { flex: 1; }
.chat-input button { width: auto; padding: 10px 16px; }

/* ── Promo codes ───────────────────────────────── */
.promo-list { display: flex; flex-direction: column; gap: 8px; }
.promo-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}
.promo-code { font-weight: 600; font-family: monospace; }
.promo-discount { color: #78dca0; }
.promo-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.promo-form input, .promo-form select { margin-bottom: 0; }
.promo-activate { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 16px 0; }
.promo-activate .section-title { margin-bottom: 12px; }
.promo-active { background: #1f371e; border: 1px solid #2c5a2f; border-radius: 12px; padding: 10px 12px; color: #c2f5c4; margin-bottom: 12px; }
.promo-activate input { width: 100%; }

/* ── Branding form ─────────────────────────────── */
.branding-form { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 16px 0; }
.branding-form .field { margin-bottom: 12px; }

/* ── Telegram link ─────────────────────────────── */
.telegram-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: #0088cc; text-decoration: none;
    font-weight: 500;
    margin-top: 16px;
}
.telegram-link:hover { color: #0099dd; }
.telegram-icon {
    width: 20px; height: 20px;
    background: #0088cc; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 12px; font-weight: bold;
}
.app-version {
    background: rgba(255,255,255,.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    letter-spacing: .2px;
}
