/* 
   UK Salary Calculator - Global Styles 
   Mobile-first, clean, accessible design.
*/

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --background-color: #f8fafc;
  --surface-color: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success-color: #16a34a;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --spacing-unit: 1rem;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

header {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

nav ul li a {
  font-weight: 500;
  color: var(--text-color);
  padding: 0.5rem;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--primary-color);
}

main {
  flex: 1;
}

footer {
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Typography */
h1 {
  font-size: 1.875rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  text-align: center;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* Calculator Card */
.calculator-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

input[type="number"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  background-color: var(--surface-color);
  transition: border-color 0.2s;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-text {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Results Section */
.results {
  background-color: #eff6ff;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid #dbeafe;
}

/* Tax Summary Section */
.tax-summary {
  background-color: #f0fdf4;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid #bbf7d0;
}

.tax-summary .result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #bbf7d0;
}

.tax-summary .result-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Tax Breakdown Table */
.table-container {
  overflow-x: auto;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.tax-breakdown {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tax-breakdown thead {
  background-color: #f1f5f9;
}

.tax-breakdown th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--border-color);
}

.tax-breakdown td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.tax-breakdown tbody tr:last-child td {
  border-bottom: none;
}

.tax-breakdown tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.tax-breakdown th:nth-child(2),
.tax-breakdown td:nth-child(2),
.tax-breakdown th:nth-child(3),
.tax-breakdown td:nth-child(3),
.tax-breakdown th:nth-child(4),
.tax-breakdown td:nth-child(4) {
  text-align: right;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dbeafe;
}

.result-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.result-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.result-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
}

.result-value.large {
  font-size: 1.5rem;
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
}

.btn-secondary {
  background-color: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  margin-top: 1rem;
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Ad Placeholders */
.ad-placeholder {
  background-color: #f1f5f9;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin: 2rem 0;
  font-size: 0.875rem;
  text-align: center;
  border-radius: var(--border-radius);
}

.ad-top {
  min-height: 90px;
}

.ad-inline {
  min-height: 250px;
}

.ad-bottom {
  min-height: 250px;
}

/* Disclaimer */
.disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 1rem;
}

/* FAQ Styles */
.faq-section {
  margin-top: 3rem;
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  .calculator-card {
    padding: 1.5rem;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-value {
    margin-top: 0.25rem;
  }
}