/* =========================================================================
   ZEKAA-VIP Steam Manifest Generator
   Modern, responsive dark theme (deep purple / neon accents / glassmorphism)
   ========================================================================= */

:root {
    --bg-0: #0a0410;
    --bg-1: #150a24;
    --purple: #9933ff;
    --purple-dark: #7a0bc0;
    --purple-light: #b366ff;
    --green: #10b981;
    --green-dark: #059669;
    --text: #e9e6f0;
    --text-muted: #a99fc0;
    --border: rgba(153, 51, 255, 0.22);
    --card-bg: rgba(18, 10, 30, 0.72);
    --danger: #f87171;
    --radius: 18px;
    --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 50% -10%, #2a0a4a 0%, var(--bg-0) 70%) fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

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

/* ---------------------------------------------------------------- Nav */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 4, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}
.nav-brand i { color: var(--purple-light); font-size: 1.4rem; }
.nav-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--purple-light); }

/* ---------------------------------------------------------------- Layout */
.main-content { flex: 1; }
.app-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 2.5rem 1.1rem 4rem;
}

/* ---------------------------------------------------------------- Hero */
.hero { text-align: center; margin-bottom: 2.2rem; animation: fadeDown 0.7s ease; }
.hero-logo i {
    font-size: 3.4rem;
    color: var(--purple-light);
    filter: drop-shadow(0 0 18px var(--purple));
}
.hero-title {
    font-size: clamp(2.4rem, 7vw, 3.6rem);
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0.4rem 0 0;
    background: linear-gradient(135deg, #fff 0%, var(--purple-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple));
    box-shadow: 0 0 18px rgba(153, 51, 255, 0.45);
}
.hero-tag {
    max-width: 560px;
    margin: 1.1rem auto 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}
.hero-tag code {
    color: var(--purple-light);
    background: rgba(153, 51, 255, 0.12);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.86em;
}

/* ---------------------------------------------------------------- Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.8rem;
    animation: fadeUp 0.6s ease;
}
.search-card { position: relative; z-index: 20; }

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* ---------------------------------------------------------------- Search box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 7px 7px 7px 14px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.search-box:focus-within {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(153, 51, 255, 0.18);
}
.search-icon { color: var(--purple-light); font-size: 1.2rem; }
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.05rem;
    padding: 10px 4px;
    min-width: 0;
}
.search-input::placeholder { color: rgba(255, 255, 255, 0.32); }

.btn-search {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple));
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 11px 18px;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.btn-search:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(122, 11, 192, 0.5); }
.btn-search i { font-size: 1.05rem; }

.search-hint {
    margin: 0.9rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.search-hint i { color: var(--purple-light); }

/* ---------------------------------------------------------------- Suggestions */
.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(16, 9, 27, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 340px;
    overflow-y: auto;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    display: none;
}
.suggestions.open { display: block; }
.suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.suggestion:last-child { border-bottom: none; }
.suggestion:hover, .suggestion.active { background: rgba(153, 51, 255, 0.18); }
.suggestion img {
    width: 68px;
    height: 32px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: #000;
}
.suggestion-info { display: flex; flex-direction: column; min-width: 0; }
.suggestion-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.suggestion-appid { font-size: 0.75rem; color: var(--text-muted); }
.suggestion-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------- Loader */
.loader { text-align: center; padding: 2.4rem 1rem; }
.spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 1rem;
    border: 3px solid rgba(153, 51, 255, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.loader p { color: var(--text-muted); letter-spacing: 0.5px; margin: 0; }

/* ---------------------------------------------------------------- Error */
.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 1.4rem;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
    font-size: 0.92rem;
}
.alert-error i { color: var(--danger); font-size: 1.2rem; flex-shrink: 0; }

/* ---------------------------------------------------------------- Game card */
.game-card { margin-top: 1.5rem; padding: 0; overflow: hidden; }
.game-hero { position: relative; }
.game-header-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
}
.game-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 18px 22px;
    background: linear-gradient(to top, rgba(10, 4, 16, 0.96) 12%, rgba(10, 4, 16, 0.35) 60%, transparent 100%);
}
.game-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px solid rgba(153, 51, 255, 0.5);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
    background: #000;
}
.game-hero-text { min-width: 0; }
.game-name {
    margin: 0;
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.game-type {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--purple-light);
    background: rgba(153, 51, 255, 0.16);
    padding: 2px 10px;
    border-radius: 20px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px 22px;
}
.stat {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.stat-wide { grid-column: 1 / -1; }
.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.stat-label i { color: var(--purple-light); margin-right: 3px; }
.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
}

/* Actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 22px 22px;
}
.btn {
    flex: 1;
    min-width: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    padding: 15px 20px;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    color: #fff;
}
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--purple-dark), var(--purple)); box-shadow: 0 10px 22px rgba(122, 11, 192, 0.35); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(153, 51, 255, 0.5); }
.btn-success { background: linear-gradient(135deg, var(--green), var(--green-dark)); box-shadow: 0 10px 22px rgba(16, 185, 129, 0.3); }
.btn-success:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(16, 185, 129, 0.5); }

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

/* Manifest result */
.manifest-result {
    margin: 0 22px 22px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
}
.manifest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.manifest-head code { color: var(--purple-light); }
.btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(153, 51, 255, 0.16);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-mini:hover { background: rgba(153, 51, 255, 0.3); }
.manifest-pre {
    margin: 0;
    padding: 16px;
    max-height: 340px;
    overflow: auto;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #d6cff0;
    white-space: pre;
}

/* Disclaimer */
.disclaimer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 2rem auto 0;
    max-width: 520px;
    line-height: 1.6;
}

/* ---------------------------------------------------------------- Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(10, 4, 16, 0.6);
    margin-top: auto;
}
.footer-inner { max-width: 780px; margin: 0 auto; padding: 2rem 1.1rem; text-align: center; }
.footer-title { font-weight: 800; margin: 0 0 0.6rem; }
.footer-title i { color: var(--purple-light); }
.footer-note { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; margin: 0 0 0.8rem; }
.footer-copy { color: var(--text-muted); font-size: 0.78rem; margin: 0; opacity: 0.7; }

/* ---------------------------------------------------------------- Toasts */
.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 92vw;
}
.toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 11px;
    background: rgba(18, 10, 30, 0.96);
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    animation: toastIn 0.3s ease;
}
.toast-item.leaving { animation: toastOut 0.3s ease forwards; }
.toast-item i { font-size: 1.15rem; flex-shrink: 0; }
.toast-success i { color: var(--green); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--purple-light); }

/* ---------------------------------------------------------------- Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 560px) {
    .app-wrap { padding: 1.6rem 0.9rem 3rem; }
    .card { padding: 1.3rem; }
    .btn-search span { display: none; }
    .btn-search { padding: 11px 14px; }
    .stats-grid { grid-template-columns: 1fr; }
    .game-header-img { height: 175px; }
    .btn { min-width: 100%; }
    .actions { flex-direction: column; }
}
