/* ============================================
   🎮 Game-Inspired Trading Platform Styles
   ============================================ */

:root {
  /* Color Palette - Cyberpunk/Gaming Theme */
  --primary: #00f0ff;
  --primary-dark: #00b8c4;
  --primary-glow: rgba(0, 240, 255, 0.4);
  --secondary: #ff00ff;
  --secondary-glow: rgba(255, 0, 255, 0.4);
  --accent: #ffea00;
  --success: #00ff88;
  --danger: #ff0055;
  --warning: #ffaa00;
  
  /* Backgrounds */
  --bg-dark: #0a0e1a;
  --bg-darker: #050810;
  --bg-card: rgba(20, 25, 45, 0.95);
  --bg-glass: rgba(20, 25, 45, 0.7);
  
  /* Text */
  --text-primary: #e0e8ff;
  --text-secondary: #8892b0;
  --text-muted: #5a6580;
  
  /* Borders & Effects */
  --border-glow: rgba(0, 240, 255, 0.3);
  --shadow-glow: 0 0 20px var(--primary-glow);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-darker);
  color: var(--text-primary);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(0, 240, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 255, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ============================================
   🎯 Header & Navigation
   ============================================ */

header {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glow);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px var(--primary-glow);
  padding: 20px 24px;
  display: inline-block;
}

nav {
  display: flex;
  gap: 0;
  padding: 0 24px 12px;
  flex-wrap: wrap;
  align-items: center;
}

nav a, nav span {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

nav a:hover {
  color: var(--primary);
  background: rgba(0, 240, 255, 0.1);
  transform: translateY(-2px);
}

nav a.active {
  color: var(--primary);
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 15px var(--primary-glow);
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

#userNav {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 13px;
}

#usernameDisplay {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 234, 0, 0.5);
}

/* ============================================
   📦 Main Layout & Cards
   ============================================ */

main {
  display: flex;
  gap: 24px;
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.chat, .result {
  flex: 1;
  min-width: 400px;
}

.result, .strategy-card, .settings-section, .leaderboard-container {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.result::before, .strategy-card::before, .settings-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  opacity: 0.6;
}

/* ============================================
   💬 Chat Interface
   ============================================ */

.chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#messages {
  height: 220px;
  overflow-y: auto;
  background: rgba(5, 8, 16, 0.8);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  margin-bottom: 12px;
  backdrop-filter: blur(5px);
}

#messages::-webkit-scrollbar {
  width: 8px;
}

#messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
  box-shadow: 0 0 10px var(--primary-glow);
}

textarea {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid rgba(0, 240, 255, 0.3);
  background: rgba(5, 8, 16, 0.6);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  background: rgba(5, 8, 16, 0.8);
}

textarea::placeholder {
  color: var(--text-muted);
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================
   🎮 Buttons & Inputs
   ============================================ */

button, select {
  padding: 12px 24px;
  border-radius: 10px;
  border: 2px solid var(--primary);
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before {
  width: 300px;
  height: 300px;
}

button:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: var(--bg-dark);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 0, 255, 0.1);
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-secondary:hover {
  background: rgba(255, 0, 255, 0.2);
  box-shadow: 0 0 20px var(--secondary-glow);
}

.btn-danger {
  background: rgba(255, 0, 85, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-success {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--success);
  color: var(--success);
}

select {
  padding: 10px 16px;
  background: rgba(5, 8, 16, 0.8);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--text-primary);
  font-weight: 600;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* ============================================
   📊 Result Display
   ============================================ */

.result h2 {
  margin-top: 0;
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

pre {
  background: var(--bg-darker);
  color: var(--text-primary);
  padding: 20px;
  border-radius: 12px;
  overflow: auto;
  font-size: 13px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  line-height: 1.6;
  max-height: 500px;
}

pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

pre::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

pre::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

/* ============================================
   🏆 Strategy Cards
   ============================================ */

.strategies-page {
  flex-direction: column;
  width: 100%;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.toolbar h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.strategies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.strategy-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.strategy-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.3);
  border-color: var(--primary);
}

.strategy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.strategy-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-draft {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.status-active {
  background: rgba(0, 255, 136, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.status-archived {
  background: rgba(90, 101, 128, 0.2);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.strategy-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.strategy-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.strategy-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.strategy-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.strategy-actions button {
  flex: 1;
  padding: 10px;
  font-size: 12px;
}

/* ============================================
   🎖️ Leaderboard
   ============================================ */

.leaderboard-container {
  padding: 32px;
}

.leaderboard-header {
  text-align: center;
  margin-bottom: 32px;
}

.leaderboard-header h1 {
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.leaderboard-filters {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.rank-card {
  background: var(--bg-glass);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.rank-card:hover {
  transform: translateX(10px);
  border-color: var(--primary);
  box-shadow: 0 8px 30px var(--primary-glow);
}

.rank-number {
  font-size: 36px;
  font-weight: 900;
  width: 60px;
  text-align: center;
  color: var(--text-muted);
}

.rank-card:nth-child(1) .rank-number {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(255, 234, 0, 0.8);
}

.rank-card:nth-child(2) .rank-number {
  color: #c0c0c0;
  text-shadow: 0 0 20px rgba(192, 192, 192, 0.6);
}

.rank-card:nth-child(3) .rank-number {
  color: #cd7f32;
  text-shadow: 0 0 20px rgba(205, 127, 50, 0.6);
}

.rank-info {
  flex: 1;
}

.rank-info h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--primary);
  font-weight: 700;
}

.rank-info p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.rank-metrics {
  display: flex;
  gap: 24px;
  text-align: center;
}

.rank-metric {
  display: flex;
  flex-direction: column;
}

.rank-metric-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--success);
}

.rank-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   ⚙️ Settings & Forms
   ============================================ */

.settings-page {
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section h2 {
  margin-top: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 2px solid rgba(0, 240, 255, 0.3);
  padding-bottom: 16px;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.settings-section h3 {
  font-size: 18px;
  margin-top: 28px;
  margin-bottom: 16px;
  color: var(--text-primary);
  font-weight: 700;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid rgba(0, 240, 255, 0.3);
  background: rgba(5, 8, 16, 0.6);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  background: rgba(5, 8, 16, 0.8);
}

/* ============================================
   💎 VIP Purchase Cards
   ============================================ */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.pricing-card {
  background: var(--bg-card);
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.pricing-card:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 60px var(--primary-glow);
  border-color: var(--primary);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(255, 234, 0, 0.3);
  transform: scale(1.05);
}

.pricing-card.featured::before {
  background: var(--accent);
}

.pricing-card h3 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 16px 0;
  color: var(--primary);
  text-transform: uppercase;
}

.pricing-card .price {
  font-size: 48px;
  font-weight: 900;
  color: var(--accent);
  margin: 16px 0;
  text-shadow: 0 0 20px rgba(255, 234, 0, 0.5);
}

.pricing-card .price small {
  font-size: 16px;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  text-align: left;
}

.pricing-features li {
  padding: 10px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: bold;
  margin-right: 10px;
}

/* ============================================
   🎨 Utilities & Effects
   ============================================ */

.empty-state, .error {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 16px;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 240, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.glow {
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ============================================
   📱 Responsive Design
   ============================================ */

@media (max-width: 768px) {
  main {
    flex-direction: column;
    padding: 16px;
  }
  
  .chat, .result {
    min-width: 100%;
  }
  
  nav {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .strategies-grid {
    grid-template-columns: 1fr;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .rank-card {
    flex-direction: column;
    text-align: center;
  }
  
  .rank-metrics {
    justify-content: center;
  }
}

/* ============================================
   🌟 Special Effects
   ============================================ */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.5s ease-out;
}

/* Particle effect background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(0, 240, 255, 0.3), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(255, 0, 255, 0.3), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 234, 0, 0.3), transparent);
  background-size: 200px 200px;
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}
