/* SpicyLink — Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg:        #0a0a0f;
    --surface:   #111118;
    --card:      #18181f;
    --border:    #2a2a35;
    --hot:       #ff3366;
    --hot2:      #ff6b35;
    --muted:     #6b6b80;
    --text:      #e8e8f0;
    --text-dim:  #9999aa;
    --success:   #22c55e;
    --danger:    #ef4444;
    --radius:    14px;
    --radius-sm: 8px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 460px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Nav ─────────────────────────────────────────────────── */
.navbar {
    background: rgba(10,10,15,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
}

.navbar-inner {
    max-width: 900px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    text-decoration: none;
    background: linear-gradient(135deg, var(--hot), var(--hot2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-links {
    display: flex;
    gap: 8px;
    align-items: center;
    list-style: none;
}

.navbar-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.navbar-links a:hover { color: var(--text); background: var(--card); }
.navbar-links .btn-nav {
    background: linear-gradient(135deg, var(--hot), var(--hot2));
    color: #fff !important;
    font-weight: 600;
}
.navbar-links .btn-nav:hover { opacity: 0.85; background: linear-gradient(135deg, var(--hot), var(--hot2)); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--hot), var(--hot2));
    color: #fff;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--hot); color: var(--hot); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus { border-color: var(--hot); }
.form-control::placeholder { color: var(--muted); }

textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 18px;
}
.alert-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.15);  border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }
.alert-info    { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; }

/* ── Dashboard layout ────────────────────────────────────── */
.dash-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    padding: 28px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.dash-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.dash-nav { list-style: none; }

.dash-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}
.dash-nav a:hover, .dash-nav a.active {
    background: var(--card);
    color: var(--text);
}
.dash-nav a.active { color: var(--hot); }

.dash-main { min-width: 0; }

/* ── Link card ───────────────────────────────────────────── */
.link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
    min-width: 0;
}

.link-item:hover { border-color: var(--hot); }

.link-handle {
    color: var(--muted);
    cursor: grab;
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
    padding: 2px;
}

.link-info { flex: 1; min-width: 0; overflow: hidden; }
.link-info .link-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-info .link-url {
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-stats {
    font-size: 0.75rem;
    color: var(--text-dim);
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

/* Link action buttons — icon-only, square, consistent size */
.link-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    padding: 0;
    flex-shrink: 0;
}
.link-btn:hover { border-color: var(--hot); color: var(--hot); background: var(--card); }
.link-btn-danger { border-color: transparent; background: rgba(239,68,68,0.15); color: #fca5a5; }
.link-btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── Public profile ──────────────────────────────────────── */
.profile-page {
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--hot);
    margin-bottom: 14px;
}

.profile-avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hot), var(--hot2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 14px;
}

.profile-header { text-align: center; margin-bottom: 30px; }
.profile-header h1 { font-size: 1.6rem; }
.profile-header .bio { color: var(--text-dim); font-size: 0.9rem; margin-top: 6px; }
.profile-header .username { color: var(--hot); font-size: 0.85rem; }

.profile-link {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: all 0.2s;
}

.profile-link:hover {
    border-color: var(--hot);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,51,102,0.15);
}

.profile-link .icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--hot), var(--hot2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.profile-powered {
    text-align: center;
    margin-top: 32px;
    font-size: 0.8rem;
    color: var(--muted);
}
.profile-powered a {
    color: var(--hot);
    text-decoration: none;
    font-weight: 600;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
    padding: 60px 20px 40px;
    text-align: center;
}

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page { padding: 60px 20px; }
.auth-page h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-sub { color: var(--text-dim); margin-bottom: 28px; font-size: 0.9rem; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--text-dim); }
.auth-switch a { color: var(--hot); text-decoration: none; font-weight: 600; }

/* ── Tables (admin) ──────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.data-table th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.78rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: rgba(34,197,94,0.15);  color: #86efac; }
.badge-red   { background: rgba(239,68,68,0.15);  color: #fca5a5; }
.badge-blue  { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.badge-orange{ background: rgba(249,115,22,0.15); color: #fdba74; }

/* ── Toggle switch ───────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--hot); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Gradient text ───────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--hot), var(--hot2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Helpers ─────────────────────────────────────────────── */
.mt-1 { margin-top: 6px; }   .mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }  .mt-4 { margin-top: 28px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }.mb-4 { margin-bottom: 28px; }
.text-dim { color: var(--text-dim); }
.text-hot { color: var(--hot); }
.text-sm  { font-size: 0.85rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 10px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; }
    .dash-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 8px 10px; }
}

/* ── Tier badges ─────────────────────────────────────────── */
.tier-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.tier-premium {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.tier-sponsor {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
}
.tier-free {
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* Profile tier badge */
.profile-tier {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 8px;
}
.profile-tier-premium { background: linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; }
.profile-tier-sponsor  { background: linear-gradient(135deg,#f59e0b,#ef4444); color:#fff; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 60px;
    background: var(--surface);
}
.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-brand .footer-logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--hot), var(--hot2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.footer-brand p { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.footer-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--hot); }
.footer-bottom {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 14px 20px;
    font-size: 0.78rem;
    color: var(--muted);
}
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--hot); }

/* ── Dash user info ──────────────────────────────────────── */
.dash-user-info {
    padding: 0 14px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.dash-username { font-weight: 700; font-size: 0.9rem; color: var(--text); margin-bottom: 4px; }

/* ── Ad banner ───────────────────────────────────────────── */
.profile-ad {
    margin-top: 24px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
}
.profile-ad-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }

/* ── Favicon/icon preview ────────────────────────────────── */
.icon-preview {
    width: 20px; height: 20px;
    border-radius: 4px;
    object-fit: contain;
    vertical-align: middle;
}

/* ── Mobile fixes ────────────────────────────────────────── */
@media (max-width: 600px) {
    .navbar-inner { padding: 0 4px; }
    .navbar-links a { padding: 6px 8px; font-size: 0.82rem; }
    .navbar-brand { font-size: 1.1rem; }

    .dash-layout { grid-template-columns: 1fr; padding: 14px 12px; gap: 16px; }
    .dash-sidebar { position: static; }
    .dash-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; }
    .dash-nav a { padding: 7px 10px; font-size: 0.82rem; }
    .dash-user-info { display: none; }

    .auth-page { padding: 30px 12px; }
    .container-sm { padding: 0 12px; }
    .card { padding: 16px; }

    .profile-page { padding: 24px 14px 60px; }

    .link-item { gap: 6px; padding: 8px 10px; }
    .link-stats { display: none; }
    .link-actions { margin-left: auto; flex-shrink: 0; }

    .footer-inner { padding: 24px 14px 16px; flex-direction: column; gap: 16px; }
    .footer-links { gap: 14px; }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
}
