/* ============================================================
   ZEN MINER — Main Stylesheet
   ============================================================ */

:root {
  --primary:     #6C63FF;
  --primary-d:   #574fd6;
  --secondary:   #4A90D9;
  --accent:      #FF6B6B;
  --success:     #48BB78;
  --warning:     #ECC94B;
  --bg:          #F8F9FA;
  --surface:     #FFFFFF;
  --surface2:    #F0F2F5;
  --border:      #E2E8F0;
  --text:        #2D3748;
  --muted:       #718096;
  --light:       #A0AEC0;
  --radius:      14px;
  --shadow:      0 4px 24px rgba(108,99,255,.10);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
  --transition:  .2s ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0F1117;
    --surface:  #1A1D27;
    --surface2: #22263A;
    --border:   #2D3248;
    --text:     #EDF2F7;
    --muted:    #A0AEC0;
    --light:    #718096;
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--muted); }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────── */
.container  { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page-wrap  { min-height: calc(100vh - 80px); padding: 32px 0; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.navbar .container {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 8px 14px; border-radius: 8px;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--surface2); color: var(--text);
  text-decoration: none;
}
.nav-links .btn-sm { color: #fff !important; }

.nav-hamburger { display: none; cursor: pointer; padding: 8px; border-radius: 8px; }
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); margin: 5px 0;
  transition: var(--transition);
}

@media (max-width: 640px) {
  .nav-hamburger { display: block; }
  .nav-links {
    display: none; flex-direction: column; align-items: flex-start;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px 20px; gap: 4px;
  }
  .nav-links.open { display: flex; }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  border: none; transition: var(--transition);
  text-decoration: none !important;
  min-height: 44px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; box-shadow: 0 4px 15px rgba(108,99,255,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,99,255,.45); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger  { background: var(--accent); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost   { background: var(--surface2); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-sm  { padding: 8px 16px; font-size: .875rem; border-radius: 10px; }
.btn-lg  { padding: 16px 32px; font-size: 1.1rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card-header { margin-bottom: 16px; }
.card-title  { font-size: 1.1rem; font-weight: 700; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
label       { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.input {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 1rem;
  transition: var(--transition); outline: none;
  min-height: 44px;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,.15); }
.input-error { border-color: var(--accent) !important; }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: 10px;
  margin-bottom: 16px; font-size: .9rem; font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-error   { background: #FFF5F5; color: #C53030; border: 1px solid #FEB2B2; }
.alert-success { background: #F0FFF4; color: #276749; border: 1px solid #9AE6B4; }
.alert-info    { background: #EBF8FF; color: #2B6CB0; border: 1px solid #90CDF4; }
.alert-warning { background: #FFFFF0; color: #975A16; border: 1px solid #F6E05E; }

/* Dark mode alert overrides */
@media (prefers-color-scheme: dark) {
  .alert-error   { background: #2D1515; color: #FC8181; border-color: #822727; }
  .alert-success { background: #1A2E22; color: #68D391; border-color: #276749; }
  .alert-info    { background: #1A2535; color: #63B3ED; border-color: #2C5282; }
  .alert-warning { background: #2D2315; color: #F6AD55; border-color: #7B4F12; }
}

/* ── Stat grid ─────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: 6px; font-weight: 500; }

/* ── Coin badge ─────────────────────────────────────────────────── */
.coin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; padding: 4px 12px; border-radius: 999px;
  font-family: 'Courier New', monospace; font-weight: 700; font-size: .85rem;
}
.coin-badge.genesis    { background: linear-gradient(135deg, #FFD700, #FFA500); color: #1a1a1a; }
.coin-badge.palindrome { background: linear-gradient(135deg, #7C3AED, #4F46E5); }
.coin-badge.milestone  { background: linear-gradient(135deg, #059669, #0D9488); }
.coin-badge.lucky      { background: linear-gradient(135deg, #D97706, #B45309); }
.coin-badge.repeating  { background: linear-gradient(135deg, #DB2777, #9D174D); }
.coin-badge.sequence   { background: linear-gradient(135deg, #2563EB, #1D4ED8); }

/* ── Mining panel ───────────────────────────────────────────────── */
.mining-panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
  position: relative; overflow: hidden;
}
.mining-panel.active { border-color: var(--primary); }
.mining-panel.active::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(108,99,255,.05), rgba(74,144,217,.05));
  pointer-events: none;
}

.mining-icon {
  width: 80px; height: 80px; margin: 0 auto 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  background: var(--surface2);
  transition: var(--transition);
}
.mining-panel.active .mining-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108,99,255,.4); }
  50%       { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(108,99,255,0); }
}

.mining-status {
  font-size: 1.1rem; font-weight: 700;
  color: var(--muted);
}
.mining-panel.active .mining-status { color: var(--primary); }

.mining-timer {
  font-size: 3rem; font-weight: 800;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px; margin: 12px 0;
  color: var(--text);
}

/* ── Progress bar ────────────────────────────────────────────────── */
.progress-wrap { margin: 20px 0; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .85rem; font-weight: 600; }
.progress-bar   { background: var(--surface2); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-fill  {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .5s ease;
}

/* ── Activity indicator ──────────────────────────────────────────── */
.activity-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 6px;
  background: var(--success);
}
.activity-dot.active-movement { background: var(--accent); animation: blink .5s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Coin list ───────────────────────────────────────────────────── */
.coin-list { display: flex; flex-wrap: wrap; gap: 8px; }
.coin-item { cursor: default; transition: transform .15s; }
.coin-item:hover { transform: scale(1.05); }

/* ── Donation cards ──────────────────────────────────────────────── */
.donate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.donate-card {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 28px 20px; text-align: center;
  cursor: pointer; transition: var(--transition);
  background: var(--surface);
}
.donate-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); }
.donate-card.selected { border-color: var(--primary); background: rgba(108,99,255,.05); }
.donate-emoji { font-size: 2.5rem; margin-bottom: 12px; }
.donate-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }

/* ── Table ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table      { width: 100%; border-collapse: collapse; }
th, td     { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
th         { font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  text-align: center; padding: 80px 20px;
  background: linear-gradient(160deg, rgba(108,99,255,.08) 0%, rgba(74,144,217,.05) 100%);
}
.hero-badge {
  display: inline-block; background: rgba(108,99,255,.1); color: var(--primary);
  padding: 6px 16px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 { margin-bottom: 20px; }
.hero p  { font-size: 1.15rem; max-width: 520px; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Features grid ─────────────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature-card  { padding: 28px; }
.feature-icon  { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 8px; }

/* ── Misc ─────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 12px; }
.section-sub   { text-align: center; margin-bottom: 48px; font-size: 1.1rem; }
.divider       { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: .78rem; font-weight: 600; }
.tag-green  { background: #E6FFED; color: #276749; }
.tag-red    { background: #FFF5F5; color: #C53030; }
.tag-blue   { background: #EBF8FF; color: #2B6CB0; }
.tag-purple { background: #F3F0FF; color: #5B21B6; }
@media (prefers-color-scheme: dark) {
  .tag-green  { background: #1A2E22; color: #68D391; }
  .tag-red    { background: #2D1515; color: #FC8181; }
  .tag-blue   { background: #1A2535; color: #63B3ED; }
  .tag-purple { background: #1F1535; color: #B794F4; }
}
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

/* ── Coin animation ─────────────────────────────────────────────────── */
.coin-pop {
  position: fixed; pointer-events: none;
  font-size: 2rem; z-index: 9999;
  animation: coinPop 1.5s ease-out forwards;
}
@keyframes coinPop {
  0%   { transform: translateY(0) scale(.5); opacity: 1; }
  80%  { transform: translateY(-120px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-160px) scale(1); opacity: 0; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 20px; text-align: center;
  color: var(--muted); font-size: .85rem; margin-top: auto;
}
footer a { color: var(--primary); }
