/* ===== COLOR SYSTEM ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(0, 212, 255, 0.04);
  --text-primary: #f0f0f5;
  --text-secondary: #8888aa;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.25);
  --accent-dark: rgba(0, 212, 255, 0.1);
  --success: #00ff7f;
  --warning: #ffab00;
  --danger: #ff1744;
  --border: rgba(0, 212, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0f0f1a 100%);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Subtle animated background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 23, 68, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
  max-width: 100%;
  width: 100%;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 16px;
  padding-top: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== HEADER ===== */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

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

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.btn-share {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dark);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-share:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-share:active {
  transform: translateY(0) scale(0.95);
}

/* Streak Badge */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 23, 68, 0.1), rgba(0, 212, 255, 0.05));
  border: 1px solid rgba(255, 23, 68, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.streak-icon {
  font-size: 18px;
  animation: pulse 2s ease-in-out infinite;
}

.streak-text {
  color: var(--text-primary);
}

#streak-count {
  color: var(--accent);
  font-weight: 700;
}

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

/* Usage Counter */
.usage-counter {
  padding: 12px;
  background: rgba(0, 212, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.usage-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-weight: 600;
}

.usage-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.usage-text {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ===== SECTIONS ===== */
.section-title {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 24px 0 12px 0;
  font-weight: 600;
}

/* Scan Status */
.scan-section {
  margin-top: 8px;
  margin-bottom: 24px;
}

.scan-status {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.scan-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

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

.scan-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.scan-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Alerts */
.alerts-section {
  margin-bottom: 24px;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.alert-card:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--accent);
  transform: translateX(4px);
}

.alert-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.alert-sentiment {
  font-size: 11px;
  color: var(--text-secondary);
}

.alert-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-dark);
  color: var(--accent);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 8px;
}

.alert-badge.bullish {
  background: rgba(0, 255, 127, 0.1);
  color: var(--success);
}

.alert-badge.bearish {
  background: rgba(255, 23, 68, 0.1);
  color: var(--danger);
}

/* Risk Section */
.risk-section {
  margin-bottom: 24px;
}

.risk-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.risk-gauge {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg-secondary) 0%, var(--accent-dark) 100%);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.risk-gauge::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), transparent);
  opacity: 0.3;
}

.risk-percentage {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  z-index: 1;
}

.risk-details {
  flex: 1;
}

.risk-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.risk-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

/* History */
.history-section {
  margin-bottom: 24px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-date {
  color: var(--text-primary);
  font-weight: 500;
}

.history-score {
  color: var(--accent);
  font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-icon {
  font-size: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0099cc);
  color: var(--bg-primary);
  border: 1px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px var(--accent-glow);
}

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

.btn-premium {
  background: linear-gradient(135deg, rgba(255, 23, 68, 0.15), rgba(0, 212, 255, 0.05));
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-premium:hover {
  background: linear-gradient(135deg, rgba(255, 23, 68, 0.2), rgba(0, 212, 255, 0.1));
  border-color: var(--accent);
}

/* Actions Section */
.actions-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.actions-section .btn {
  width: 100%;
}

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-dark);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--accent-glow);
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* Premium Features */
.premium-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--accent-dark);
  border-radius: var(--radius-sm);
}

.feature-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.feature-text {
  font-size: 13px;
  color: var(--text-primary);
}

.premium-pricing {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Share Preview */
.share-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ===== ANIMATIONS ===== */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.1s; }
.animate-in:nth-child(2) { animation-delay: 0.2s; }
.animate-in:nth-child(3) { animation-delay: 0.3s; }
.animate-in:nth-child(4) { animation-delay: 0.4s; }
.animate-in:nth-child(5) { animation-delay: 0.5s; }
.animate-in:nth-child(6) { animation-delay: 0.6s; }
.animate-in:nth-child(7) { animation-delay: 0.7s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 375px) {
  body {
    font-size: 13px;
  }

  .header {
    padding: 16px 12px;
  }

  .main-content {
    padding: 12px;
  }

  .scan-status {
    padding: 24px 16px;
  }

  .scan-icon {
    font-size: 48px;
  }

  .scan-title {
    font-size: 18px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  .risk-card {
    flex-direction: column;
    gap: 16px;
  }

  .risk-gauge {
    width: 80px;
    height: 80px;
  }

  .risk-percentage {
    font-size: 24px;
  }

  .modal-content {
    padding: 20px;
  }
}

/* Hide scrollbar but allow scrolling */
.main-content::-webkit-scrollbar {
  width: 4px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
