:root {
  --bg-dark: #080b10;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 35, 54, 0.95);
  --border-color: rgba(56, 189, 248, 0.15);
  --border-glow: rgba(56, 189, 248, 0.4);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  --accent-red: #f43f5e;
  --accent-red-glow: rgba(244, 63, 94, 0.35);
  --accent-purple: #8b5cf6;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 242, 254, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-orb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 16px var(--accent-cyan);
  animation: pulse-glow 3s infinite alternate;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-title span {
  color: var(--accent-cyan);
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.green {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.red {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.status-dot.gray {
  background: var(--text-dim);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.25));
  color: var(--accent-cyan);
  border: 1px solid var(--border-glow);
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.2);
}

/* Tab Content */
.tab-content {
  display: none;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* VOICE TAB STYLES */
.voice-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}

.orb-container {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 1.25rem;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  opacity: 0.3;
  transition: all 0.3s ease;
}

.ring-1 { width: 100%; height: 100%; }
.ring-2 { width: 120%; height: 120%; }
.ring-3 { width: 140%; height: 140%; }

.core-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #00f2fe, #4facfe 60%, #1e1b4b);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.3s ease;
}

.core-orb .mic-icon {
  width: 32px;
  height: 32px;
}

/* Speaking & Listening Animation States */
.orb-container.listening .core-orb {
  background: radial-gradient(circle at 30% 30%, #f43f5e, #e11d48 60%, #881337);
  box-shadow: 0 0 45px rgba(244, 63, 94, 0.8);
  transform: scale(1.1);
  animation: pulse-rapid 0.8s infinite alternate;
}

.orb-container.listening .orb-ring {
  border-color: var(--accent-red);
  animation: expand-ring 1.2s infinite ease-out;
}

.orb-container.speaking .core-orb {
  background: radial-gradient(circle at 30% 30%, #10b981, #059669 60%, #064e3b);
  box-shadow: 0 0 45px rgba(16, 185, 129, 0.8);
  animation: pulse-wave 1.5s infinite alternate;
}

.orb-container.speaking .orb-ring {
  border-color: var(--accent-green);
  animation: expand-ring 1.5s infinite ease-out;
}

.voice-state-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.voice-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.voice-controls-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* Quick Prompts */
.quick-prompts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.prompt-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-chip:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Dialogue Box */
.dialogue-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dialogue-msg {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.4;
  animation: fadeIn 0.2s ease;
}

.dialogue-msg.user {
  background: rgba(0, 242, 254, 0.1);
  border-left: 3px solid var(--accent-cyan);
  align-self: flex-end;
  max-width: 85%;
}

.dialogue-msg.agent {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--accent-green);
  align-self: flex-start;
  max-width: 90%;
}

.dialogue-msg.system {
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.dialogue-msg .sender {
  font-size: 0.7rem;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.dialogue-msg.user .sender { color: var(--accent-cyan); }
.dialogue-msg.agent .sender { color: var(--accent-green); }

/* Text Input Form */
.text-input-form {
  display: flex;
  gap: 0.5rem;
}

.text-input-form input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.9rem;
}

.text-input-form input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #080b10;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-buy {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  flex: 1;
  padding: 12px;
}

.btn-sell {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  font-weight: 700;
  flex: 1;
  padding: 12px;
}

.btn-icon {
  padding: 10px 14px;
}

.w-full { width: 100%; }

/* Toggle Switch */
.btn-toggle {
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-toggle.active {
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green-glow);
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-toggle.active .toggle-knob {
  transform: translateX(22px);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* TICKER BANNER */
.ticker-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(18, 24, 38, 0.9), rgba(15, 23, 42, 0.95));
  border-left: 4px solid var(--accent-cyan);
}

.ticker-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ticker-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.ticker-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  transition: color 0.3s ease;
}

.ticker-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-green);
}

.ticker-change.negative {
  color: var(--accent-red);
}

.ticker-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--text-main);
}

.signal-tag {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  display: inline-block;
  width: fit-content;
}

.signal-tag.buy {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

/* Indicator Grid */
.indicators-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.indicator-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ind-name { font-size: 0.7rem; color: var(--text-dim); font-weight: 600; }
.ind-val { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; }
.ind-status { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.ind-status.green { color: var(--accent-green); }

.trade-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Alerts List */
.alerts-container {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 10px;
  border: 1px solid var(--border-color);
}

.alerts-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.alert-item {
  font-size: 0.78rem;
  color: var(--text-main);
  padding: 4px 8px;
  border-left: 2px solid var(--accent-cyan);
  background: rgba(255, 255, 255, 0.02);
}

/* STATS ROW */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.stat-val.positive { color: var(--accent-green); }
.stat-sub { font-size: 0.75rem; color: var(--text-muted); }
.stat-sub.positive { color: var(--accent-green); }

/* Table */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th {
  padding: 8px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem !important;
  font-family: inherit !important;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}

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

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.08); opacity: 1; }
}

@keyframes pulse-rapid {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

@keyframes pulse-wave {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

@keyframes expand-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
  .app-container { padding: 0.5rem; }
  .grid-2col { grid-template-columns: 1fr; }
  .ticker-banner { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
