/* ==========================================================================
   GeoArbitrage - Modern CSS3 Stylesheet
   Zero Frameworks, Optimized CSS Custom Properties & Responsive Grid/Flexbox
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Root Variables
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #121826;
  --bg-card: rgba(22, 30, 46, 0.7);
  --bg-card-hover: rgba(30, 41, 64, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Brand Accent Colors */
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-green: #10b981;
  --accent-emerald: #059669;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --gradient-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --gradient-glow: linear-gradient(135deg, rgba(0, 242, 254, 0.15) 0%, rgba(79, 172, 254, 0.05) 100%);
  
  /* Ad & Affiliate Badges */
  --badge-ad-bg: rgba(245, 158, 11, 0.15);
  --badge-ad-text: #fbbf24;
  --badge-ad-border: rgba(245, 158, 11, 0.3);
  
  /* Layout & Geometry */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.2);
  
  --max-width: 1200px;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(0, 114, 255, 0.2);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --gradient-primary: linear-gradient(135deg, #0052d4 0%, #4364f7 50%, #6fb1fc 100%);
  --gradient-glow: linear-gradient(135deg, rgba(67, 100, 247, 0.08) 0%, rgba(111, 177, 252, 0.04) 100%);
  
  --shadow-lg: 0 16px 32px -8px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(67, 100, 247, 0.15);
}

/* --------------------------------------------------------------------------
   2. Global Resets & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   3. Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal);
}

[data-theme="light"] .site-header {
  background-color: rgba(255, 255, 255, 0.85);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--accent-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   4. Hero Section & Calculator
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 4rem 0 3rem;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: var(--gradient-glow);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 660px;
  margin: 0 auto;
}

/* Main Calculator Grid Card */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  position: relative;
  overflow: hidden;
}

.calculator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.form-select, .form-input {
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2094a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

/* Custom Range Slider */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.slider-val-display {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  outline: none;
  border: 1px solid var(--border-color);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Output Display Box */
.calc-results {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
}

.result-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.result-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.result-multiplier {
  font-size: 3.25rem;
  font-weight: 900;
  line-height: 1.1;
  margin: 0.5rem 0;
  color: var(--accent-green);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.result-multiplier-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-val {
  font-weight: 700;
  color: var(--text-primary);
}

.detail-val.positive {
  color: var(--accent-green);
}

/* Progress bar indicators */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.breakdown-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease-out;
}

/* CTA Button */
.btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--gradient-primary);
  color: #050b14;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

/* --------------------------------------------------------------------------
   5. Ad & Affiliate Placeholders
   -------------------------------------------------------------------------- */
.ad-slot-banner {
  margin: 3rem 0;
  background: var(--bg-card);
  border: 1px dashed var(--badge-ad-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
}

.ad-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--badge-ad-bg);
  color: var(--badge-ad-text);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ad-content {
  display: flex;
  flex-direction: column;
}

.ad-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.ad-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ad-btn {
  white-space: nowrap;
  padding: 0.65rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ad-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Affiliate Grid Section */
.affiliate-section {
  padding: 3rem 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

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

.affiliate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.affiliate-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
}

.affiliate-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.affiliate-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid var(--border-color);
}

.affiliate-body h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.affiliate-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  max-width: 320px;
}

.footer-col h5 {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7. Responsive Design Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .calculator-card {
    grid-template-columns: 1fr;
    padding: 1.75rem;
  }
  
  .hero-title {
    font-size: 2.25rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .navbar {
    height: 60px;
  }
  
  .nav-links {
    display: none; /* Mobile menu can be toggled */
  }
  
  .hero-title {
    font-size: 1.85rem;
  }
  
  .ad-slot-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ad-btn {
    width: 100%;
    text-align: center;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
