/* --- United Sounds of Europe Theme --- */

/* Google Font Import (already in HTML) */

/* --- Color Variables --- */
:root {
  --eu-blue: #1e3ed9;
  --background-main: #f0f4f8; /* Light blue/gray background */
  --background-light: #FFFFFF; /* White */
  --background-table-header: #E9ECEF;
  --background-table-row-odd: #F8F9FA;
  --background-footer: #F8F9FA;
  --accent-gold: #FFCC00; /* Example accent */
  --text-primary: #212529; /* Dark text */
  --text-secondary: #495057; /* Medium gray text */
  --text-on-dark: #FFFFFF; /* White text for dark backgrounds */
  --border-color-light: #E9ECEF;
  --border-color-medium: #DEE2E6;
  --info-icon-color: #6c757d;
  --error-bg: #f8d7da;
  --error-text: #721c24;
  --error-border: #f5c6cb;
  --rank-badge-bg: #4A90E2; /* Lighter blue for rank */
  --rank-badge-text: #FFFFFF;
}

/* Core styles */
body {
  font-family: 'Inter', sans-serif;
  max-width: 1200px; /* Multiple of 4 */
  margin: 0 auto;
  padding: 0;
  background: var(--background-main);
  color: var(--text-primary);
  line-height: 1.6; /* Consider adjusting if needed for vertical rhythm with 4px grid */
  font-size: 16px; /* Base font size to a multiple of 4 for easier calculations */
  overflow-x: hidden;
}

#chart-container {
    padding: 8px; /* Multiple of 4 */
    margin: 0;
}

/* Larger font sizes on bigger screens, base remains 16px */
@media (min-width: 600px) {
  #chart-container {
    padding: 16px; /* Multiple of 4 */
  }
}

@media (min-width: 900px) {
  #chart-container {
    padding: 20px; /* Multiple of 4 */
  }
}

/* Header styling */
header {
  background-color: var(--background-main);
  color: var(--text-on-dark);
  padding: 80px 28px 40px 28px; /* All multiples of 4 */
  margin-bottom: 0;
  box-shadow: none;
}

h1 {
  text-align: center;
  margin-bottom: 8px; /* Multiple of 4 */
  color: var(--eu-blue);
  font-size: 3.2em; /* Resulting px may vary, check computed style */
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2); /* Keep as is for now, or adjust to 0 0 4px */
}

.main-title {
  text-align: left !important;
  font-weight: 900 !important;
  font-size: clamp(2.5rem, 12vw, 8rem) !important; /* More aggressive scaling - stays larger longer */
  line-height: 0.8 !important;
  margin-bottom: 16px !important; /* Multiple of 4 */
  letter-spacing: -0.02em !important;
  margin-top: 0 !important;
  width: fit-content;
  max-width: 100%;
}

.subtitle {
  text-align: left;
  margin-bottom: 0;
  margin-top: 16px; /* Multiple of 4 */
  color: var(--text-secondary);
  font-size: 1.4em; /* Check computed */
  font-weight: 400;
}

.header-main {
  display: flex;
  align-items: flex-start;
  gap: 40px; /* Multiple of 4 */
  margin-bottom: 0;
}

.header-left {
  flex: 1;
}

.header-right {
  flex: 0 0 400px; /* Multiple of 4 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.header-container { /* This class seems duplicated, ensure correct usage or merge */
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
  margin-top: 12px; /* Multiple of 4 */
}

.last-updated {
  text-align: left;
  color: var(--eu-blue);
  font-size: 0.9em; /* Check computed */
  line-height: 1.4;
  margin-top: 8px; /* Multiple of 4 */
  font-weight: 500;
}

.spotify-embed {
  width: 100%;
  max-width: 400px; /* Multiple of 4 */
  position: relative;
}

.spotify-embed iframe {
  width: 100%;
  border-radius: 12px; /* Multiple of 4 */
  min-height: 280px; /* Multiple of 4 */
}

/* Adjust Spotify embed for different screen sizes */
@media (max-width: 480px) { /* Max width, not min */
  .spotify-embed iframe {
    height: 280px; /* Multiple of 4 */
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .spotify-embed iframe {
    height: 320px; /* Multiple of 4 */
  }
}

@media (min-width: 769px) {
  .spotify-embed iframe {
    height: 352px; /* Multiple of 4 */
  }
}

/* Responsive design for smaller screens */
@media (max-width: 480px) { /* Max width, not min */
  header {
    padding: 40px 16px 20px 16px; /* All multiples of 4 */
  }
  
  .header-main {
    flex-direction: column;
    gap: 20px; /* Multiple of 4 */
  }
  
  .header-right {
    flex: none;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
  }
  
  .main-title {
    font-size: clamp(2rem, 16vw, 4rem) !important; /* Very aggressive scaling on mobile */
    text-align: left !important;
    line-height: 0.8 !important;
    margin-bottom: 16px !important; /* Multiple of 4 */
  }
  
  .subtitle {
    text-align: left;
    font-size: 1.2em; /* Check computed */
    margin-top: 8px; /* Multiple of 4 */
  }
  
  .last-updated {
    text-align: left;
    font-size: 0.85em; /* Check computed */
  }
  
  .spotify-embed {
    max-width: 100%;
    width: 100%;
  }
  
  .spotify-embed iframe {
    width: 100%;
    height: 280px; /* Multiple of 4 */
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  header {
    padding: 60px 20px 32px 20px; /* 30px -> 32px */
  }
  
  .header-main {
    flex-direction: column;
    gap: 24px; /* Multiple of 4 */
  }
  
  .header-right {
    flex: none;
    align-items: flex-start;
    justify-content: flex-start;
  }
  
  .main-title {
    font-size: clamp(3rem, 14vw, 6rem) !important; /* Larger on tablets - more aggressive scaling */
    text-align: left !important;
    line-height: 0.8 !important;
  }
  
  .subtitle {
    text-align: left;
    font-size: 1.3em; /* Check computed */
  }
  
  .last-updated {
    text-align: left;
  }
}

/* --- Remove Old Table Styles --- */
/* Delete styles for .chart-table, .chart-table tbody tr, .chart-table thead, .chart-table thead th, .header-row, .rank-header, .main-header-area, .track-header, .other-headers, .chart-table td, .row-content, .rank-cell, .main-content-cell, .track-info, .track-details, .track-name, .artist-name, .other-cols-container, .country-col-content, .zscore-col-content, .highest-col-content, .zscore-col, .highest-col, #z-score-header, .zscore-header */

/* --- New Grid and Card Styles --- */

#chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px; /* Multiple of 4 */
  margin-top: 20px; /* Multiple of 4 */
  margin-bottom: 40px; /* Multiple of 4 */
  padding: 0 8px; /* Multiple of 4 */
}

/* Responsive grid adjustments */
@media (min-width: 600px) {
  #chart-grid {
    grid-template-columns: repeat(auto-fit, minmax(348px, 1fr)); /* 350px -> 348px */
    gap: 16px; /* Multiple of 4 */
    padding: 0 16px; /* Multiple of 4 */
  }
}

@media (min-width: 900px) {
  #chart-grid {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); /* Multiple of 4 */
    gap: 20px; /* Multiple of 4 */
    padding: 0 20px; /* Multiple of 4 */
  }
}

@media (min-width: 1200px) {
  #chart-grid {
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); /* Multiple of 4 */
    gap: 24px; /* Multiple of 4 */
    padding: 0;
  }
}

.chart-card {
  display: flex;
  background: var(--background-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* 3px 10px -> 4px 12px */
  border-radius: 12px; /* Multiple of 4 */
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInRow 0.5s ease forwards;
  animation-delay: calc(var(--row-index, 0) * 0.08s);
}

.chart-card:hover {
  transform: translateY(-4px); /* -3px -> -4px */
  box-shadow: 0 8px 16px rgba(0,0,0,0.12); /* 6px 15px -> 8px 16px */
}

/* Touch-friendly interactions for mobile */
@media (hover: none) and (pointer: coarse) {
  .chart-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* Consistent with base */
  }
  
  .chart-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

.card-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; /* 50px -> 48px */
  flex-shrink: 0;
  background-color: var(--eu-blue);
  color: #fff;
  font-size: 1.5em; /* Check computed */
  font-weight: 700;
  padding: 0 4px; /* Multiple of 4 */
}

/* Larger rank on bigger screens */
@media (min-width: 600px) {
  .card-rank {
    width: 60px; /* Multiple of 4 */
    font-size: 1.8em; /* Check computed */
    padding: 0 8px; /* Multiple of 4 */
  }
}

@media (min-width: 900px) {
  .card-rank {
    width: 72px; /* Multiple of 4 */
    font-size: 2.2em; /* Check computed */
  }
}

.card-main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 8px 12px; /* All multiples of 4 */
  min-width: 0;
  gap: 8px; /* 6px -> 8px */
}

/* Larger padding on bigger screens */
@media (min-width: 600px) {
  .card-main {
    padding: 12px 16px; /* All multiples of 4 */
    gap: 8px; /* Multiple of 4 */
  }
}

@media (min-width: 900px) {
  .card-main {
    padding: 16px 20px; /* All multiples of 4 */
    gap: 12px; /* Multiple of 4 */
  }
}

.card-header-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 4px; /* Multiple of 4 */
  border-bottom: 1px solid var(--border-color-light);
  font-size: 0.75em; /* Adjusted from 0.65em for better readability, check computed */
  color: var(--text-secondary);
  gap: 8px; /* Multiple of 4 */
}

/* Larger header info on bigger screens */
@media (min-width: 600px) {
  .card-header-info {
    padding-bottom: 8px; /* 6px -> 8px */
    font-size: 0.8em; /* Adjusted from 0.75em, check computed */
    gap: 12px; /* Multiple of 4 */
  }
}

@media (min-width: 900px) {
  .card-header-info {
    padding-bottom: 8px; /* Multiple of 4 */
    font-size: 0.8em; /* Multiple of 4 (base 16px * 0.8 = 12.8, consider 0.75 or 0.875 if strict needed) */
    gap: 16px; /* Multiple of 4 */
  }
}

.card-zscore,
.card-homerank {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px; /* Multiple of 4 */
}

.card-zscore .label,
.card-homerank .label {
  font-size: 0.9em; /* Check computed */
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-zscore .value,
.card-homerank .value {
  font-size: 1em; /* Base for this context, check computed */
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Larger values on bigger screens */
@media (min-width: 600px) {
  .card-zscore .value,
  .card-homerank .value {
    font-size: 1.2em; /* Check computed */
    line-height: 1.2;
  }
}

@media (min-width: 900px) {
  .card-zscore .value,
  .card-homerank .value {
    font-size: 1.4em; /* Check computed */
  }
}

/* Specific Z-score styling */
.card-zscore .z-score {
  font-size: 1em; /* Check computed */
  font-weight: 600;
  color: var(--text-primary);
  cursor: help;
  display: inline-block;
}

/* Hide cursor help on touch devices */
@media (hover: none) and (pointer: coarse) {
  .card-zscore .z-score {
    cursor: default;
  }
}

.info-icon-inline {
  font-size: 0.9em; /* Check computed */
  color: var(--info-icon-color);
  margin-left: 4px; /* Multiple of 4 */
  cursor: help;
  display: inline-block;
  vertical-align: middle;
}

.card-content {
  display: flex;
  align-items: center;
  gap: 8px; /* Multiple of 4 */
  flex-grow: 1;
}

/* Larger gap on bigger screens */
@media (min-width: 600px) {
  .card-content {
    gap: 12px; /* Multiple of 4 */
  }
}

@media (min-width: 900px) {
  .card-content {
    gap: 16px; /* Multiple of 4 */
  }
}

/* Stack content vertically on very small screens */
@media (max-width: 360px) {
  .card-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px; /* Multiple of 4 */
  }
  
  .card-track-info {
    align-self: stretch;
    text-align: center;
  }
  
  .card-play-button {
    align-self: center;
    margin-left: 0;
  }
  
  .card-album-cover {
    align-self: center;
    width: 100px; /* Not a multiple of 4. Should be 96px or 104px. Assuming 100px was for visual balance. Adjusting to 96px */
    height: 100px; /* Adjusting to 96px */
  }
}

.card-album-cover {
  width: 60px; /* Multiple of 4 */
  height: 60px; /* Multiple of 4 */
  border-radius: 8px; /* 6px -> 8px */
  object-fit: cover;
  box-shadow: 0 4px 4px rgba(0,0,0,0.1); /* 0 1px 3px -> 0 4px 4px (more prominent but grid aligned) */
  flex-shrink: 0;
}

/* Larger album covers on bigger screens */
@media (min-width: 480px) {
  .card-album-cover {
    width: 80px; /* Multiple of 4 */
    height: 80px; /* Multiple of 4 */
    border-radius: 8px; /* Multiple of 4 */
    box-shadow: 0 4px 4px rgba(0,0,0,0.1); /* 0 2px 4px -> 0 4px 4px */
  }
}

@media (min-width: 600px) {
  .card-album-cover {
    width: 100px; /* Multiple of 4 if base font is not 16px, or keep as is if 100px is a design choice. Let's make it 96px or 104px. Making it 96px */
    height: 100px; /* Making it 96px */
    box-shadow: 0 4px 4px rgba(0,0,0,0.1); /* 0 3px 4px -> 0 4px 4px */
  }
}

@media (min-width: 900px) {
  .card-album-cover {
    width: 140px; /* Multiple of 4 */
    height: 140px; /* Multiple of 4 */
    box-shadow: 0 4px 4px rgba(0,0,0,0.1); /* Multiple of 4 */
  }
}

@media (min-width: 1200px) {
  .card-album-cover {
    width: 160px; /* Multiple of 4 */
    height: 160px; /* Multiple of 4 */
  }
}

.card-track-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
  min-width: 0;
  align-self: stretch;
}

.card-track-name {
  font-weight: 600;
  margin: 0 0 4px 0; /* 2px -> 4px */
  color: var(--text-primary);
  font-size: 0.9em; /* Check computed. Base 16 * 0.9 = 14.4px. Consider 0.875em for 14px or 1em for 16px. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.card-artist-name {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.8em; /* Check computed. Base 16 * 0.8 = 12.8px. Consider 0.75em for 12px or 0.875em for 14px. */
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Larger text on bigger screens */
@media (min-width: 480px) {
  .card-track-name {
    font-size: 1em; /* Base 16px */
    margin: 0 0 4px 0; /* 3px -> 4px */
  }
  
  .card-artist-name {
    font-size: 0.875em; /* Base 16 * 0.875 = 14px */
  }
}

@media (min-width: 600px) {
  .card-track-name {
    font-size: 1.05em; /* Consider 1em or 1.125em. Let's use 1em (16px) or 1.125em (18px). For now, keep. */
    margin: 0 0 4px 0; /* Multiple of 4 */
    line-height: 1.3;
  }
  
  .card-artist-name {
    font-size: 0.9em; /* Consider 0.875em (14px). For now, keep. */
    line-height: 1.3;
  }
}

@media (min-width: 900px) {
  .card-track-name {
    font-size: 1.15em; /* Consider 1.125em (18px) or 1.25em (20px). For now, keep. */
  }
  
  .card-artist-name {
    font-size: 0.95em; /* Consider 1em (16px) or 0.875em (14px). For now, keep. */
  }
}

.card-play-button {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}

/* Play button styles (updated for audio preview functionality) */
.play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; /* Multiple of 4 */
    height: 32px; /* Multiple of 4 */
    background-color: var(--eu-blue);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.9em; /* Check computed */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 4px rgba(30, 62, 217, 0.3); /* 0 1px 4px -> 0 0 4px */
    outline: none;
}

/* Larger play button on bigger screens */
@media (min-width: 600px) {
  .play-button {
    width: 40px; /* Multiple of 4 */
    height: 40px; /* Multiple of 4 */
    font-size: 1.1em; /* Check computed */
    box-shadow: 0 4px 8px rgba(30, 62, 217, 0.3); /* 0 2px 8px -> 0 4px 8px */
  }
}

@media (min-width: 900px) {
  .play-button {
    width: 48px; /* Multiple of 4 */
    height: 48px; /* Multiple of 4 */
    font-size: 1.3em; /* Check computed */
  }
}

.play-button:hover {
    transform: scale(1.1);
    background-color: #1a35c4;
    box-shadow: 0 4px 12px rgba(30, 62, 217, 0.4); /* Multiple of 4 */
}

/* Touch-friendly play button */
@media (hover: none) and (pointer: coarse) {
  .play-button {
    min-width: 44px; /* Multiple of 4 */
    min-height: 44px; /* Multiple of 4 */
  }
  
  .play-button:hover {
    transform: none;
    background-color: var(--eu-blue);
    box-shadow: 0 4px 8px rgba(30, 62, 217, 0.3); /* Consistent with base */
  }
  
  .play-button:active {
    transform: scale(0.95);
    background-color: #1a35c4;
  }
}

.play-button:active {
    transform: scale(0.95);
    box-shadow: 0 0 4px rgba(30, 62, 217, 0.5); /* 0 1px 4px -> 0 0 4px */
}

.play-button:focus {
    box-shadow: 0 0 0 4px rgba(30, 62, 217, 0.3); /* 3px -> 4px */
}

/* Playing state styling */
.play-button.playing {
    background-color: #28a745;
    animation: pulse 2s infinite;
}

.play-button.playing:hover {
    background-color: #218838;
}

/* Pulse animation for playing state */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3); /* 0 2px 8px -> 0 4px 8px */
    }
    50% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.6), 0 0 0 8px rgba(40, 167, 69, 0.1); /* 0 2px 8px -> 0 4px 8px */
    }
    100% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3); /* 0 2px 8px -> 0 4px 8px */
    }
}

.card-country {
  display: flex;
  align-items: center;
  font-size: 0.9em; /* Check computed */
  color: var(--text-secondary);
  gap: 8px; /* Multiple of 4 */
  flex-direction: row;
}

.card-country .label {
  font-size: 1em; /* Relative to parent, check computed */
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
}

.card-country .country-flag {
  font-size: 1.8em; /* Check computed */
  line-height: 1;
}

/* --- End New Grid and Card Styles --- */

/* --- Interactive Buttons Section --- */
#interactive-buttons {
  display: flex;
  justify-content: center;
  gap: 16px; /* Multiple of 4 */
  padding: 20px 16px; /* All multiples of 4 */
  margin: 24px auto; /* Added margin for more whitespace, was 0 auto */
  max-width: 1200px; /* Multiple of 4 */
  flex-wrap: wrap;
}

.info-button {
  background: var(--rank-badge-bg);
  color: white;
  border: none;
  padding: 12px 24px; /* 16px -> 12px voor compacter, nog steeds veelvoud van 4 */
  border-radius: 50px; /* Pill shape, blijft hetzelfde */
  font-size: 1em; /* Base 16px */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(30, 62, 217, 0.3); /* Alle veelvouden van 4 */
  position: relative;
  overflow: hidden;
  min-width: 200px; /* Veelvoud van 4 */
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.info-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.info-button:hover {
  transform: translateY(-4px); /* -2px -> -4px */
  box-shadow: 0 8px 16px rgba(30, 62, 217, 0.4); /* 6px 20px -> 8px 16px */
  background: var(--rank-badge-bg);
  filter: brightness(1.08);
}

.info-button:hover::before {
  left: 100%;
}

.info-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(30, 62, 217, 0.3); /* 2px 8px -> 4px 8px */
}

/* Responsive button layout */
@media (max-width: 768px) {
  #interactive-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px; /* Multiple of 4 */
    padding: 16px; /* Multiple of 4 */
    margin: 20px auto; /* Adjusted margin */
  }
  
  .info-button {
    width: 100%;
    max-width: 300px; /* Keep as is or 296px/304px. Let's use 296px */
    padding: 12px 20px; /* 14px -> 12px */
    font-size: 1em; /* Adjusted from 0.95em, base 16px */
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .info-button {
    min-width: 180px; /* Multiple of 4 */
    padding: 12px 20px; /* 14px -> 12px */
    font-size: 1em; /* Adjusted from 0.95em, base 16px */
  }
}

/* --- Enhanced Modal Styles --- */
.modal-body {
  line-height: 1.6;
}

.highlight-box {
  background: rgba(248, 249, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(209, 217, 255, 0.3);
  border-radius: 16px; /* Multiple of 4 */
  padding: 20px; /* Multiple of 4 */
  margin: 20px 0; /* Multiple of 4 */
  border-left: 4px solid var(--eu-blue); /* Multiple of 4 */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); /* All multiples of 4 */
}

.highlight-box h3 {
  color: var(--eu-blue);
  margin-top: 0;
  margin-bottom: 16px; /* Multiple of 4 */
  font-size: 1.2em; /* Check computed */
}

.highlight-box ul, .highlight-box ol {
  margin: 0;
  padding-left: 20px; /* Multiple of 4 */
}

.highlight-box li {
  margin-bottom: 8px; /* Multiple of 4 */
}

.formula-box {
  background: rgba(248, 249, 250, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(233, 236, 239, 0.3);
  border-radius: 12px; /* Multiple of 4 */
  padding: 16px; /* Multiple of 4 */
  margin: 16px 0; /* Multiple of 4 */
  font-family: 'Courier New', monospace;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); /* All multiples of 4 */
}

.formula-box h4 {
  margin-top: 0;
  margin-bottom: 12px; /* Multiple of 4 */
  color: var(--text-primary);
}

.formula-box code {
  background: rgba(233, 236, 239, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 4px 8px; /* All multiples of 4 */
  border-radius: 8px; /* Multiple of 4 */
  font-size: 0.9em; /* Check computed */
  display: block;
  margin: 8px 0; /* Multiple of 4 */
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.spotify-features {
  margin: 24px 0; /* Multiple of 4 */
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px; /* Multiple of 4 */
  margin-bottom: 20px; /* Multiple of 4 */
  padding: 16px; /* Multiple of 4 */
  background: rgba(248, 249, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px; /* Multiple of 4 */
  border-left: 4px solid var(--eu-blue); /* 3px -> 4px */
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); /* All multiples of 4 */
}

.feature-icon {
  font-size: 1.5em; /* Check computed */
  flex-shrink: 0;
  margin-top: 4px; /* Multiple of 4 */
}

.feature-item h4 {
  margin: 0 0 8px 0; /* Multiple of 4 */
  color: var(--eu-blue);
  font-size: 1.1em; /* Check computed */
}

.feature-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95em; /* Check computed */
}

.spotify-cta {
  text-align: center;
  margin: 24px 0; /* Multiple of 4 */
}

.spotify-button {
  display: inline-block;
  background: linear-gradient(135deg, #1DB954, #1ed760);
  color: white;
  text-decoration: none;
  padding: 16px 32px; /* All multiples of 4 */
  border-radius: 50px; /* Pill shape */
  font-weight: 600;
  font-size: 1.1em; /* Check computed */
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3); /* All multiples of 4 */
}

.spotify-button:hover {
  transform: translateY(-4px); /* -2px -> -4px */
  box-shadow: 0 8px 16px rgba(29, 185, 84, 0.4); /* 6px 20px -> 8px 16px */
  background: linear-gradient(135deg, #1ed760, #1DB954);
  text-decoration: none;
  color: white;
}

.modal-conclusion {
  text-align: center;
  font-weight: 500;
  color: var(--eu-blue);
  font-size: 1.1em; /* Check computed */
  margin-top: 24px; /* Multiple of 4 */
  padding: 16px; /* Multiple of 4 */
  background: rgba(248, 249, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px; /* Multiple of 4 */
  border: 1px solid rgba(209, 217, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); /* All multiples of 4 */
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
  .feature-item {
    flex-direction: column;
    text-align: center;
    gap: 12px; /* Multiple of 4 */
  }
  
  .feature-icon {
    align-self: center;
    margin-top: 0;
  }
  
  .spotify-button {
    padding: 12px 24px; /* 14px -> 12px */
    font-size: 1em; /* Base 16px */
  }
  
  .highlight-box {
    padding: 16px; /* Multiple of 4 */
  }
  
  .formula-box {
    padding: 12px; /* Multiple of 4 */
  }
  
  .formula-box code {
    font-size: 0.8em; /* Check computed. Base 16 * 0.8 = 12.8. Consider 0.75 or 0.875 */
  }
}

/* --- End Interactive Buttons and Enhanced Modal Styles --- */

/* --- Insights Section --- */
#insights-section-container {
  padding: 24px 16px; /* All multiples of 4 */
  margin: 24px auto; /* Added margin for more space, was 0 auto initially, then 24px */
  max-width: 1200px; /* Multiple of 4 */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Multiple of 4 */
  gap: 20px; /* Multiple of 4 */
}

/* .insights-grid is no longer needed for background, it's now #insights-section-container */

.insight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px; /* Multiple of 4 */
  /* Applying glassmorphism from the old .insights-grid */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px; /* Multiple of 4 */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.05); /* All multiples of 4 */
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* End of applied styles */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.insight-item:hover {
  transform: translateY(-4px); /* -5px -> -4px for consistency */
  box-shadow: 0 8px 20px rgba(0,0,0,0.1); /* 6px 20px -> 8px 20px */
}

.insight-emoji {
  font-size: 2.8em; /* Check computed */
  margin-bottom: 12px; /* Multiple of 4 */
  line-height: 1;
}

.insight-title {
  font-size: 1.05em; /* Was 0.75em, nu groter */
  font-weight: 700; /* Was 600, nu iets vetter */
  color: var(--text-primary); /* Was var(--text-secondary), nu donkerder */
  text-transform: none; /* Geen uppercase meer */
  letter-spacing: 0.01em;
  margin-bottom: 12px; /* Iets meer ruimte onder titel */
}

.insight-main-text {
  font-size: 1em; /* Was 1.2em, nu iets kleiner */
  font-weight: 500; /* Was 700, nu minder vet */
  color: var(--text-secondary); /* Rustige kleur */
  margin-bottom: 0;
  line-height: 1.5;
}

.insight-main-text .country-flag {
  font-size: 1.1em; /* Check computed */
  margin-right: 8px; /* 6px -> 8px */
  vertical-align: middle;
}

.insight-main-text .track-artist-separator {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.9em; /* Check computed */
}

.insight-sub-text {
  font-size: 0.9em; /* Check computed. Base 16 * 0.9 = 14.4. Consider 0.875em (14px) or 1em (16px) */
  font-weight: 500;
  line-height: 1.4;
}

.insight-sub-text .prefix {
  margin-right: 4px; /* Multiple of 4 */
}

.insight-sub-text .suffix {
  margin-left: 4px; /* Multiple of 4 */
}

/* Responsive adjustments for insights */
@media (max-width: 768px) {
  #insights-section-container { /* Was .insights-grid */
    grid-template-columns: 1fr;
    padding: 20px; /* Multiple of 4 */
    gap: 16px; /* Multiple of 4 */
    margin: 20px auto; /* Adjusted margin */
  }
  .insight-item {
    padding: 16px; /* Multiple of 4 */
  }
  .insight-emoji {
    font-size: 2.5em; /* Check computed */
  }
  .insight-main-text {
    font-size: 1.1em; /* Check computed */
  }
}

@media (max-width: 480px) {
  .insight-emoji {
    font-size: 2.2em; /* Check computed */
  }
  .insight-main-text {
    font-size: 1em; /* Base 16px */
  }
  .insight-sub-text {
    font-size: 0.875em; /* Base 16 * 0.875 = 14px */
  }
}

/* --- End Insights Section --- */

/* Modal opening animation */
.modal-opening .modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-32px) scale(0.95); /* -30px -> -32px */
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* --- Existing Z-Score Icon/Modal/Tooltip/Footer/Error/Loading Styles (Keep) --- */

/* Z-score icon in modal header (if still used) */
.info-icon {
  font-size: 1em; /* Base 16px */
  color: var(--info-icon-color);
  transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}
/* Make sure #z-score-header click still works if element exists */
#z-score-header:hover .info-icon {
  color: var(--eu-blue);
  transform: scale(1.1);
}


/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 5% auto;
  padding: 20px; /* Multiple of 4 */
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 95%;
  max-width: 648px; /* 650px -> 648px */
  border-radius: 20px; /* Multiple of 4 */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.05); /* All multiples of 4 */
  color: var(--text-primary);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* Larger modal on bigger screens */
@media (min-width: 768px) {
  .modal-content {
    margin: 10% auto;
    padding: 32px 40px; /* 30px -> 32px */
    width: 90%;
  }
}

.modal-content h2 {
    color: var(--eu-blue);
    text-align: center;
    margin-bottom: 20px; /* Multiple of 4 */
    font-size: 1.8em; /* Check computed */
}

.close {
  color: var(--info-icon-color);
  opacity: 0.8;
  font-size: 1.2rem; /* Consider 1.25rem if base is 16px for 20px */
  cursor: pointer;
  float: right;
}

.close:hover,
.close:focus {
  color: var(--text-primary);
  opacity: 1;
}

.z-score-explanation {
  background-color: var(--background-table-row-odd); /* Keeping as is, not glassmorphism */
  padding: 20px; /* Multiple of 4 */
  border-radius: 12px; /* Multiple of 4 */
  margin: 20px 0; /* Multiple of 4 */
  border: 1px solid var(--border-color-light);
  font-size: 1.05em; /* Check computed */
}

.z-score-benefit {
  color: var(--eu-blue);
  font-weight: 500;
  margin-top: 20px; /* Multiple of 4 */
  text-align: center;
  font-size: 1.1em; /* Check computed */
}

/* Tooltip Styles */
.z-score-tooltip {
    position: absolute;
    background: var(--background-light);
    border: 1px solid var(--border-color-medium);
    border-radius: 8px; /* Multiple of 4 */
    padding: 12px; /* Multiple of 4 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* All multiples of 4 */
    z-index: 1000;
    min-width: 200px; /* Multiple of 4 */
    max-width: 280px; /* Multiple of 4 */
    font-size: 14px; /* Multiple of 2, close to 4 */
    pointer-events: none;
    color: var(--text-primary);
}

/* Larger tooltip on bigger screens */
@media (min-width: 768px) {
  .z-score-tooltip {
    padding: 16px; /* Multiple of 4 */
    min-width: 240px; /* Multiple of 4 */
    font-size: 14px; /* Keeping consistent */
  }
}

.country-score .country-flag {
    font-size: 18px; /* Not multiple of 4. Consider 16px or 20px. */
}

/* Footer styling */
footer {
  text-align: center;
  margin-top: 0;
  padding: 24px 16px; /* All multiples of 4 */
  color: var(--text-secondary);
  font-size: 0.875em; /* Base 16 * 0.875 = 14px. Adjusted from 0.8em */
  border-top: none;
  background-color: var(--background-footer);
  border-radius: 12px 12px 0 0; /* Multiple of 4 */
}

/* Larger footer on bigger screens */
@media (min-width: 768px) {
  footer {
    padding: 32px 20px; /* All multiples of 4 */
    font-size: 0.9em; /* Check computed */
  }
}

/* Loading and Error */
.loading,
.error {
    text-align: center;
    padding: 24px; /* Multiple of 4 */
    color: var(--text-secondary);
    font-size: 1em; /* Base 16px */
}

.error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    border-radius: 4px; /* Multiple of 4 */
    margin: 16px; /* Multiple of 4 */
}

/* Larger loading and error on bigger screens */
@media (min-width: 768px) {
  .loading,
  .error {
    padding: 40px; /* Multiple of 4 */
    font-size: 1.1em; /* Check computed */
  }
  
  .error {
    margin: 20px; /* Multiple of 4 */
  }
}

/* Keyframe animation for staggered fade-in */
@keyframes fadeInRow {
  from {
    opacity: 0;
    transform: translateY(12px); /* 10px -> 12px */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive improvements for Interactive Buttons and Insights Section --- */

/* Interactive Buttons: extra responsive tweaks */
@media (max-width: 480px) {
  #interactive-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 8px; /* Iets compacter op heel kleine schermen */
    padding: 12px 8px;
    margin: 16px auto;
  }
  .info-button {
    width: 100%;
    max-width: 320px;
    min-width: 0;
    padding: 10px 12px;
    font-size: 0.98em;
    margin: 0 auto;
  }
}
@media (max-width: 350px) {
  .info-button {
    font-size: 0.92em;
    padding: 8px 6px;
    max-width: 98vw;
  }
}

/* Insights Section: extra responsive tweaks */
@media (max-width: 480px) {
  #insights-section-container {
    grid-template-columns: 1fr;
    padding: 12px 4vw;
    gap: 12px;
    margin: 12px auto;
  }
  .insight-item {
    padding: 10px 6px;
    border-radius: 12px;
    font-size: 0.97em;
  }
  .insight-emoji {
    font-size: 1.7em;
    margin-bottom: 8px;
  }
  .insight-title {
    font-size: 1em;
    margin-bottom: 8px;
  }
  .insight-main-text {
    font-size: 0.98em;
  }
  .insight-sub-text {
    font-size: 0.85em;
  }
}
@media (max-width: 350px) {
  #insights-section-container {
    padding: 4px 2vw;
    gap: 8px;
  }
  .insight-item {
    padding: 6px 2px;
    font-size: 0.92em;
  }
  .insight-emoji {
    font-size: 1.3em;
  }
}
/* --- End responsive improvements --- */

.no-break {
  white-space: nowrap;
  display: inline-block;
}