/* CalcVault - Shared Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

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

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

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

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo span {
  color: var(--secondary);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

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

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

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

/* Calculator Page Layout */
.calc-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.calc-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.calc-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.calc-description {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

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

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
}

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

/* Results */
.result {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  display: none;
}

.result.show {
  display: block;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

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

.result-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.95rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

/* Secondary Results */
.result-secondary {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 1.25rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  display: none;
}

.result-secondary.show {
  display: block;
}

.result-secondary .result-value {
  color: var(--primary);
  font-size: 1.5rem;
}

/* Homepage Grid */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  margin: -2rem -1rem 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.category-section {
  margin-bottom: 3rem;
}

.category-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.calc-link {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: block;
  border: 2px solid transparent;
}

.calc-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.calc-link h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.calc-link p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.calc-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

/* Footer */
.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  margin-top: 3rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb span {
  color: var(--text-light);
  margin: 0 0.5rem;
}

/* Related Calculators */
.related {
  margin-top: 2rem;
}

.related h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.related-link {
  background: var(--card);
  padding: 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.2s;
  font-size: 0.95rem;
}

.related-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }
}

/* Ad Placeholder */
.ad-space {
  background: var(--bg);
  border: 2px dashed var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-light);
  border-radius: var(--radius);
  margin: 2rem 0;
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.range-value {
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.5rem;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Table */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

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

.result-table th {
  font-weight: 600;
  background: var(--bg);
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  width: 50px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Chart placeholder */
.chart-container {
  height: 200px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}
