/* NHS Pay Calculator - Main Stylesheet */
/* Modern, responsive design optimized for calculators */

:root {
  /* NHS Brand Colors */
  --nhs-blue: #005eb8;
  --nhs-blue-dark: #003d7a;
  --nhs-blue-light: #0072ce;
  --nhs-green: #00a33b;
  --nhs-red: #da291c;
  --nhs-orange: #ed8b00;
  
  /* UI Colors */
  --primary: #005eb8;
  --primary-dark: #003d7a;
  --success: #00a33b;
  --warning: #ed8b00;
  --danger: #da291c;
  
  /* Neutral Colors */
  --text-primary: #212b32;
  --text-secondary: #4c6272;
  --text-muted: #768692;
  --border-color: #d8dde0;
  --bg-gray: #f0f4f5;
  --bg-light: #ffffff;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --transition: all 0.2s ease;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-gray);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

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

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Mobile container padding */
@media (max-width: 768px) {
  .container,
  .container-narrow {
    padding: 0 var(--space-lg);
  }
}

/* Header */
.site-header {
  background: var(--bg-light);
  border-bottom: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

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

.site-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.site-nav a {
  font-weight: 500;
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.site-nav a:hover {
  background: var(--bg-gray);
  text-decoration: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--space-2xl) 0;
  text-align: center;
}

.hero h1 {
  color: white;
  font-size: 2.75rem;
  margin-bottom: var(--space-md);
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto var(--space-lg);
}

.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--success);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

/* Calculator Card */
.calculator-card {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
  margin: calc(var(--space-2xl) * -1) auto var(--space-2xl);
  position: relative;
  max-width: 900px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-xl);
  background: transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tab-button {
  flex: 1;
  padding: 1rem 1.5rem;
  background: #f5f7f9;
  border: 1px solid #e0e4e8;
  border-right: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #4c6272;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tab-button:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.tab-button:last-child {
  border-right: 1px solid #e0e4e8;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.tab-button:hover {
  background: #e8ecf0;
  color: var(--primary);
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form Elements */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

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

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: var(--transition);
  background: var(--bg-light);
}

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

.form-input::placeholder {
  color: var(--text-muted);
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.checkbox-label:hover,
.radio-label:hover {
  background: var(--bg-gray);
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

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

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

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

.btn-large {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
  width: 100%;
  margin-top: var(--space-xl);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Results Display */
.results-card {
  background: linear-gradient(135deg, var(--success) 0%, #008a32 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  display: none;
}

.results-card.visible {
  display: block;
  animation: slideIn 0.3s ease;
}

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

.results-main {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.results-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: var(--space-sm);
}

.results-amount {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
}

.results-period {
  font-size: 1.25rem;
  opacity: 0.8;
  margin-top: var(--space-sm);
}

/* Breakdown Table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
}

.breakdown-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.breakdown-table tr:last-child {
  border-bottom: none;
}

.breakdown-table td {
  padding: var(--space-md) 0;
}

.breakdown-label {
  font-weight: 500;
}

.breakdown-value {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.breakdown-total {
  font-size: 1.125rem;
  font-weight: 700;
  padding-top: var(--space-lg) !important;
  border-top: 2px solid rgba(255, 255, 255, 0.3) !important;
}

/* Warning/Info Boxes */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  border-left: 4px solid;
}

.alert-warning {
  background: #fff3cd;
  border-color: var(--warning);
  color: #856404;
}

.alert-info {
  background: #d1ecf1;
  border-color: #0c5460;
  color: #0c5460;
}

/* Content Section */
.content-section {
  background: var(--bg-light);
  padding: var(--space-2xl) 0;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.content-section h2 {
  margin-top: var(--space-2xl);
}

.content-section h3 {
  margin-top: var(--space-xl);
  color: var(--primary);
}

/* Reference Table */
.reference-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.reference-table thead {
  background: var(--primary);
  color: white;
}

.reference-table th,
.reference-table td {
  padding: var(--space-md);
  text-align: left;
}

.reference-table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

.reference-table tbody tr:hover {
  background: var(--bg-gray);
}

.reference-table tbody tr:last-child {
  border-bottom: none;
}

/* FAQ Section */
.faq-section {
  margin-top: var(--space-2xl);
}

.faq-item {
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.faq-question {
  font-weight: 600;
  padding: var(--space-lg);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  background: var(--bg-gray);
}

.faq-answer {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--text-secondary);
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Footer */
.site-footer {
  background: var(--text-primary);
  color: white;
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-section h4 {
  color: white;
  margin-bottom: var(--space-md);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .calculator-card {
    padding: var(--space-xl);
    margin: calc(var(--space-lg) * -1) var(--space-md) 0 var(--space-md);
    border-radius: var(--radius-lg);
  }
  
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab-button {
    white-space: nowrap;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .results-amount {
    font-size: 2.5rem;
  }
  
  .site-nav {
    display: none;
  }
  
  .reference-table {
    font-size: 0.875rem;
  }
  
  .reference-table th,
  .reference-table td {
    padding: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .results-amount {
    font-size: 2rem;
  }
  
  .breakdown-table {
    font-size: 0.875rem;
  }
}

/* Form Sections (Collapsible) */
.form-section {
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.form-section-header {
  background: var(--nhs-light-grey);
  padding: var(--space-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--nhs-dark-blue);
  transition: background 0.2s ease;
  user-select: none;
}

.form-section-header:hover {
  background: #e8edf0;
}

.form-section-header .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.form-section-header.active .toggle-icon {
  transform: rotate(180deg);
}

.form-section-content {
  padding: var(--space-lg);
  border-top: 1px solid #e0e0e0;
}

/* Range Slider */
.form-slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, #e0e0e0 0%, var(--nhs-blue) 0%);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--nhs-blue);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--nhs-blue);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: none;
}

.form-slider::-webkit-slider-thumb:hover {
  background: var(--nhs-dark-blue);
  transform: scale(1.1);
}

.form-slider::-moz-range-thumb:hover {
  background: var(--nhs-dark-blue);
  transform: scale(1.1);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-lg); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-lg); }
.hidden { display: none; }
.visible { display: block; }
