/*
 * SalarySplitHub - Core Stylesheet
 * Responsive, glassmorphic dark theme designed for SEO (CLS preservation)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Design Tokens */
  --bg-color: #0a0b10;
  --card-bg: rgba(18, 20, 32, 0.75);
  --card-border: rgba(30, 34, 53, 0.6);
  
  --text-primary: #ffffff;
  --text-secondary: #8a99ad;
  --text-muted: #4e5e75;
  
  --net-color: #00e676;
  --fed-color: #ff9100;
  --state-color: #ff1744;
  --fica-color: #2979ff;
  --deduct-color: #ffd600;
  
  --input-bg: #16192b;
  --input-border: #242a45;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  padding: 0;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

a {
  color: var(--net-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

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

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 2rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo:hover .logo-icon {
  transform: rotate(-12deg) scale(1.1);
}

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

.nav-links li {
  position: relative;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a.dropdown-trigger.active {
  color: var(--text-primary);
}

/* Dropdown Menu Styles */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: rgba(18, 20, 32, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  list-style: none;
  padding: 0.5rem 0;
  min-width: 180px;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  margin-top: 0.75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  
  /* Smooth Fade & Slide Animation */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: left;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: rgba(0, 230, 118, 0.08);
  color: var(--net-color);
  padding-left: 1.5rem; /* Soft slide effect on hover */
}

.dropdown-menu a.active {
  color: var(--net-color);
  font-weight: 600;
  background-color: rgba(0, 230, 118, 0.05);
}

.dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-trigger .arrow {
  display: inline-block;
  font-size: 0.7rem;
  margin-left: 0.2rem;
  vertical-align: middle;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.dropdown:hover .dropdown-trigger .arrow {
  transform: rotate(180deg);
  color: var(--text-primary);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  margin-bottom: 2rem;
}

/* Form inputs & interactive sliders */
.form-group {
  margin-bottom: 1.5rem;
}

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

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.form-input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  transition: border-color 0.2s ease;
  font-family: var(--font-sans);
}

.input-container .form-input {
  padding-left: 2rem;
}

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

.form-select {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  outline: none;
  font-family: var(--font-sans);
}

/* Custom Slider */
.slider-group {
  margin-top: 1rem;
}

.slider-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--input-border);
  outline: none;
  margin: 1rem 0;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--net-color);
  cursor: pointer;
  transition: transform 0.1s ease;
}

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

/* Toggle Grid for filing status */
.radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background-color: var(--input-bg);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color 0.2s, color 0.2s;
  text-align: center;
}

.radio-group input[type="radio"] {
  display: none;
}

.radio-group input[type="radio"]:checked + .radio-label {
  background-color: var(--input-border);
  color: var(--text-primary);
  font-weight: 600;
}

/* Donut Chart visual styles */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 1.5rem 0;
}

.donut-chart {
  transform: rotate(-90deg);
}

.donut-hole {
  fill: #121420;
}

.donut-ring {
  stroke: #1c1f30;
}

.donut-segment {
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s ease, stroke-dashoffset 0.3s ease;
}

.chart-center-text {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.chart-center-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--net-color);
}

.chart-center-lbl {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Legend items */
.legend {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.color-net { background-color: var(--net-color); }
.color-fed { background-color: var(--fed-color); }
.color-state { background-color: var(--state-color); }
.color-fica { background-color: var(--fica-color); }
.color-deduct { background-color: var(--deduct-color); }

/* Data display tables */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

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

.breakdown-table th {
  color: var(--text-secondary);
  font-weight: 500;
}

.breakdown-table tr.total-row td {
  font-weight: 700;
  border-bottom: none;
  font-size: 1.05rem;
}

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

/* Core Web Vitals layout shift mitigation */
.ad-placeholder {
  width: 100%;
  min-height: 250px; /* Locked dimensions to prevent CLS */
  background-color: rgba(22, 25, 43, 0.5);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Footer Compliance pages navigation */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 3rem 0;
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

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

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.disclaimer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 800px;
  line-height: 1.5;
}

/* Editorial Guide Elements (SEO Content) */
.editorial-section {
  max-width: 800px;
  margin: 0 auto 3rem auto;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.editorial-section p {
  margin-bottom: 1.25rem;
}

.editorial-section ul, 
.editorial-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.editorial-section li {
  margin-bottom: 0.5rem;
}

.faq-wrapper {
  margin-top: 2rem;
}

.faq-item {
  border-bottom: 1px solid var(--card-border);
  padding: 1.25rem 0;
}

.faq-question {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.faq-answer {
  color: var(--text-secondary);
}

.state-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.state-card {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.state-card:hover {
  transform: translateY(-2px);
  border-color: var(--net-color);
}

.state-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.state-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-title-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--net-color);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* State comparison linking grid (SILO SEO) */
.state-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.state-link-item {
  display: block;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  text-align: center;
  color: var(--net-color);
  font-weight: 500;
  font-size: 0.9rem;
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.state-link-item:hover {
  transform: translateY(-2px);
  border-color: var(--net-color);
  background-color: rgba(0, 230, 118, 0.05);
  opacity: 1;
}
