/* StackedREI - Global Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #10b981;
  --secondary-dark: #059669;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --dark: #1e293b;
  --dark-light: #334155;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--gray-900);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav a {
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

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

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  transition: all 0.2s;
  background: var(--white);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:hover {
  border-color: var(--gray-300);
}

.form-hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-prefix,
.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  color: var(--gray-500);
  font-weight: 500;
}

.input-prefix {
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-suffix {
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group .form-input {
  border-radius: 0;
}

.input-group .form-input:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .form-input:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Calculator Layout */
.calculator-page {
  padding: 2rem 0;
}

.calculator-header {
  text-align: center;
  margin-bottom: 2rem;
}

.calculator-header h1 {
  margin-bottom: 0.5rem;
}

.calculator-header p {
  color: var(--gray-600);
  font-size: 1.125rem;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

.calculator-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calculator-results {
  position: sticky;
  top: 100px;
}

/* Results Panel */
.results-panel {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
  border-radius: var(--radius-xl);
  padding: 2rem;
  color: white;
}

.results-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.results-header h3 {
  color: white;
  font-size: 1.25rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--gray-400);
  font-size: 0.875rem;
}

.result-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.result-value.positive {
  color: var(--success);
}

.result-value.negative {
  color: var(--danger);
}

.result-value.highlight {
  color: var(--accent);
}

.result-hero {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.result-hero-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--success);
}

.result-hero-label {
  color: var(--gray-300);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Section Dividers */
.section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1rem;
  color: var(--gray-700);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.badge-coming-soon {
  background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
  color: white;
}

/* Tool Cards (Landing Page) */
.tool-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.tool-card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

.tool-card-icon.blue {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

.tool-card-icon.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
}

.tool-card-icon.orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
}

.tool-card-icon.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
}

.tool-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.tool-card p {
  color: var(--gray-600);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.tool-card .badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.tool-card.disabled {
  opacity: 0.7;
  pointer-events: none;
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Sliders */
.slider-container {
  padding: 0.5rem 0;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--gray-200);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

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

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

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

tr:hover {
  background: var(--gray-50);
}

/* Collapsible */
.collapsible {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--gray-50);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.collapsible-header:hover {
  background: var(--gray-100);
}

.collapsible-header h4 {
  font-size: 1rem;
  font-weight: 600;
}

.collapsible-icon {
  transition: transform 0.3s;
}

.collapsible.open .collapsible-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible.open .collapsible-content {
  max-height: 2000px;
}

.collapsible-body {
  padding: 1.5rem;
}

/* Charts placeholder */
.chart-container {
  position: relative;
  height: 300px;
  background: var(--gray-50);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.footer {
  background: var(--dark);
  color: var(--gray-400);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-brand .logo-text {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  display: block;
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer h4 {
  color: white;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer ul {
  list-style: none;
}

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

.footer a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid var(--gray-700);
  margin-top: 2rem;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.dscr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
}

.dscr-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 3rem;
  text-align: center;
  color: white;
  margin: 3rem 0;
}

.cta-section h2 {
  color: white;
  margin-bottom: 1rem;
}

.cta-section p {
  opacity: 0.9;
  margin-bottom: 2rem;
  font-size: 1.125rem;
}

.cta-section .btn {
  background: white;
  color: var(--primary);
}

.cta-section .btn:hover {
  background: var(--gray-100);
}

/* Email Signup */
.email-signup {
  display: flex;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.email-signup input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
}

.email-signup .btn {
  white-space: nowrap;
}

/* Comparison Table */
.comparison-section {
  padding: 4rem 0;
}

.comparison-table {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.comparison-table th {
  background: var(--dark);
  color: white;
  padding: 1.25rem 1.5rem;
}

.comparison-table td {
  padding: 1rem 1.5rem;
  text-align: center;
}

.comparison-table tr:nth-child(even) {
  background: var(--gray-50);
}

.check-mark {
  color: var(--success);
  font-size: 1.25rem;
}

.x-mark {
  color: var(--gray-300);
  font-size: 1.25rem;
}

/* Tooltips */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background: var(--dark);
  color: white;
  font-size: 0.75rem;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 8px);
}

/* Print Styles */
@media print {
  .header, .footer, .btn, .nav {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid var(--gray-200);
  }
  
  .results-panel {
    background: var(--gray-100) !important;
    color: var(--gray-900) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .results-panel * {
    color: var(--gray-900) !important;
  }
  
  .calculator-grid {
    display: block;
  }
  
  .calculator-results {
    position: static;
    margin-top: 2rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-gray { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.hidden { display: none; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
