/**
 * OBBBA Tax Calculator - Enhanced Styles
 * Modern, clean design with clear visual hierarchy
 */

:root {
  /* Color Palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --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);

  /* Typography */
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
}

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: white;
  text-align: center;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
  opacity: 0.1;
}

.header-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

header h1 {
  position: relative;
  font-size: var(--font-size-4xl);
  font-weight: 700;
  margin: 0 0 var(--space-md);
  letter-spacing: -0.025em;
}

header p {
  position: relative;
  font-size: var(--font-size-lg);
  margin: 0 auto;
  opacity: 0.95;
  max-width: 600px;
  text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .header-content {
    text-align: center;
  }
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

/* Card Container */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  margin: var(--space-2xl) var(--space-md) var(--space-2xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Section Styles */
.section {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.section:last-child {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.section-icon {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.section-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Information Sections */
.info-section {
  background: var(--surface-hover);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* Details/Summary Styles */
details {
  margin: var(--space-md) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: var(--space-lg);
  background: var(--surface-hover);
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

summary:hover {
  background: #e2e8f0;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "ℹ️";
  font-size: var(--font-size-base);
}

summary::after {
  content: "▶";
  font-size: var(--font-size-sm);
  margin-left: auto;
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(90deg);
}

.details-box {
  padding: var(--space-lg);
  background: var(--surface);
}

/* Form Styles */
.form-section {
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
}

.form-grid {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.input-wrapper {
  position: relative;
}

input, select, textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  background: var(--surface);
  transition: all 0.2s ease;
  font-size: var(--font-size-base);
}

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

.input-prefix {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-weight: 500;
  pointer-events: none;
}

input[type="number"] {
  padding-left: 2rem;
}

small {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

/* Button Styles */
.button-container {
  display: flex;
  justify-content: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-md);
  font: 600 var(--font-size-lg)/1 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  min-width: 200px;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
}

button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

button[id="calcBtn"]::before {
  content: '📊';
  margin-right: var(--space-sm);
}

button[type="submit"]::before {
  content: '📧';
  margin-right: var(--space-sm);
}

/* Results Section */
.results-section {
  background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-2xl);
}

.results-placeholder .icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.results-content {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.results-content.show {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.results-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 var(--space-sm);
}

.results-subtitle {
  color: var(--text-secondary);
  margin: 0;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.result-card {
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.result-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.result-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.result-value.current {
  color: var(--secondary);
}

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

.result-value.savings {
  color: var(--primary);
  font-size: var(--font-size-3xl);
}

.savings-highlight {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  margin: var(--space-lg) 0;
}

.savings-amount {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.savings-description {
  opacity: 0.9;
  font-size: var(--font-size-base);
}

/* Benefits Breakdown */
.benefits-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.benefits-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.benefit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
}

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

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

.benefit-value {
  font-weight: 600;
  color: var(--success);
}

/* Medicaid Assessment Styles */
.medicaid-assessment {
  margin-top: var(--space-lg);
}

.assessment-questions {
  margin-bottom: var(--space-xl);
}

.assessment-item {
  margin-bottom: var(--space-md);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  cursor: pointer;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
  border: 1px solid transparent;
}

.checkbox-label:hover {
  background-color: rgba(234, 88, 12, 0.05);
  border-color: rgba(234, 88, 12, 0.2);
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background-color: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: #ea580c;
  border-color: #ea580c;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.label-text {
  flex: 1;
  color: #374151;
  line-height: 1.5;
  font-size: var(--font-size-base);
  font-weight: 500;
}

.assessment-result {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  margin-top: var(--space-lg);
}

.assessment-result.low-risk {
  background-color: #f0fdf4;
  border-color: #16a34a;
  color: #15803d;
}

.assessment-result.moderate-risk {
  background-color: #fffbeb;
  border-color: #d97706;
  color: #92400e;
}

.assessment-result.high-risk {
  background-color: #fef2f2;
  border-color: #dc2626;
  color: #b91c1c;
}

/* Disclaimer */
.disclaimer {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.disclaimer-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  color: #92400e;
  margin-bottom: var(--space-sm);
}

.disclaimer-content {
  color: #92400e;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin: 0;
}

/* Feedback Section */
.feedback-section {
  background: var(--surface-hover);
}

.feedback-options {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.feedback-method {
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.feedback-method h4 {
  margin: 0 0 var(--space-sm);
  color: var(--text-primary);
  font-size: var(--font-size-lg);
}

.feedback-method p {
  margin: 0;
  color: var(--text-secondary);
}

.quick-feedback {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.feedback-btn {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: auto;
  flex: 1;
}

.feedback-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.feedback-btn.positive {
  border-color: var(--success);
  color: var(--success);
}

.feedback-btn.positive:hover {
  background: var(--success);
  color: white;
}

.feedback-btn.neutral {
  border-color: var(--warning);
  color: var(--warning);
}

.feedback-btn.neutral:hover {
  background: var(--warning);
  color: white;
}

.feedback-btn.negative {
  border-color: var(--danger);
  color: var(--danger);
}

.feedback-btn.negative:hover {
  background: var(--danger);
  color: white;
}

.feedback-status {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 500;
}

#fbStatus {
  min-height: 1.5rem;
  text-align: center;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  font-weight: 500;
}

#fbStatus.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

#fbStatus.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Footer */
footer {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
  background: var(--surface);
}

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

footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
  }

  header {
    padding: var(--space-xl) var(--space-md);
  }

  header h1 {
    font-size: var(--font-size-3xl);
  }

  .card {
    margin: calc(-1 * var(--space-lg)) auto var(--space-lg);
  }

  .section {
    padding: var(--space-lg);
  }

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

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

  .result-value.savings {
    font-size: var(--font-size-2xl);
  }
}

@media (max-width: 480px) {
  .section {
    padding: var(--space-md);
  }

  .form-group {
    gap: var(--space-xs);
  }

  button {
    min-width: auto;
    width: 100%;
  }
}
/* SEO + engagement sections */
.quick-nav {
  background: #eff6ff;
}

.chip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.chip-links a {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
}

.chip-links a:hover {
  background: #dbeafe;
}

.calc-help-text {
  display: block;
  margin-top: 0.5rem;
  text-align: center;
}

.section-intro {
  color: var(--text-secondary);
  margin-top: 0;
}

.related-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.related-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
}

.related-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.related-card p {
  color: #64748b;
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}

.related-card a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.related-card a:hover {
  text-decoration: underline;
}

.medicaid-section {
  background: linear-gradient(145deg, #fef7ed 0%, #fed7aa 100%);
}

.medicaid-intro {
  color: #92400e;
  margin-bottom: 1.5rem;
}

.medicaid-btn {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
}

.result-empty-state {
  background: #f3f4f6;
  border-radius: 0.75rem;
  margin: 1rem 0;
  padding: 1rem;
  text-align: center;
}

.result-empty-state h4 {
  color: #6b7280;
  margin: 0 0 0.35rem;
}

.result-empty-state p {
  color: #6b7280;
  margin: 0;
}

.income-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  margin-top: 1.25rem;
  padding: 1rem;
}

.income-summary-box h5 {
  color: #4b5563;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.income-summary-grid {
  color: #6b7280;
  display: grid;
  font-size: 0.88rem;
  gap: 0.45rem;
  grid-template-columns: 1fr 1fr;
}

.income-summary-grid span:nth-child(2n) {
  text-align: right;
}

.share-panel {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
}

.share-panel h5 {
  margin: 0 0 0.4rem;
}

.share-panel p {
  color: #475569;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.secondary-btn {
  background: #1e293b;
  box-shadow: none;
  font-size: 0.95rem;
  min-width: 160px;
  padding: 0.6rem 1rem;
}

.secondary-btn:hover {
  background: #0f172a;
}

.share-status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

.result-summary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  color: #334155;
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 0.8rem;
  overflow-x: auto;
  padding: 0.75rem;
  white-space: pre-wrap;
}

.results-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.results-related-links a {
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.results-related-links a:hover {
  text-decoration: underline;
}

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