/* ── Obsidian Key System — Shared Base ───────────────────────────────────────
   Every page imports this first, then its own page-specific overrides.
   ──────────────────────────────────────────────────────────────────────────── */

/* Fonts */
@font-face {
    font-family: "Play";
    src: url("/Styles/Fonts/Play-Regular.ttf") format("truetype");
    font-weight: normal;
}
@font-face {
    font-family: "Play";
    src: url("/Styles/Fonts/Play-Bold.ttf") format("truetype");
    font-weight: bold;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Play", sans-serif;
}

/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
    --bg-deep:      #0c0c10;
    --bg-card:      #131318;
    --bg-surface:   #1a1a1f;
    --bg-input:     #0f0f14;
    --border:       #252530;
    --border-hover: #3d3d4a;
    --purple:       #7c3aed;
    --purple-light: #a78bfa;
    --purple-dim:   rgba(124, 58, 237, 0.18);
    --purple-glow:  rgba(124, 58, 237, 0.45);
    --text-primary: #e9d5ff;
    --text-muted:   #9ca3af;
    --text-dim:     #6b7280;
    --green:        #22c55e;
    --red:          #ef4444;
    --blue:         #3b82f6;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */
body {
    background: radial-gradient(ellipse at top, #1a1420 0%, var(--bg-deep) 60%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ── Title bar ────────────────────────────────────────────────────────────── */
#titleBar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(12, 12, 16, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

#titleLogo {
    width: 28px;
    filter: drop-shadow(0 0 8px var(--purple-glow));
}

#titleBar h1 {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--purple-light);
    letter-spacing: 1px;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow:
        0 0 0 1px rgba(124, 58, 237, 0.06),
        0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(124, 58, 237, 0.06);
    padding: 36px;
    position: relative;
    margin-top: 56px; /* clear fixed title bar */
}

/* Subtle purple top accent line */
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple), transparent);
    border-radius: 1px;
}

/* ── Key display box ──────────────────────────────────────────────────────── */
.keybox {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    user-select: none;
}
.keybox:hover {
    border-color: var(--purple);
    box-shadow: 0 0 18px var(--purple-dim);
}
.keybox span {
    font-family: monospace;
    font-size: .95rem;
    letter-spacing: 2px;
    color: var(--text-primary);
    font-weight: bold;
}

/* ── Status message ───────────────────────────────────────────────────────── */
.status-msg {
    font-size: .78rem;
    color: var(--text-dim);
    min-height: 1.2em;
    transition: color .2s;
    text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    padding: 11px 16px;
    font-size: .85rem;
    font-weight: bold;
    font-family: "Play", sans-serif;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }

.btn-primary {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
}
.btn-primary:hover { box-shadow: 0 0 20px var(--purple-glow); }

.btn-secondary {
    background: var(--bg-surface);
    color: var(--purple-light);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--purple); box-shadow: 0 0 12px var(--purple-dim); }

.btn-green {
    background: linear-gradient(135deg, #16a34a, #14532d);
    color: #fff;
}
.btn-green:hover { box-shadow: 0 0 18px rgba(22, 163, 74, 0.5); }

.btn-orange {
    background: linear-gradient(135deg, #d97706, #92400e);
    color: #fff;
}
.btn-orange:hover { box-shadow: 0 0 18px rgba(217, 119, 6, 0.5); }

/* Small action buttons */
.btn-sm {
    padding: 5px 10px;
    font-size: .72rem;
    border-radius: 7px;
    border: 1px solid transparent;
    font-weight: bold;
    font-family: "Play", sans-serif;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.btn-sm:hover { transform: translateY(-1px); }

.btn-sm-copy  { background: rgba(168,85,247,.12); color: #c084fc; border-color: rgba(168,85,247,.22); }
.btn-sm-check { background: rgba(59,130,246,.12);  color: #93c5fd; border-color: rgba(59,130,246,.22); }
.btn-sm-del   { background: rgba(239,68,68,.1);    color: #fca5a5; border-color: rgba(239,68,68,.2);  }
.btn-sm-green { background: rgba(34,197,94,.12);   color: #86efac; border-color: rgba(34,197,94,.22); }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge-active  {
    background: rgba(34,197,94,.12);  color: #86efac;
    border: 1px solid rgba(34,197,94,.25); border-radius: 20px;
    font-size: .68rem; padding: 2px 9px; font-weight: bold;
}
.badge-expired {
    background: rgba(239,68,68,.1);   color: #fca5a5;
    border: 1px solid rgba(239,68,68,.2); border-radius: 20px;
    font-size: .68rem; padding: 2px 9px; font-weight: bold;
}
.badge-dur {
    background: rgba(255,255,255,.1);
    border-radius: 6px; padding: 1px 6px;
    font-size: .7rem; font-weight: normal;
}

/* ── Script badge (used on index page) ────────────────────────────────────── */
.script-badge {
    background: var(--purple-dim);
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .76rem;
    color: #c4b5fd;
    text-align: center;
    margin-bottom: 6px;
}

/* ── Form inputs (shared) ─────────────────────────────────────────────────── */
.input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: .85rem;
    font-family: "Play", sans-serif;
    width: 100%;
    transition: border-color .2s;
}
.input:focus { outline: none; border-color: var(--purple); }
.input::placeholder { color: var(--text-dim); }

/* ── 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-hover);
    border-radius: 24px; cursor: pointer; transition: .2s;
}
.toggle .slider::before {
    content: ""; position: absolute;
    width: 18px; height: 18px; left: 3px; top: 3px;
    background: white; border-radius: 50%; transition: .2s;
}
.toggle input:checked + .slider { background: var(--purple); }
.toggle input:checked + .slider::before { transform: translateX(20px); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }
