:root {
    --bg-primary: #0b0d12;
    --bg-secondary: #12151c;
    --bg-card: #171b24;
    --border-color: #262b38;
    --gold: #d4af37;
    --gold-light: #f2d675;
    --gold-dim: rgba(212, 175, 55, 0.15);
    --text-primary: #f2f3f5;
    --text-secondary: #9096a5;
    --danger: #e5484d;
    --success: #3ecf8e;
    --radius: 14px;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.45);
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-main);
    background:
        radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.08), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(212, 175, 55, 0.06), transparent 45%),
        var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.brand .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    box-shadow: 0 0 12px var(--gold);
}

.nav-links a {
    color: var(--text-secondary);
    margin-left: 28px;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 70px 0 40px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 14px;
    background: linear-gradient(120deg, var(--text-primary), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 520px;
    margin: 0 auto;
}

/* ===== UPLOAD CARD ===== */
.upload-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 40px;
    margin: 40px auto;
    max-width: 680px;
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--bg-secondary);
    position: relative;
}

.dropzone.dragover {
    border-color: var(--gold);
    background: var(--gold-dim);
}

.dropzone svg {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    color: var(--gold);
}

.dropzone .title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}

.dropzone .subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #14161c;
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger {
    background: rgba(229, 72, 77, 0.12);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(229, 72, 77, 0.22); }

.upload-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

/* ===== PROGRESS ===== */
.progress-wrap {
    margin-top: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    height: 8px;
    display: none;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transition: width 0.2s ease;
}

/* ===== RESULT CARD ===== */
.result-card {
    margin-top: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: none;
}

.result-card img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 10px;
    background: #000;
    margin-bottom: 16px;
}

.link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.link-row label {
    width: 90px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.link-row input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
}

.link-row button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--gold);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.link-row button:hover { border-color: var(--gold); }

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 18px;
}
.alert-error {
    background: rgba(229, 72, 77, 0.12);
    color: #ff8b8e;
    border: 1px solid rgba(229, 72, 77, 0.3);
}
.alert-success {
    background: rgba(62, 207, 142, 0.12);
    color: var(--success);
    border: 1px solid rgba(62, 207, 142, 0.3);
}

.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== LOGIN ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 44px 40px;
    width: 100%;
    max-width: 380px;
}

.login-card h2 {
    text-align: center;
    margin: 0 0 6px;
    font-size: 24px;
}
.login-card .sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 28px;
}

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--gold);
}

.login-card .btn { width: 100%; margin-top: 8px; }

/* ===== ADMIN DASHBOARD ===== */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px;
}
.stat-card .num {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
}
.stat-card .label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-secondary); }
th, td {
    padding: 14px 18px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}
th { color: var(--text-secondary); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
tbody tr:hover { background: rgba(212, 175, 55, 0.04); }
tbody tr:last-child td { border-bottom: none; }

.thumb-preview {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    background: var(--gold-dim);
    color: var(--gold);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .hero h1 { font-size: 30px; }
    .upload-card { padding: 24px; }
    .nav-links a { margin-left: 14px; font-size: 13px; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tbody tr { border-bottom: 1px solid var(--border-color); padding: 12px 0; }
    td { border: none; padding: 6px 18px; }
}
