/* ============================================
   BitMine.id — Digital Gold Design System
   v1.0.0 | 2026-05-01
   ============================================ */

/* --- Color Tokens --- */
:root {
  /* Dark theme (default) */
  --bg-base: #0a0a0c;
  --bg-card: #111114;
  --bg-card-hover: #17171b;
  --bg-elevated: #1c1c21;
  --bg-input: #0d0d10;
  --border: #222228;
  --border-hover: #333340;
  --text-primary: #fafafa;
  --text-secondary: #a0a0ab;
  --text-muted: #666675;

  /* Shared accents */
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dark: #d97706;
  --secondary: #6366f1;
  --profit: #22c55e;
  --loss: #ef4444;
  --btc: #f7931a;
  --eth: #627eea;
  --sim: #f97316;

  /* Layout */
  --header-h: 48px;
  --bottom-nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 200ms ease;
}

html.light {
  --bg-base: #f9f9fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f2f2f5;
  --bg-elevated: #eaeaef;
  --bg-input: #ffffff;
  --border: #dde0e6;
  --border-hover: #c0c4cc;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5060;
  --text-muted: #888898;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* --- Container --- */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Glass Cards --- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.mining-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15), 0 0 4px rgba(245, 158, 11, 0.1);
}

.staking-card-active {
  border-color: var(--secondary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15), 0 0 4px rgba(99, 102, 241, 0.1);
}

.sim-card {
  border: 2px dashed var(--sim);
  position: relative;
}
.sim-card::before {
  content: 'SIMULASI';
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--sim);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent-light); }
.btn-primary:active { background: var(--accent-dark); }

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover { background: #818cf8; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: rgba(245, 158, 11, 0.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 13px; }

/* --- Form Inputs --- */
.input, .select, .textarea {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}
.input::placeholder { color: var(--text-muted); }
.textarea { height: auto; min-height: 100px; padding: 12px 16px; resize: vertical; }
.input-group { margin-bottom: 16px; }
.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.badge-btc { background: rgba(247, 147, 26, 0.15); color: var(--btc); }
.badge-eth { background: rgba(98, 126, 234, 0.15); color: var(--eth); }
.badge-profit { background: rgba(34, 197, 94, 0.15); color: var(--profit); }
.badge-loss { background: rgba(239, 68, 68, 0.15); color: var(--loss); }
.badge-sim {
  background: transparent;
  color: var(--sim);
  border: 1px dashed var(--sim);
}

/* --- Carousel --- */
.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-item {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.stat-card {
  text-align: center;
  padding: 20px 12px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- FAQ Accordion --- */
details.faq-item {
  border-bottom: 1px solid var(--border);
}
details.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: '+';
  font-size: 20px;
  color: var(--text-muted);
  transition: transform var(--transition);
}
details.faq-item[open] summary::after {
  content: '-';
}
details.faq-item .faq-body {
  padding: 0 0 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  animation: fadeIn 200ms ease;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.5s infinite;
}
html.light .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.04), transparent);
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 20px; margin-bottom: 12px; width: 60%; }
.skeleton-card { height: 120px; }

/* --- Trust Bar --- */
.trust-bar {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
}
.trust-bar::-webkit-scrollbar { display: none; }
.trust-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* --- Calculator --- */
.calc-form .calc-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.calc-result-label { color: var(--text-muted); font-size: 13px; }
.calc-result-value { font-weight: 700; font-size: 15px; }
.calc-result-value.profit { color: var(--profit); }

/* --- Plan Cards --- */
.plan-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.plan-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}
.plan-price .currency { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.plan-hash { font-size: 13px; color: var(--text-secondary); }
.plan-yield { font-size: 14px; color: var(--profit); font-weight: 600; }
.plan-features {
  width: 100%;
  text-align: left;
  font-size: 13px;
  color: var(--text-secondary);
}
.plan-features li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.plan-features li::before {
  content: '\2713';
  color: var(--profit);
  margin-right: 8px;
  font-weight: 700;
}

/* --- Bottom Nav --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 100;
}
html.light .bottom-nav { background: rgba(249, 249, 251, 0.88); }

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  padding: 8px 12px;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition);
}
.bottom-nav a svg, .bottom-nav a img { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--accent); }

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: transform 300ms ease;
}
html.light .site-header { background: rgba(249, 249, 251, 0.88); }
.site-header.hidden { transform: translateY(-100%); }
.site-header .logo {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

/* --- WA Float Button --- */
.wa-float {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  z-index: 90;
  transition: transform var(--transition);
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 26px; height: 26px; fill: #fff; }

/* --- Sticky CTA Bar --- */
.sticky-cta {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 95;
  transform: translateY(100%);
  transition: transform 300ms ease;
}
.sticky-cta.visible { transform: translateY(0); }

/* --- Section Spacing --- */
.section { padding: 32px 0; }
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* --- Utility --- */
.text-accent { color: var(--accent); }
.text-profit { color: var(--profit); }
.text-loss { color: var(--loss); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-mono { font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fade { animation: fadeIn 300ms ease; }
.animate-slide { animation: slideUp 400ms ease; }
.animate-pulse { animation: pulse 1.5s ease infinite; }

/* --- View Transitions --- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fadeIn 200ms ease reverse; }
::view-transition-new(root) { animation: fadeIn 200ms ease; }

/* --- Scrollbar --- */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
}
@media (pointer: coarse) {
  * { scrollbar-width: none; }
  ::-webkit-scrollbar { display: none; }
}

/* --- Responsive --- */
@media (min-width: 640px) {
  html { font-size: 15px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .carousel-item { min-width: 280px; }
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .container { padding: 0 24px; }
}

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .wa-float { bottom: 24px; }
  .sticky-cta { bottom: 0; }
}

/* --- Safe Area --- */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
