/* ============================================================
   OmniForge Mini — premium dark theme (cyan/magenta)
   Animated, glassy, mobile-first.
   ============================================================ */

:root {
    --bg: #07080f;
    --bg-2: #0e1020;
    --card: rgba(22, 24, 39, .72);
    --card-solid: #161827;
    --card-2: #1c1f33;
    --border: rgba(255, 255, 255, .08);
    --border-2: rgba(255, 255, 255, .14);
    --text: #eef0f8;
    --muted: #9aa0bd;
    --cyan: #22d3ee;
    --indigo: #6366f1;
    --magenta: #e84bd0;
    --grad: linear-gradient(135deg, #22d3ee 0%, #6366f1 48%, #e84bd0 100%);
    --grad-soft: linear-gradient(135deg, rgba(34,211,238,.18), rgba(232,75,208,.18));
    --good: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 18px 48px rgba(0, 0, 0, .5);
    --glow: 0 0 0 1px rgba(34,211,238,.25), 0 12px 40px rgba(34,211,238,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
}
/* Animated aurora background */
body::before {
    content: "";
    position: fixed; inset: -20% -20% auto -20%; height: 80vh; z-index: -2;
    background:
        radial-gradient(45% 55% at 20% 20%, rgba(34,211,238,.20), transparent 60%),
        radial-gradient(45% 55% at 80% 10%, rgba(232,75,208,.18), transparent 60%),
        radial-gradient(50% 60% at 50% 40%, rgba(99,102,241,.16), transparent 60%);
    filter: blur(30px);
    animation: drift 18s ease-in-out infinite alternate;
}
body::after {
    content: "";
    position: fixed; inset: 0; z-index: -3; background: var(--bg);
}
@keyframes drift {
    0%   { transform: translate3d(0,0,0) scale(1); }
    100% { transform: translate3d(0,3%,0) scale(1.08); }
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #67e8f9; }

.container { max-width: 1040px; margin: 0 auto; padding: 18px 16px 96px; }
.container-sm { max-width: 470px; margin: 0 auto; padding: 18px 16px 96px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2e44; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a3f5c; background-clip: padding-box; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px clamp(14px, 4vw, 26px);
    background: rgba(8, 9, 17, .65);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 850; letter-spacing: .2px; font-size: 17px; }
.brand:hover { color: var(--text); }
.brand .logo {
    width: 34px; height: 34px; border-radius: 11px; background: var(--grad);
    display: grid; place-items: center; font-size: 17px;
    box-shadow: 0 6px 20px rgba(34,211,238,.4); animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 6px 28px rgba(232,75,208,.5); } }
.brand .name { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topnav { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.topnav a, .topnav button { font-size: 13px; }

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .4px;
    border: 1px solid var(--border-2); background: rgba(255,255,255,.04);
}
.pill.silver  { color: #e2e8f0; border-color: #64748b; background: rgba(148,163,184,.1); }
.pill.gold    { color: #fde68a; border-color: #b45309; background: rgba(245,158,11,.12); }
.pill.diamond { color: #a5f3fc; border-color: #0891b2; background: rgba(8,145,178,.14); }
.pill.none    { color: var(--muted); }

/* ── Cards & layout ─────────────────────────────────────── */
.card {
    background: var(--card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

h1, h2, h3 { margin: 0 0 10px; line-height: 1.18; letter-spacing: -.2px; }
h1 { font-size: 26px; font-weight: 850; }
h2 { font-size: 20px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 17px; border-radius: var(--radius-sm); border: 1px solid var(--border-2);
    background: rgba(255,255,255,.05); color: var(--text); font-weight: 750; font-size: 14px;
    cursor: pointer; transition: transform .08s ease, filter .15s ease, box-shadow .2s; text-decoration: none;
    position: relative; overflow: hidden;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); color: var(--text); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); border: none; color: #06121a; box-shadow: 0 8px 24px rgba(34,211,238,.28); }
.btn.primary:hover { box-shadow: 0 10px 30px rgba(232,75,208,.34); }
/* sheen */
.btn.primary::after {
    content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-20deg); transition: left .6s ease;
}
.btn.primary:hover::after { left: 140%; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.ghost { background: transparent; }
.btn.wa { background: linear-gradient(135deg, #25d366, #128c52); color: #052e1a; border: none; box-shadow: 0 8px 22px rgba(37,211,102,.25); }
.btn.danger { color: #fecaca; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }

/* ── Forms ───────────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 650; margin: 14px 0 6px; color: #cdd2e8; }
input, textarea, select {
    width: 100%; padding: 12px 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-2); background: rgba(7,8,15,.6); color: var(--text);
    font-size: 15px; font-family: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #5a6080; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
input[type="file"] { padding: 9px; cursor: pointer; }
input[type="file"]::file-selector-button { background: var(--card-2); color: var(--text); border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 12px; margin-right: 10px; cursor: pointer; font-weight: 650; }

.toggle { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; width: 48px; height: 27px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(255,255,255,.08); border: 1px solid var(--border-2); border-radius: 999px; transition: .25s; }
.slider:before { content: ""; position: absolute; height: 19px; width: 19px; left: 3px; top: 3px; background: var(--muted); border-radius: 50%; transition: .25s; }
.switch input:checked + .slider { background: var(--grad); border-color: transparent; }
.switch input:checked + .slider:before { transform: translateX(21px); background: #06121a; }

/* ── Tiles ───────────────────────────────────────────────── */
.tile {
    position: relative; display: flex; flex-direction: column; gap: 7px;
    background: var(--card); backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; cursor: pointer; transition: transform .12s ease, border-color .2s, box-shadow .25s;
    text-decoration: none; color: var(--text); overflow: hidden; animation: rise .45s ease both;
}
.tile::before {
    content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: 0; transition: opacity .25s; pointer-events: none;
}
.tile:hover { border-color: var(--border-2); transform: translateY(-3px); box-shadow: var(--glow); color: var(--text); }
.tile:hover::before { opacity: 1; }
.tile .emoji { font-size: 30px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.tile .t-title { font-weight: 750; font-size: 15px; }
.tile .t-sub { font-size: 12px; color: var(--muted); }
.tile.locked { opacity: .96; }
.tile.locked:hover { border-color: rgba(232,75,208,.5); box-shadow: 0 0 0 1px rgba(232,75,208,.25), 0 12px 40px rgba(232,75,208,.12); }
.lock-badge { position: absolute; top: 11px; right: 11px; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(232,75,208,.16); color: #f0a6e2; border: 1px solid rgba(232,75,208,.45); }
.unlock-badge { position: absolute; top: 11px; right: 11px; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(52,211,153,.14); color: #6ee7b7; border: 1px solid rgba(52,211,153,.4); }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .3px; }
.badge.queued, .badge.pending { background: rgba(251,191,36,.14); color: var(--warn); }
.badge.processing { background: rgba(34,211,238,.14); color: var(--cyan); }
.badge.completed, .badge.approved { background: rgba(52,211,153,.14); color: var(--good); }
.badge.failed, .badge.rejected { background: rgba(248,113,113,.14); color: var(--bad); }

/* ── Alerts / toast ──────────────────────────────────────── */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px; border: 1px solid; }
.alert.err { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.4); color: #fecaca; }
.alert.ok { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.4); color: #bbf7d0; }
.alert.info { background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.35); color: #a5f3fc; }

#toast {
    position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(8px);
    background: var(--card-solid); border: 1px solid var(--border-2); color: var(--text);
    padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; font-size: 14px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: rgba(248,113,113,.6); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: transparent; border: none; color: var(--muted); padding: 10px 13px; font-weight: 750; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--cyan); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 750; background: rgba(255,255,255,.03); position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
code { background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; }

/* ── Tool / result ───────────────────────────────────────── */
.tool-head { display: flex; align-items: center; gap: 13px; margin-bottom: 4px; }
.tool-head .emoji { font-size: 38px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)); }
.result-media { width: 100%; border-radius: 12px; border: 1px solid var(--border-2); margin-top: 10px; background: #000; display: block; }
audio.result-media { background: transparent; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.22); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.10) 50%, rgba(255,255,255,.04) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; height: 96px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.card.featured { border-color: rgba(99,102,241,.5); box-shadow: 0 0 0 1px rgba(99,102,241,.35), 0 18px 50px rgba(99,102,241,.18); }
.card.featured::before { content: "★ Most popular"; position: absolute; top: -11px; left: 18px; background: var(--grad); color: #06121a; font-size: 11px; font-weight: 850; padding: 3px 12px; border-radius: 999px; letter-spacing: .3px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }
.hero { text-align: center; padding: 30px 8px 10px; }
.hero h1 { font-size: clamp(28px, 7vw, 40px); }
.hero .tag { color: var(--muted); max-width: 540px; margin: 8px auto 0; line-height: 1.55; }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 26px 0; color: var(--muted); font-size: 13px; }

/* ── Mobile bottom nav ───────────────────────────────────── */
.bottomnav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; display: none;
    grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
    background: rgba(8, 9, 17, .82); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: 10.5px; font-weight: 650; }
.bottomnav a .ic { font-size: 19px; }
.bottomnav a.active { color: var(--cyan); }

@media (max-width: 720px) {
    .bottomnav { display: grid; }
    .topnav .hide-sm { display: none; }
}
@media (max-width: 560px) {
    .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 22px; }
}
@media (max-width: 380px) {
    .grid.cols-2 { grid-template-columns: 1fr; }
}
