:root {
    --bg: #050505;
    --surface: #101014;
    --surface-light: #1a1a20;
    --primary: #00f0ff; /* Cyberpunk Cyan */
    --secondary: #7000ff; /* Neon Purple */
    --text: #FFFFFF;
    --text-sub: #DDDDDD;
    --green: #00ff9d;
    --red: #ff0055;
    --font: 'Segoe UI', sans-serif;
}

[data-theme="light"] {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-light: #e4e6eb;
    --text: #1c1e21;
    --text-sub: #3D3D3D;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font); -webkit-tap-highlight-color: transparent; }

body { background: var(--bg); color: var(--text); overflow: hidden; height: 100vh; }

/* 1. SPLASH SCREEN */
#splash-screen {
    position: fixed; inset: 0; background: #000; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.neuro-core {
    width: 60px; height: 60px; border-radius: 50%;
    border: 2px solid var(--secondary); margin-bottom: 20px;
    position: relative; animation: pulse 2s infinite;
}
.core-inner {
    position: absolute; inset: 5px; border-radius: 50%;
    border: 2px solid var(--primary); animation: spin 1s linear infinite;
}
.fade-in { animation: fadeIn 2s ease forwards; }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 20px var(--secondary); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 2. GENERAL LAYOUT */
.screen {
    position: absolute; inset: 0; background: var(--bg);
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0; pointer-events: none;
}
.screen.active { transform: translateX(0); opacity: 1; pointer-events: auto; }

/* HEADER */
header, .detail-header {
    height: 60px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; background: rgba(16, 20, 18, 0.07); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(49, 255, 82, 0.81); z-index: 10;
}
.logo { font-size: 1.2rem; font-weight: bold; }
.logo span { color: var(--primary); }
#theme-toggle, .back-btn, #fav-btn {
    background: none; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer;
}

/* DASHBOARD CONTROLS */
.controls { padding: 15px; background: var(--surface); }
.search-bar {
    background: var(--surface-light); padding: 10px 15px; border-radius: 12px;
    display: flex; align-items: center; gap: 10px; margin-bottom: 15px;
}
.search-bar input {
    background: transparent; border: none; outline: none; color: var(--text); width: 100%;
}
.filter-tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.tab-btn {
    padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(5, 5, 5, 0.38);
    background: transparent; color: var(--text-sub); white-space: nowrap; font-size: 0.9rem;
}
.tab-btn.active { background: var(--primary); color: #000000; border-color: var(--primary); font-weight: bold; }

/* COIN LIST */
.coin-list-container { flex: 1; overflow-y: auto; padding: 10px; padding-bottom: 50px; }
.coin-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px; margin-bottom: 8px; background: var(--surface);
    border-radius: 12px; border: 1px solid transparent; transition: 0.2s;
}
.coin-item:active { transform: scale(0.98); }
.coin-left { display: flex; align-items: center; gap: 12px; }
.coin-left img { width: 32px; height: 32px; border-radius: 50%; }
.coin-info h4 { font-size: 1rem; }
.coin-info span { font-size: 0.8rem; color: var(--text-sub); text-transform: uppercase; }
.price-col { text-align: right; }
.price-col .price { display: block; font-weight: 600; font-size: 1rem; }
.price-col .change { font-size: 0.85rem; }
.green { color: var(--green); }
.red { color: var(--red); }

/* DETAIL VIEW */
.detail-title { display: flex; align-items: center; gap: 10px; }
.detail-title img { width: 30px; }
.chart-wrapper { height: 50vh; width: 100%; background: #000; position: relative; }
#tradingview_container { height: 100%; width: 100%; }

.stats-grid {
    padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
    background: var(--bg); flex: 1; overflow-y: auto;
}
.stat-card {
    background: var(--surface); padding: 15px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05); text-align: center;
}
.stat-card span { font-size: 0.75rem; color: var(--text-sub); text-transform: uppercase; letter-spacing: 1px; }
.stat-card h3 { margin-top: 5px; font-size: 1.1rem; }
.stat-card.full-width { grid-column: span 2; display: flex; justify-content: space-between; align-items: center; }