/* ==========================================================================
   1. VARIABLES & THEME SETUP
   ========================================================================== */
:root {
  /* --- Color Palette: Premium Dark Mode --- */
  --bg-body: #0a0b0e;           /* Deepest void */
  --bg-surface: #14161b;        /* Card background */
  --bg-surface-hover: #1c1f26;  /* Card hover state */
  --bg-glass: rgba(20, 22, 27, 0.7); /* Glassmorphism base */

  /* Brand Colors */
  --brand-primary: #F7931A;     /* Bitcoin Orange */
  --brand-secondary: #50C878;   /* Success / Growth Green */

  
  /* Text Colors */
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --text-dark: #000000;

  /* Borders & Dividers */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #F7931A 0%, #FFAB40 100%);
  --gradient-dark: linear-gradient(180deg, rgba(20, 22, 27, 0) 0%, #0a0b0e 100%);
  --gradient-glow: radial-gradient(circle at center, rgba(247, 147, 26, 0.15) 0%, transparent 70%);

  /* --- Typography (Space Grotesk) --- */
  --font-main: 'Space Grotesk', sans-serif;
  
  /* Fluid Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
  --text-3xl: clamp(2rem, 1.8rem + 1vw, 2.5rem);
  --text-4xl: clamp(2.5rem, 2.2rem + 1.5vw, 3.5rem);

  /* --- Spacing & Layout --- */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* --- Transitions --- */
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ==========================================================================
   3. LAYOUT UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section.alt {
  background-color: rgba(255, 255, 255, 0.02);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

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

.text-center { text-align: center; }
.text-right { text-align: right; }

/* ==========================================================================
   4. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 1rem;
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
  display: block;
}

.lead {
  font-size: var(--text-lg);
  color: var(--text-main);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.section .text-center p {
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  text-align: left;
}

.list li {
  margin-bottom: 0.5rem;
}

.list li strong {
  color: var(--text-main);
}

.ordered-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.ordered-list li {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(10, 11, 14, 0.95);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-logo {
  height: 32px;
  width: auto;
}

.nav-list {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-list a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.nav-list a:hover, .nav-list a.active {
  color: var(--text-main);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Dropdown Styles */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
}

.dropdown-trigger:hover { color: var(--text-main); }

.dropdown-caret {
  font-size: 0.7em;
  transition: transform 0.2s;
}

.dropdown:hover .dropdown-caret { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li { display: block; }

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: var(--bg-surface-hover);
  color: var(--brand-primary);
}

.badge {
  font-size: 0.6rem;
  background: var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ==========================================================================
   6. HERO SECTION
   ========================================================================== */
.hero {
  padding-top: calc(var(--header-height) + 4rem);
  padding-bottom: 6rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(247, 147, 26, 0.08) 0%, transparent 60%);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: var(--text-base);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
}

.cta.primary {
  background: var(--gradient-brand);
  color: var(--text-dark);
  box-shadow: 0 4px 20px rgba(247, 147, 26, 0.3);
}

.cta.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.cta.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-main);
}

/* ==========================================================================
   7. CARDS & COMPONENTS
   ========================================================================== */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  text-align:center;
  flex-direction: column;
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand-primary);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.glass-card .card-link {
  align-self: center;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.card-title {
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.card-desc {
  flex-grow: 1;
  font-size: var(--text-sm);
}

.card-link {
  margin-top: 1.5rem;
  color: var(--brand-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.card-link::after {
  content: '→';
  transition: transform 0.2s;
}

.glass-card:hover .card-link::after {
  transform: translateX(4px);
}

.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  height: 100%;
  display: flex;
  text-align: center;
  flex-direction: column;
}

/* Tools Scroller */
.tools-scroller {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-bottom: 1rem;
}

.tool-pill {
  flex: 0 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.tool-pill:hover {
  border-color: var(--brand-primary);
  background: var(--bg-surface-hover);
}

.tool-pill img {
  width: 24px;
  height: 24px;
}

/* Accordion / FAQ */
.faq-item {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.faq-item summary {
  padding: 1.5rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-lg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--brand-primary);
}

.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  padding-bottom: 1.5rem;
  color: var(--text-muted);
  max-width: 90%;
}

/* ==========================================================================
   8. PAGE SPECIFIC: TABLES & FORMS
   ========================================================================== */
/* Tables */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
}

.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--text-main);
}

.data-table tr:last-child td { border-bottom: none; }

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.form-select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .converter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }
}

.converter-grid .form-group:first-child {
  align-self: center;
}

.fiat-output-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.fiat-output {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.fiat-output-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.fiat-output .form-input {
  padding: 0.75rem;
}

/* Table Inputs */
.fiat-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.goods-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.fiat-info,
.goods-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fiat-input,
.goods-input {
  width: 140px;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.fiat-input:hover,
.goods-input:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fiat-input:focus,
.goods-input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--brand-primary);
}

.swap-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.swap-button:hover {
  color: var(--brand-primary);
  background: rgba(255, 255, 255, 0.05);
  transform: rotate(180deg);
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: var(--text-base);
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.footer-col ul li a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ==========================================================================
   10. ADSENSE & UTILS
   ========================================================================== */
.ad-slot {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden { display: none; }

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .nav-list {
    display: none; /* Mobile menu implementation would go here */
  }
  
  .nav-toggle {
    display: block;
  }
  
  .hero {
    text-align: left;
  }
  
  .cta-group {
    justify-content: flex-start;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
