/* --------------------------------------------------------------
   The QS Salary Index – Global Styles
   -------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* — TYPOGRAPHY — */
h1, h2, h3, h4 {
  color: #111827;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }

p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #4b5563;
}

a {
  color: #1e40af;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

/* — HEADER — */
header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-flex {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  width: 60px !important;
  height: 60px !important;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  object-fit: contain;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.08);
}

.header-text {
  flex: 1;
  min-width: 280px;
}

.header-text p {
  margin: 0.25rem 0;
  font-size: 0.95rem;
  color: #4b5563;
}

.brand-link a {
  color: #1e40af;
  font-weight: 600;
}

nav {
  margin-top: 0.5rem;
}

nav a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 500;
  margin-right: 0.75rem;
}

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

/* — HERO — */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero p {
  max-width: 700px;
  margin: 0.75rem auto;
  font-size: 1.1rem;
}

.btn-primary {
  display: inline-block;
  background: #1e40af;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 1rem;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.2);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #1e3a8a;
  transform: translateY(-1px);
}

/* — FILTERS — */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  transition: border 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* — INSIGHTS CTA — */
.insights-cta {
  text-align: center;
  margin: 1.5rem 0;
}

.btn-insights {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1e40af;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.2);
  transition: all 0.2s ease;
}

.btn-insights:hover {
  background: #1e3a8a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-insights::after {
  content: "→";
  font-weight: bold;
}

/* — TABLE (EXCEL STYLE) — */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table-header h2 {
  font-size: 1.25rem;
  color: #374151;
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.table-container th,
.table-container td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.95rem;
}

.table-container th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

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

.table-container tr:hover {
  background-color: #f3f4f6;
  transition: background 0.15s ease;
}

/* ZEBRA ROWS */
.table-container tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* — NO RESULTS / LOADING — */
.no-results,
.loading {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-style: italic;
}

/* — FOOTER — */
footer {
  margin-top: auto;
  background: #1f2937;
  color: #d1d5db;
  padding: 2rem 0;
  font-size: 0.875rem;
}

footer a {
  color: #93c5fd;
}

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

/* — MOBILE RESPONSIVENESS — */
@media (max-width: 768px) {
  .header-flex {
    flex-direction: column;
    text-align: center;
  }

  .logo {
    width: 50px !important;
    height: 50px !important;
  }

  .filters {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .btn-insights {
    width: 100%;
    justify-content: center;
  }

  /* Mobile table → cards */
  .table-container table,
  .table-container thead,
  .table-container tbody,
  .table-container th,
  .table-container td,
  .table-container tr {
    display: block;
  }

  .table-container thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .table-container tr {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: white;
  }

  .table-container td {
    border: none;
    position: relative;
    padding-left: 50%;
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
  }

  .table-container td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    width: 45%;
    flex-shrink: 0;
  }

  .table-container td:last-child {
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  h1 { font-size: 1.875rem; }
  .hero { padding: 2rem 0 1.5rem; }
}

/* — SCREEN READER ONLY — */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
