@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --neon-cyan: #00f5ff;
    --neon-magenta: #ff00c8;
    --neon-violet: #7b2fff;
    --bg-void: #03040a;
    --bg-deep: #070a14;
    --bg-panel: rgba(8, 12, 28, 0.92);
    --bg-card: rgba(10, 15, 30, 0.85);
    --border-glow: rgba(0, 245, 255, 0.18);
    --border-subtle: rgba(0, 245, 255, 0.07);
    --text-primary: #e8f4ff;
    --text-secondary: #5a7a99;
    --text-muted: #2a3a55;
    --font-display: 'Orbitron', 'Share Tech Mono', monospace;
    --font-mono: 'Share Tech Mono', 'Monaco', monospace;
    --font-body: 'Inter', system-ui, sans-serif;
}

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

/* ─── BASE ─────────────────────────────────────── */
body {
    font-family: var(--font-body);
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(0, 245, 255, 0.035) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 80%, rgba(123, 47, 255, 0.03) 0%, transparent 60%);
    min-height: 100vh;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Scanlines overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.07) 2px,
        rgba(0, 0, 0, 0.07) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Grid BG pattern */
.glass-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 245, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* ─── HEADER / LOGO ─────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-top: 0.5rem;
}

.glitch-wrapper {
    margin-bottom: 0.6rem;
    position: relative;
    display: inline-block;
}

.glitch {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    text-shadow:
        0 0 10px rgba(0, 245, 255, 0.8),
        0 0 30px rgba(0, 245, 255, 0.4),
        0 0 60px rgba(0, 245, 255, 0.15);
    position: relative;
    display: inline-block;
    animation: glitch-flicker 8s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: var(--font-display);
    font-weight: 900;
}

.glitch::before {
    color: var(--neon-magenta);
    text-shadow: 0 0 10px rgba(255, 0, 200, 0.7);
    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
    animation: glitch-before 6s infinite;
    opacity: 0;
}

.glitch::after {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.7);
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    animation: glitch-after 6s infinite;
    opacity: 0;
}

@keyframes glitch-flicker {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.85; }
    97% { opacity: 1; }
    98% { opacity: 0.9; }
}

@keyframes glitch-before {
    0%, 88%, 100% { opacity: 0; transform: translate(0); }
    89% { opacity: 0.8; transform: translate(-3px, 1px); }
    90% { opacity: 0; }
    91% { opacity: 0.6; transform: translate(3px, -1px); }
    92% { opacity: 0; }
}

@keyframes glitch-after {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    91% { opacity: 0.7; transform: translate(3px, 2px); }
    92% { opacity: 0; }
    93% { opacity: 0.5; transform: translate(-2px, -1px); }
    94% { opacity: 0; }
}

.tagline {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.8;
}

.tagline::before {
    content: '// ';
    color: var(--neon-cyan);
    opacity: 0.5;
}

/* ─── PANELS ────────────────────────────────────── */
.search-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 4px;
    padding: 1.6rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-glow);
    border-top: 2px solid var(--neon-cyan);
    box-shadow:
        0 0 0 1px var(--border-subtle),
        0 4px 40px rgba(0, 245, 255, 0.06),
        inset 0 1px 0 rgba(0, 245, 255, 0.08);
    position: relative;
    z-index: 10;
}

.search-panel::before {
    content: 'SYNTH_QUERY.exe';
    position: absolute;
    top: -1px;
    right: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--bg-deep);
    background: var(--neon-cyan);
    padding: 0.1rem 0.5rem;
    text-transform: uppercase;
}

/* ─── TABS ──────────────────────────────────────── */
.search-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.8rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.45rem 1rem;
    border-radius: 2px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.tab-btn:hover {
    background: rgba(0, 245, 255, 0.06);
    color: var(--neon-cyan);
    border-color: var(--border-glow);
}

.tab-btn.active {
    background: rgba(0, 245, 255, 0.1);
    color: var(--neon-cyan);
    border-color: rgba(0, 245, 255, 0.35);
    text-shadow: 0 0 8px rgba(0, 245, 255, 0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* ─── INPUTS ────────────────────────────────────── */
.input-group {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.input-icon {
    background: rgba(0, 245, 255, 0.06);
    padding: 0 1rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    color: var(--neon-cyan);
    height: 48px;
    border: 1px solid var(--border-glow);
}

input,
.input-group input {
    flex: 1;
    min-width: 200px;
    background: rgba(5, 10, 22, 0.9);
    border: 1px solid var(--text-muted);
    border-radius: 2px;
    padding: 0.85rem 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.15s;
    letter-spacing: 0.02em;
}

input::placeholder {
    color: var(--text-muted);
    font-family: var(--font-mono);
    opacity: 0.7;
}

input:focus {
    border-color: var(--neon-cyan);
    box-shadow:
        0 0 0 1px rgba(0, 245, 255, 0.2),
        0 0 15px rgba(0, 245, 255, 0.1),
        inset 0 0 20px rgba(0, 245, 255, 0.03);
    background: rgba(0, 245, 255, 0.03);
}

.input-hint {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.05em;
}

/* ─── BUTTONS ───────────────────────────────────── */
.btn {
    padding: 0.7rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 15;
}

.btn-outline {
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 245, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.08);
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 245, 255, 0.6);
    box-shadow:
        0 0 15px rgba(0, 245, 255, 0.15),
        inset 0 0 15px rgba(0, 245, 255, 0.05);
}

.btn-primary:hover {
    background: rgba(0, 245, 255, 0.1);
    box-shadow:
        0 0 25px rgba(0, 245, 255, 0.3),
        inset 0 0 20px rgba(0, 245, 255, 0.08);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    background: rgba(0, 245, 255, 0.04);
    border: 1px solid var(--text-muted);
    border-radius: 2px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 15;
}

.btn-icon:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    text-shadow: 0 0 6px rgba(0, 245, 255, 0.6);
}

/* ─── RESULTS SECTION ───────────────────────────── */
.results-section {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    border-left: 2px solid var(--neon-cyan);
    overflow: hidden;
    position: relative;
    z-index: 5;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(0, 245, 255, 0.02);
}

.results-header h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.results-count {
    background: rgba(0, 245, 255, 0.12);
    padding: 0.15rem 0.6rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 245, 255, 0.2);
    letter-spacing: 0.05em;
}

.results-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.results-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    position: relative;
    z-index: 5;
}

/* ─── RESULT CARDS ──────────────────────────────── */
.result-card {
    background: rgba(5, 10, 22, 0.7);
    border-radius: 2px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.4rem;
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--neon-cyan);
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

.result-card:hover {
    transform: translateX(3px);
    background: rgba(0, 245, 255, 0.04);
    border-color: rgba(0, 245, 255, 0.25);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.05);
}

.result-content {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    word-break: break-all;
    flex: 1;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.result-badge {
    background: rgba(0, 245, 255, 0.1);
    padding: 0.15rem 0.55rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--neon-cyan);
    white-space: nowrap;
    border: 1px solid rgba(0, 245, 255, 0.2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    color: var(--neon-cyan);
}

/* ─── FOOTER STATS ──────────────────────────────── */
.footer-stats {
    margin-top: 1.5rem;
    text-align: center;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 245, 255, 0.05);
    padding: 0.35rem 0.9rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    letter-spacing: 0.08em;
}

.stat-badge i { color: var(--neon-cyan); }

/* ─── TOAST ─────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(5, 10, 22, 0.97);
    backdrop-filter: blur(20px);
    padding: 0.65rem 1.4rem;
    border-radius: 2px;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    z-index: 9998;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 25px rgba(0, 245, 255, 0.2);
    border: 1px solid rgba(0, 245, 255, 0.4);
    border-top: 2px solid var(--neon-cyan);
    pointer-events: none;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 245, 255, 0.5);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ─── ANIMATIONS ────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 245, 255, 0.3); }
    50%       { box-shadow: 0 0 20px rgba(0, 245, 255, 0.6); }
}

/* ─── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb {
    background: rgba(0, 245, 255, 0.3);
    border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }

/* ─── Z-INDEX FIX ───────────────────────────────── */
button, .btn, .tab-btn, .btn-icon, input {
    position: relative;
    z-index: 15;
}

/* ─── LOGOUT BUTTON ─────────────────────────────── */
.logout-btn {
    position: fixed !important;
    top: 1rem;
    right: 1rem;
    background: transparent !important;
    border: 1px solid var(--text-muted) !important;
    border-radius: 2px !important;
    color: var(--text-secondary) !important;
    font-family: var(--font-mono) !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    padding: 0.4rem 0.8rem !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    z-index: 100 !important;
}

.logout-btn:hover {
    border-color: #ff3355 !important;
    color: #ff3355 !important;
    text-shadow: 0 0 8px rgba(255, 51, 85, 0.5) !important;
}

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 1rem; }

    .glitch { font-size: 1.6rem; letter-spacing: 0.08em; }
    .tagline { font-size: 0.7rem; }

    .input-group { flex-direction: column; }
    .input-icon { display: none; }
    .btn-primary { width: 100%; justify-content: center; }

    .result-card { flex-direction: column; align-items: flex-start; }
    .result-badge { align-self: flex-start; }

    .search-tabs { justify-content: flex-start; }
    .tab-btn { padding: 0.35rem 0.7rem; font-size: 0.72rem; }

    .search-panel::before { display: none; }
}
