/* CSS Reset and Variables */
:root {
  --color-bg: #050505;
  --color-surface: #111111;
  --color-silver: #E0E0E0;
  --color-silver-dim: #A0A0A0;
  --color-accent: #FFFFFF;
  --color-glow: rgba(224, 224, 224, 0.15);
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-silver);
  font-family: var(--font-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inheritance;
}

/* Typography */
h1,
h2,
h3 {
  color: var(--color-accent);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 2rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

p {
  color: var(--color-silver-dim);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* Layout Utilities */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-silver-dim);
  transition: color 0.3s ease;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links a:hover {
  color: var(--color-accent);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
  background-image: url('/static/assets/circuit_bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(5, 5, 5, 0.2) 0%, var(--color-bg) 90%);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  z-index: 1;
}

.hero-tagline {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--color-silver);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.03);
}

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--color-silver);
  color: var(--color-bg);
  font-weight: 600;
  border-radius: 4px;
  margin-top: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.hero-image {
  position: relative;
  /* animation: float 6s ease-in-out infinite; */
  transition: transform 0.1s ease-out;
  /* Smooth out the scroll rotation slightly */
}

.hero-image img {
  width: 100%;
  max-width: 500px;
  height: auto;
  filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.1));
}

/* Features Grid */
.features {
  background: var(--color-surface);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2.5rem;
  border-radius: 8px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--color-silver);
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

/* Banner/Strip */
.keywords-strip {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2rem 0;
  overflow: hidden;
  background: #000;
}

.keywords-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  text-align: center;
}

.keyword {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-silver-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Footer */
footer {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 1rem;
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero::before {
    top: -20%;
    right: -50%;
  }

  .nav-links {
    display: none;
    /* Simple hiding for MVP */
  }
}

/* Market Section */
.market {
  padding: 4rem 0;
  background-color: #050505;
}

.market h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  background: linear-gradient(90deg, #fff, #a0a0a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.market-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.chart-container,
.news-console {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem;
}

.chart-container h3,
.news-console h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #a0a0a0;
}

#price-header {
  margin-bottom: 1.5rem;
}

#current-price {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

#price-change-container {
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.positive {
  color: #00ff88;
}

.negative {
  color: #ff3333;
}

#time-range-label {
  color: #666;
  margin-left: 0.2rem;
}

#d3-chart {
  width: 100%;
  height: 400px;
}

#news-feed {
  height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.8rem;
  border-radius: 6px;
  border-left: 3px solid #00ff88;
  animation: fadeIn 0.5s ease-in;
}

.news-item .time {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.news-item .title {
  font-size: 0.9rem;
  color: #ddd;
}

/* Breaking News Styles */
.news-item--breaking {
  border-left-color: #ff6b35;
  background: rgba(255, 107, 53, 0.1);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

.breaking-label {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b35 0%, #ff3333 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.4rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* D3 Chart Styles */
.line {
  fill: none;
  stroke: #00ff88;
  stroke-width: 2px;
}

.axis path,
.axis line {
  stroke: #444;
}

.axis text {
  fill: #888;
}

/* Scrollbar for news */
#news-feed::-webkit-scrollbar {
  width: 6px;
}

#news-feed::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

#news-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

@media (max-width: 768px) {
  .market-grid {
    grid-template-columns: 1fr;
  }
}

/* Modal Styles */
.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: var(--color-surface);
  margin: 10vh auto;
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-modal {
  color: var(--color-silver-dim);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
  color: var(--color-accent);
  text-decoration: none;
}

.modal-content h2 {
  margin-top: 0;
  font-size: 2rem;
  text-align: center;
}

.modal-content p {
  text-align: center;
  margin-bottom: 2rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.seed-word {
  width: 100%;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-silver);
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  text-align: center;
}

.seed-word:focus {
  outline: none;
  border-color: var(--color-silver);
  background: rgba(255, 255, 255, 0.08);
}

#seed-phrase:focus {
  outline: none;
  border-color: var(--color-silver);
  background: rgba(255, 255, 255, 0.08);
}

.full-width {
  width: 100%;
  text-align: center;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
}

.error-message {
  color: #ff3333;
  margin-top: 1.5rem;
  text-align: center;
  font-weight: bold;
  min-height: 1.5em;
  /* Reserve space */
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }

  100% {
    transform: translateX(0);
  }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

@media (max-width: 480px) {
  .seed-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .modal-content {
    width: 95%;
    padding: 1.5rem;
    margin: 5vh auto;
  }

  .seed-word {
    padding: 0.6rem;
    font-size: 0.85rem;
  }
}

/* Utility */
.hidden {
  display: none !important;
}

/* Dashboard View */
#dashboard-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('/static/assets/circuit_bg.png');
  background-size: cover;
  background-position: center;
  position: relative;
}

#dashboard-view::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(5, 5, 5, 0.4) 0%, var(--color-bg) 90%);
  pointer-events: none;
}

.dashboard-content {
  text-align: center;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

#balance-display {
  font-size: 6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #00ff88 50%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
}

.big-button {
  font-size: 2rem;
  padding: 1.5rem 4rem;
  background: #00ff88;
  color: #050505;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.big-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.5);
  background: #fff;
}

#happy-end {
  font-size: 8rem;
  color: #00ff88;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}