/* ================================================================
   id6.in — Design System & Styles
   ================================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg-primary:    #0a0a0f;
    --bg-secondary:  #12121a;
    --bg-card:       #1a1a2e;
    --bg-glass:      rgba(26, 26, 46, 0.7);
    --surface:       #16213e;

    --text-primary:  #e8e8f0;
    --text-secondary:#9090a8;
    --text-muted:    #6060789a;

    --accent:        #7c3aed;
    --accent-light:  #a78bfa;
    --accent-glow:   rgba(124, 58, 237, 0.35);
    --gradient-1:    linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
    --gradient-2:    linear-gradient(135deg, #ec4899 0%, #f97316 100%);

    --danger:        #ef4444;
    --success:       #22c55e;

    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     20px;
    --radius-xl:     28px;

    --shadow-sm:     0 2px 8px rgba(0,0,0,0.25);
    --shadow-md:     0 4px 24px rgba(0,0,0,0.35);
    --shadow-lg:     0 8px 48px rgba(0,0,0,0.5);
    --shadow-glow:   0 0 30px var(--accent-glow);

    --font:          'Inter', system-ui, -apple-system, sans-serif;
    --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: #c4b5fd; }
button { cursor: pointer; font-family: var(--font); }
img { max-width: 100%; display: block; }

/* ── Header ────────────────────────────────────────────────── */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; height: 64px;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.logo { display: flex; align-items: center; font-size: 1.6rem; font-weight: 700; gap: 1px; }
.logo-id { color: var(--text-primary); }
.logo-6 { background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header-nav { display: flex; align-items: center; gap: 1rem; }
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1.25rem; border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500; border: none;
    transition: all var(--transition);
}
.btn-primary {
    background: var(--gradient-1); color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 40px var(--accent-glow); }
.btn-ghost {
    background: transparent; color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }

.user-pill {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.3rem 0.9rem 0.3rem 0.3rem;
    background: var(--bg-card); border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.08);
}
.user-pill img { width: 28px; height: 28px; border-radius: 50%; }
.user-pill span { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 6rem 1.5rem 4rem;
    position: relative;
}
.hero::before {
    content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none; opacity: 0.4;
}
.hero-content { text-align: center; position: relative; z-index: 1; }
.hero-title { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 700; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.gradient-text { background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: 2.5rem; }

/* ── OTP Code Boxes ────────────────────────────────────────── */
.code-input-wrap {
    display: flex; gap: 12px; justify-content: center;
}
.code-box {
    width: 60px; height: 72px;
    background: var(--bg-card);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1.6rem; font-weight: 600;
    text-align: center; text-transform: uppercase;
    outline: none;
    transition: all var(--transition);
    caret-color: var(--accent-light);
}
.code-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-md);
    transform: translateY(-2px);
}
.code-box.filled {
    border-color: var(--accent-light);
    background: rgba(124,58,237,0.08);
}
.code-box.error { border-color: var(--danger); animation: shake 0.4s; }

@keyframes shake {
    0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)}
}

.error-msg {
    margin-top: 1rem; color: var(--danger); font-size: 0.9rem;
    min-height: 1.4rem; transition: opacity var(--transition);
}

/* ── Loader ────────────────────────────────────────────────── */
.loader-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: none; align-items: center; justify-content: center; flex-direction: column;
    background: rgba(10,10,15,0.92);
    backdrop-filter: blur(8px);
}
.loader-overlay.active { display: flex; }
.loader-spinner {
    width: 48px; height: 48px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { margin-top: 1.2rem; color: var(--text-secondary); font-size: 0.95rem; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 300;
    display: none; align-items: center; justify-content: center;
    background: rgba(10,10,15,0.88);
    backdrop-filter: blur(12px);
    padding: 2rem;
    animation: fadeIn 0.3s;
}
.modal-overlay.active { display: flex; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal {
    position: relative;
    width: 100%; max-width: 800px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
@keyframes slideUp { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

.modal-close {
    position: absolute; top: 16px; right: 16px; z-index: 5;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary); font-size: 1.3rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

.modal-body {
    flex: 1; overflow-y: auto; padding: 2.5rem;
    scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Markdown rendered content ─────────────────────────────── */
.modal-body h1 { font-size: 1.8rem; margin-bottom: 1rem; }
.modal-body h2 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 0.4rem; }
.modal-body h3 { font-size: 1.15rem; margin: 1.2rem 0 0.5rem; }
.modal-body p { line-height: 1.75; margin-bottom: 1rem; color: var(--text-secondary); }
.modal-body ul, .modal-body ol { margin: 0.5rem 0 1rem 1.5rem; color: var(--text-secondary); }
.modal-body li { margin-bottom: 0.35rem; line-height: 1.6; }
.modal-body code {
    background: rgba(124,58,237,0.12); padding: 0.15em 0.4em;
    border-radius: 4px; font-size: 0.9em; color: var(--accent-light);
}
.modal-body pre {
    background: var(--bg-primary); border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto;
    margin-bottom: 1rem;
}
.modal-body pre code { background: none; padding: 0; color: var(--text-primary); }
.modal-body blockquote {
    border-left: 3px solid var(--accent); padding: 0.5rem 1rem; margin: 1rem 0;
    background: rgba(124,58,237,0.05); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.modal-body img { border-radius: var(--radius-sm); margin: 1rem 0; }
.modal-body a { color: var(--accent-light); text-decoration: underline; }
.modal-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.modal-body th, .modal-body td { padding: 0.6rem 0.8rem; border: 1px solid rgba(255,255,255,0.08); text-align: left; }
.modal-body th { background: var(--bg-card); font-weight: 600; }

/* ── Redirect Bar ──────────────────────────────────────────── */
.redirect-bar {
    display: none; align-items: center; justify-content: space-between;
    padding: 0.9rem 2rem;
    background: linear-gradient(90deg, rgba(124,58,237,0.15) 0%, rgba(6,182,212,0.15) 100%);
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.9rem;
}
.redirect-bar.active { display: flex; }
.btn-cancel-redirect {
    background: transparent; border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-secondary); padding: 0.3rem 0.9rem; border-radius: var(--radius-sm);
    font-size: 0.8rem; transition: all var(--transition);
}
.btn-cancel-redirect:hover { border-color: var(--danger); color: var(--danger); }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    text-align: center; padding: 2rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-bottom: 0.8rem; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--text-secondary); }
.footer-copy { color: var(--text-muted); font-size: 0.8rem; }

/* ── Dashboard ─────────────────────────────────────────────── */
.dashboard {
    max-width: 960px; margin: 5.5rem auto 3rem; padding: 0 1.5rem;
}
.dash-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.dash-header h2 { font-size: 1.5rem; font-weight: 600; }

.link-card {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md); padding: 1.5rem;
    margin-bottom: 1rem; transition: all var(--transition);
}
.link-card:hover { border-color: rgba(124,58,237,0.3); box-shadow: var(--shadow-glow); }
.link-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.link-code {
    font-size: 1.2rem; font-weight: 700; font-family: 'Inter', monospace;
    background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.link-meta { font-size: 0.8rem; color: var(--text-muted); }
.link-preview { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.75rem;
    max-height: 3rem; overflow: hidden; text-overflow: ellipsis; }
.link-actions { display: flex; gap: 0.5rem; }
.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 50px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-redirect { background: rgba(6,182,212,0.15); color: #06b6d4; }
.badge-content { background: rgba(124,58,237,0.15); color: var(--accent-light); }

/* ── Editor Modal ──────────────────────────────────────────── */
.editor-overlay {
    position: fixed; inset: 0; z-index: 400;
    display: none; align-items: center; justify-content: center;
    background: rgba(10,10,15,0.92); backdrop-filter: blur(12px);
    padding: 1.5rem;
}
.editor-overlay.active { display: flex; }
.editor-modal {
    width: 100%; max-width: 720px; max-height: 90vh;
    background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; overflow: hidden;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.editor-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.editor-header h3 { font-size: 1.15rem; font-weight: 600; }
.editor-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.4rem; font-weight: 500; }
.form-input {
    width: 100%; padding: 0.65rem 0.9rem;
    background: var(--bg-primary); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font);
    font-size: 0.9rem; outline: none; transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); }
textarea.form-input { min-height: 200px; resize: vertical; font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 0.85rem; line-height: 1.6; }
.toggle-wrap {
    display: flex; align-items: center; gap: 0.75rem;
}
.toggle {
    position: relative; width: 44px; height: 24px;
    background: rgba(255,255,255,0.08); border-radius: 12px;
    cursor: pointer; transition: background var(--transition);
}
.toggle.active { background: var(--accent); }
.toggle::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: transform var(--transition);
}
.toggle.active::after { transform: translateX(20px); }
.editor-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
    padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 1rem; margin-bottom: 1.5rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .header { padding: 0 1rem; }
    .code-box { width: 48px; height: 58px; font-size: 1.3rem; }
    .code-input-wrap { gap: 8px; }
    .modal { border-radius: var(--radius-md); max-height: 85vh; }
    .modal-body { padding: 1.5rem; }
    .dash-header { flex-direction: column; align-items: flex-start; }
    .link-card-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
    .code-box { width: 42px; height: 52px; font-size: 1.15rem; }
    .code-input-wrap { gap: 6px; }
}
