/* ══════════════════════════════════════════
   DOXED.ORG - Core Styles
   ══════════════════════════════════════════ */

:root {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --bg-input: #141414;
    --border: #1e1e1e;
    --border-hover: #2a2a2a;
    --text: #ffffff;
    --text-muted: #666666;
    --text-dim: #444444;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

/* ── Navbar ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    font-weight: 500;
}
.nav-links a:not(.btn) {
    color: var(--text-muted);
    transition: color 0.2s;
}
.nav-links a:not(.btn):hover { color: var(--text); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { filter: brightness(1.1); }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-card); }
.btn-block { width: 100%; }

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--accent);
}
.form-control::placeholder { color: var(--text-dim); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.form-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}
.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-header h2 {
    font-size: 16px;
    font-weight: 700;
}

/* ── Containers ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ── Flash messages ── */
.flash {
    max-width: 480px;
    margin: 20px auto;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}
.flash-error { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.flash-success { background: rgba(34, 197, 94, 0.1); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.2); }

/* ── Auth pages ── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 61px);
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
}
.auth-card h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}
.auth-card p.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-footer a { color: var(--accent); }

/* ── Dashboard ── */
.dash-page {
    padding: 40px 0;
}
.dash-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}
.dash-sidebar .card { position: sticky; top: 92px; }
.dash-sidebar .avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 12px;
    overflow: hidden;
}
.dash-sidebar .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.dash-sidebar .user-info {
    text-align: center;
    margin-bottom: 20px;
}
.dash-sidebar .user-info h3 { font-size: 16px; font-weight: 700; }
.dash-sidebar .user-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.dash-sidebar .profile-link {
    display: block;
    text-align: center;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
    word-break: break-all;
}
.dash-sidebar .profile-link:hover { color: var(--accent); border-color: var(--accent); }

.dash-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.dash-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Link list (dashboard) ── */
.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: border-color 0.2s;
}
.link-item:hover { border-color: var(--border-hover); }
.link-item .drag-handle {
    cursor: grab;
    color: var(--text-dim);
    font-size: 18px;
    user-select: none;
}
.link-item .link-info { flex: 1; min-width: 0; }
.link-item .link-info .link-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-item .link-info .link-url {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-item .link-info .link-clicks {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}
.link-item .link-actions {
    display: flex;
    gap: 6px;
}
.link-item .link-actions button {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: var(--font);
}
.link-item .link-actions button:hover { color: var(--text); background: var(--bg-card); }
.link-item .link-actions button.delete:hover { color: var(--danger); }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-dim);
    font-size: 14px;
}

/* ── Add link modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 460px;
    transform: translateY(10px);
    transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ── Theme customizer ── */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.color-picker-group input[type="color"] {
    width: 44px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px;
}
.theme-preview {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Icon selector ── */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}
.icon-option {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-input);
}
.icon-option:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.icon-option.selected { border-color: var(--accent); background: rgba(124, 58, 237, 0.1); }
.icon-option svg { width: 20px; height: 20px; fill: var(--text); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
    .dash-sidebar .card { position: static; }
    .nav-links { gap: 16px; }
}

/* ══════════════════════════════════════════
   PUBLIC PROFILE STYLES
   ══════════════════════════════════════════ */
.profile-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.profile-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}
.profile-bg-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: orbFloat 20s ease-in-out infinite alternate;
}
.profile-bg-orb:nth-child(1) { top: -10%; left: -5%; }
.profile-bg-orb:nth-child(2) { bottom: -10%; right: -5%; animation-delay: -10s; }
@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

.profile-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 48px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-card-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-card-wrapper.has-card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 24px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 16px;
    overflow: hidden;
    flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.profile-name .badge-verified {
    width: 20px;
    height: 20px;
    display: inline-flex;
}
.profile-name .badge-verified svg { width: 20px; height: 20px; }
.profile-username {
    font-size: 13px;
    margin-bottom: 6px;
}
.profile-bio {
    font-size: 14px;
    margin-bottom: 32px;
    text-align: center;
    line-height: 1.6;
    max-width: 320px;
}

.profile-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}
.profile-link:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.profile-link .p-link-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-link .p-link-icon svg { width: 22px; height: 22px; fill: currentColor; }
.profile-link .p-link-text {
    flex: 1;
    text-align: center;
    padding-right: 34px;
}

.profile-socials {
    display: flex;
    gap: 14px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}
.profile-social {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    transition: all 0.25s ease;
}
.profile-social:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}
.profile-social svg { width: 20px; height: 20px; fill: currentColor; }

.profile-footer {
    margin-top: 48px;
    font-size: 12px;
    letter-spacing: 0.05em;
}
.profile-footer a { text-decoration: none; }

/* Fade in */
.p-fade {
    opacity: 0;
    transform: translateY(12px);
    animation: pFadeUp 0.5s ease forwards;
}
@keyframes pFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Home page ── */
.hero {
    text-align: center;
    padding: 120px 20px 80px;
}
.hero h1 {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
}
.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--accent), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 36px;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.hero-actions .btn { padding: 14px 32px; font-size: 15px; }

@media (max-width: 600px) {
    .hero h1 { font-size: 36px; }
    .hero p { font-size: 16px; }
}
