@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-0: #05070d;
    --bg-1: #0a0e1a;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text-0: #f2f4f8;
    --text-1: #aab2c5;
    --text-2: #707a92;
    --accent: #6ee7d8;
    --accent-2: #7c9cff;
    --danger: #ff6b6b;
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg-0);
    color: var(--text-0);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    position: relative;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 10%, rgba(124, 156, 255, 0.16), transparent 42%),
        radial-gradient(circle at 85% 0%, rgba(110, 231, 216, 0.12), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(124, 156, 255, 0.08), transparent 55%),
        linear-gradient(180deg, var(--bg-0), var(--bg-1));
    background-attachment: fixed;
}

h1, h2, h3 { font-family: 'Sora', 'Inter', sans-serif; margin: 0; }

a { color: inherit; text-decoration: none; }

.wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 72px 24px 56px;
    position: relative;
    z-index: 1;
}

/* ---- Profile header ---- */
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 44px;
}

.avatar {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 30px;
    color: #06111a;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 20px 50px -12px rgba(110, 231, 216, 0.35);
    margin-bottom: 20px;
}

.profile h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.profile .tagline {
    margin-top: 8px;
    color: var(--text-1);
    font-size: 15px;
}

.status-pill {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-1);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(110, 231, 216, 0.18);
}

/* ---- Link cards ---- */
.links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.link-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.link-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.link-body { flex: 1; min-width: 0; }

.link-title {
    font-weight: 600;
    font-size: 15.5px;
    color: var(--text-0);
}

.link-desc {
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-arrow {
    flex-shrink: 0;
    color: var(--text-2);
    transition: transform 0.18s ease, color 0.18s ease;
}

.link-card:hover .link-arrow {
    color: var(--accent);
    transform: translateX(2px);
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

footer.site-footer {
    margin-top: 48px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-2);
}

footer.site-footer a { color: var(--text-1); }
footer.site-footer a:hover { color: var(--accent); }

/* ---- Admin ---- */
.admin-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 24px 64px;
    position: relative;
    z-index: 1;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-topbar h1 {
    font-size: 20px;
    font-weight: 700;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-0);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { background: var(--surface-hover); border-color: var(--border-hover); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06111a;
    border: none;
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-danger {
    color: var(--danger);
    border-color: rgba(255, 107, 107, 0.25);
}

.btn-danger:hover { background: rgba(255, 107, 107, 0.1); }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(14px);
}

.panel h2 {
    font-size: 15px;
    margin-bottom: 18px;
    color: var(--text-1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-grid {
    display: grid;
    grid-template-columns: 70px 1fr 1fr;
    gap: 12px;
}

.form-grid .full { grid-column: 1 / -1; }

label {
    display: block;
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 6px;
}

input[type=text], input[type=url], input[type=number], input[type=password] {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.25);
    color: var(--text-0);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-2);
}

.form-actions { margin-top: 16px; text-align: right; }

.admin-list { display: flex; flex-direction: column; gap: 10px; }

.admin-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 13px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
}

.admin-row .link-icon { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }

.admin-row .meta { flex: 1; min-width: 0; }
.admin-row .meta .title { font-weight: 600; font-size: 14px; }
.admin-row .meta .url { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-row.editing {
    align-items: stretch;
    background: rgba(124, 156, 255, 0.06);
    border-color: var(--border-hover);
}

.edit-form { width: 100%; }
.edit-form .form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.login-card {
    max-width: 380px;
    margin: 14vh auto 0;
    padding: 32px 28px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card p.sub { color: var(--text-2); font-size: 13px; margin: 0 0 22px; }
.login-card .btn-primary { width: 100%; justify-content: center; margin-top: 16px; }

.alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: #ffb3b3;
}

.alert-success {
    background: rgba(110, 231, 216, 0.1);
    border: 1px solid rgba(110, 231, 216, 0.25);
    color: var(--accent);
}

@media (max-width: 520px) {
    .form-grid { grid-template-columns: 1fr; }
    .wrap, .admin-wrap { padding-left: 18px; padding-right: 18px; }
}
