/* Inherit from existing Phase 4 variables */
:root {
  --bg-color: #030407;
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-border: rgba(255, 255, 255, 0.05);
  --text-main: #f0f6fc;
  --text-secondary: #c9d1d9;
  --text-muted: #8b949e;
  --accent-purple: #9945FF;
  --accent-green: #14F195;
  --nav-bg: rgba(3, 4, 7, 0.7);
  --bg-blur: blur(24px);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  /* Phase 7: Locked layout scroll */
  overflow: hidden; 
  position: relative;
}

body::before {
  content: ''; position: fixed; top: -10%; left: -10%; width: 50vw; height: 50vh;
  background: radial-gradient(circle, rgba(153, 69, 255, 0.15) 0%, transparent 70%);
  z-index: -1; filter: blur(80px); animation: float1 15s ease-in-out infinite alternate;
}
body::after {
  content: ''; position: fixed; bottom: -10%; right: -10%; width: 50vw; height: 50vh;
  background: radial-gradient(circle, rgba(20, 241, 149, 0.1) 0%, transparent 70%);
  z-index: -1; filter: blur(80px); animation: float2 20s ease-in-out infinite alternate;
}

@keyframes float1 { 0% { transform: translate(0,0); } 100% { transform: translate(5%, 10%); } }
@keyframes float2 { 0% { transform: translate(0,0); } 100% { transform: translate(-5%, -10%); } }

/* NAVBAR */
.navbar {
  background: var(--nav-bg); backdrop-filter: var(--bg-blur);
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 100; height: 75px; display: flex; align-items: center;
}
.nav-content {
  max-width: 1800px; width: 100%; margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 32px; height: 32px; display: flex; justify-content: center; align-items: center; }
.brand span { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }

/* SEARCH BAR */
.search-container { position: relative; width: 100%; max-width: 450px; }
.search-form { display: flex; gap: 8px; width: 100%; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-form input {
  flex: 1; padding: 12px 16px 12px 45px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border);
  color: var(--text-main); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  transition: all 0.2s ease;
}
.search-form input:focus { outline: none; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); box-shadow: 0 0 0 3px rgba(153, 69, 255, 0.2); }
#submit-btn {
  padding: 0 24px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, var(--accent-purple), #7928CA);
  color: white; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2314F195" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>'), auto;
  min-width: 100px; display: flex; justify-content: center; align-items: center; transition: opacity 0.2s;
}
#submit-btn:hover { opacity: 0.9; }

.recent-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; width: 100%;
  background: rgba(10, 14, 23, 0.95); backdrop-filter: var(--bg-blur);
  border: 1px solid var(--card-border); border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 200; overflow: hidden;
}
.recent-dropdown.hidden { display: none; }
.recent-item {
  width: 100%;text-align: left; padding: 12px 16px; border: none; background: transparent;
  color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.2s;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }

.loader { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* PHASE 7: COMMAND CENTER LAYOUT */
.command-center {
   display: flex; height: calc(100vh - 75px); width: 100%; max-width: 1800px; margin: 0 auto;
   padding: 1.5rem; gap: 1.5rem; box-sizing: border-box;
   transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
   transform-origin: center top;
}
body.auth-locked .command-center {
   filter: blur(12px) brightness(0.6);
   transform: scale(0.98) translateY(10px);
   opacity: 0.5;
   pointer-events: none;
}

/* SIDEBARS */
.sidebar {
   width: 280px; min-width: 280px; background: rgba(255,255,255,0.015); backdrop-filter: blur(20px);
   border: 1px solid var(--card-border); border-radius: 12px; display: flex; flex-direction: column;
   overflow-y: auto; padding: 1.5rem; box-shadow: inset 0 0 40px rgba(0,0,0,0.3), 0 10px 40px rgba(0,0,0,0.4); gap: 2rem;
   z-index: 50; animation: fadeUp 0.6s ease forwards;
}

.sidebar-header { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1rem; }
.status-pulse { width: 8px; height: 8px; background: #14F195; border-radius: 50%; box-shadow: 0 0 10px #14F195; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0.6; transform: scale(1); } }

.sidebar-section h4 { font-size: 0.7rem; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 1rem; text-transform: uppercase; font-family: 'JetBrains Mono'; }

/* WATCHLIST IN SIDEBAR */
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-badge { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: rgba(255,255,255,0.02); border-left: 3px solid #14F195; border-radius: 4px; color: #14F195; font-family: 'JetBrains Mono'; font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.wl-badge:hover { background: rgba(20,241,149,0.05); }
.wl-kill { color: var(--text-muted); cursor: crosshair; }
.wl-kill:hover { color: #fca5a5; }

/* LIVE ORACLES */
.market-feed { display: flex; flex-direction: column; gap: 1rem; }
.ticker-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 0.75rem; transition: background 0.2s; }
.ticker-card:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
.t-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.t-asset { font-weight: 700; font-size: 0.75rem; color: var(--text-secondary); letter-spacing: 0.5px; }
.t-pct { font-size: 0.65rem; font-weight: 600; padding: 2px 4px; border-radius: 4px; background: rgba(0,0,0,0.3); }
.t-price { font-size: 1.1rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* CUSTOM MODAL */
.modal-overlay { 
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 1000; display: flex; justify-content: center; align-items: center; 
  opacity: 1; visibility: visible; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.modal-overlay.hidden {
  opacity: 0 !important; visibility: hidden !important; pointer-events: none; display: flex !important;
}
.modal-content { 
  background: rgba(10,14,23,0.9); border: 1px solid var(--card-border); padding: 1.5rem; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); 
  transform: scale(1) translateY(0); opacity: 1; transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1), opacity 0.4s ease;
}
.modal-overlay.hidden .modal-content {
  transform: scale(0.9) translateY(20px); opacity: 0;
}
.modal-content input { width: 100%; padding: 10px 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: var(--text-main); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; margin-bottom: 1.5rem; outline: none; transition: border-color 0.2s; }
.modal-content input:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 2px rgba(153, 69, 255, 0.2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* CENTER CORE */
.center-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding-right: 5px; scroll-behavior: smooth; border-radius: 16px; position: relative; }

/* TAB BAR */
.tab-bar {
  display: flex; gap: 10px; margin-bottom: 2rem; width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 15px; position: sticky; top: 0; background: rgba(3, 4, 7, 0.85); backdrop-filter: var(--bg-blur); z-index: 90; padding-top: 5px;
}
.nav-tab {
  background: transparent; border: none; color: var(--text-muted); padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: 'Plus Jakarta Sans', sans-serif; white-space: nowrap;
}
.nav-tab:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.nav-tab.active { background: rgba(153,69,255,0.15); color: #d838ff; box-shadow: 0 0 15px rgba(153,69,255,0.2); }


/* SPLASH */
.splash { text-align: center; color: var(--text-secondary); max-width: 500px; animation: fadeUp 0.5s ease forwards; }
.splash-icon { margin-bottom: 2rem; color: var(--accent-purple); }
.splash h2 { font-size: 2rem; color: var(--text-main); margin-bottom: 1rem; font-weight: 700; letter-spacing: -0.5px; }

/* ERROR BANNER */
.error-banner { background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); color: #fca5a5; padding: 1rem; text-align: center; border-radius: 8px; margin-bottom: 1.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; }
.hidden { display: none !important; }

/* DASHBOARD HEADER */
.dashboard { animation: fadeUp 0.5s ease forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.dash-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; }
.dash-title h2 { font-size: 2rem; font-weight: 700; margin-bottom: 0.8rem; letter-spacing: -0.5px; }
.badge-group { display: flex; gap: 0.8rem; align-items: center; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--card-border); }
.badge.mono { font-family: 'JetBrains Mono', monospace; }
.alert-badge { background: rgba(220, 38, 38, 0.15); border-color: rgba(220, 38, 38, 0.3); color: #fca5a5; display: flex; align-items: center; gap: 6px; }

.dash-meta { display: flex; flex-direction: column; align-items: flex-end; }
.meta-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin-bottom: 4px; }
.meta-value { font-size: 1.8rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.hl-blue { color: #38bdf8; }

/* LIVE HOLDINGS BANNER */
.live-holdings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; animation: fadeUp 0.5s ease backwards; }
.holding-card { background: rgba(255, 255, 255, 0.02); backdrop-filter: var(--bg-blur); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.holding-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(153, 69, 255, 0.15); }
.hl-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.hl-value { font-size: 1.5rem; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--text-main); }
.net-worth { border-color: rgba(20, 241, 149, 0.2); background: rgba(20, 241, 149, 0.02); }

/* CONTROLS (PILLS) */
.dash-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--card-border); }
.dash-btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.action-pill { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 30px; color: var(--text-secondary); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.action-pill:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-main); border-color: rgba(255, 255, 255, 0.15); }
.action-pill svg { stroke-width: 2.5; }

.currency-toggle { display: flex; background: rgba(0, 0, 0, 0.3); padding: 4px; border-radius: 8px; border: 1px solid var(--card-border); }
.toggle-btn { background: transparent; border: none; color: var(--text-muted); padding: 6px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: 'Plus Jakarta Sans', sans-serif; }
.toggle-btn.active { background: rgba(255, 255, 255, 0.1); color: var(--text-main); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* GRID */
.timeframe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.time-card { background: var(--card-bg); backdrop-filter: var(--bg-blur); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.5rem; position: relative; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.time-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(20, 241, 149, 0.1); }
.time-card.all-time:hover { box-shadow: 0 10px 30px rgba(153, 69, 255, 0.15); }
.time-card.all-time { border-color: rgba(153, 69, 255, 0.3); background: rgba(153, 69, 255, 0.03); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.card-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.metrics { display: flex; flex-direction: column; gap: 0.8rem; }
.metric-row { display: flex; justify-content: space-between; align-items: center; }
.metric-row.small { margin-top: 0; }
.label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.metric-row.small .label { font-size: 0.75rem; }
.value { font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; }
.metric-row.small .value { font-size: 0.85rem; }

.txt-teal { color: var(--accent-green); }
.txt-crimson { color: #f43f5e; }
.txt-pos { color: var(--accent-green); }
.txt-neg { color: #f43f5e; }
.divider { height: 1px; background: var(--card-border); margin: 0.5rem 0; }
.tx-link { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.tx-link.active-link { color: var(--accent-purple); }
.tx-link.active-link:hover { text-decoration: underline; color: #b77aff; }

/* CHARTS & PANELS */
.bottom-panels { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr); }
.panel { background: var(--card-bg); backdrop-filter: var(--bg-blur); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; box-shadow: 0 4px 20px rgba(0,0,0,0.15); transition: box-shadow 0.3s, border-color 0.3s; }
.panel:hover { border-color: rgba(255,255,255,0.1); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.panel-header h3 { font-size: 1.1rem; font-weight: 600; }
.chart-container { flex: 1; min-height: 250px; position: relative; width: 100%; }

.cp-list-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding-right: 5px; }
.cp-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.cp-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); border-radius: 8px; transition: background 0.2s; }
.cp-item:hover { background: rgba(255,255,255,0.05); }
.cp-address { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: var(--text-main); text-decoration: none; }
.cp-address:hover { color: var(--accent-green); text-decoration: underline; }
.cp-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cp-vol { font-size: 0.9rem; font-weight: 600; color: var(--text-main); font-family: 'JetBrains Mono', monospace; }
.cp-int { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

@media (max-width: 1400px) {
   .sidebar { width: 220px; min-width: 220px; }
}
@media (max-width: 1100px) {
   .command-center { display: flex; flex-direction: column; height: auto; overflow: auto; }
   body { overflow: auto; }
   .sidebar { width: 100%; min-width: 100%; position: static; height: auto; gap: 1rem; }
   .global-feed { min-height: 200px; }
   .timeframe-grid { grid-template-columns: 1fr; }
   .live-holdings { grid-template-columns: repeat(2, 1fr); }
}

/* VIS-NETWORK OVERRIDES */
#flow-network .vis-network { outline: none !important; border-radius: 8px; }
#flow-network { box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }

/* Hide scrollbar globally for a cleaner aesthetic */
::-webkit-scrollbar { display: none; }
* { -ms-overflow-style: none; scrollbar-width: none; }
