:root {
    --color-background: #111116; 
    --color-surface-1: #1A1A22;
    --color-surface-2: #21212B; 
    --color-primary: #5A8DEE;   /* A softer, "slate blue" accent */
    --color-text-primary: #EAEAEA;
    --color-text-secondary: #9292A5;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--color-background);
  color: var(--color-text-primary);
  margin: 0;
}

h1, h2, h3, label {
	font-family: 'Poppins', sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Sticky Filter Header --- */
.filter-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-surface-1);
    padding: 20px;
    border-bottom: 2px solid #333;
}

.filter-control > label {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 8px; 
    display: block;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    margin-bottom: 4px;
}

.end-label {
    font-size: 0.75em;
    color: var(--color-text-secondary);
}

.slider-value {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-weight: bold;
    color: var(--color-text-secondary);
    font-size: 0.9em;
}

/* --- Mood Tag Filters --- */
.tag-filters {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  padding-top: 15px;
  border-top: 1px solid #333;
  margin-top: 15px;
}

.tag-filters label {
  cursor: pointer;
}

.tag-filters input[type="checkbox"] {
    display: none;
}

.tag-filters span {
    display: inline-block;
    background-color: var(--color-surface-2);
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    transition: all 0.2s ease-in-out;
    border: 1px solid #333;
}

.tag-filters span:hover {
    border-color: var(--color-primary);
    background-color: var(--color-surface-1);
}

.tag-filters input[type="checkbox"]:checked + span {
    background-color: var(--color-primary);
    color: #fff;
    font-weight: bold;
    border-color: var(--color-primary);
}

/* --- Song List & Cards --- */
main {
    padding: 20px 0;
}

.song-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.song-card {
  background-color: var(--color-surface-2);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #333;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.song-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.card-header h3 {
  margin: 0 0 5px 0;
  font-size: 1.25em;
  font-weight: 700;
}

.card-header p {
  margin: 0 0 15px 0;
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 0.9em;
}

/* --- Slider Styles --- */
.noUi-target {
    margin: 0 8px;
    width: auto;
    border: none;
    background: #444;
    box-shadow: none;
}

.noUi-connect {
    background: var(--color-primary);
}

.noUi-handle {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    top: -5px;
    right: -7px;
    border: 2px solid #fff;
    background: var(--color-background);
    box-shadow: none;
    cursor: pointer;
}

.noUi-handle::before,
.noUi-handle::after {
    display: none;
}

/* --- Modal Styles --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); z-index: 1001; background: var(--color-surface-1); border-radius: 12px; padding: 30px; width: 90%; max-width: 600px; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.active, .modal.active { opacity: 1; visibility: visible; }
.modal.active { transform: translate(-50%, -50%) scale(1); }
.modal-close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; color: var(--color-text-secondary); font-size: 2.5em; line-height: 1; cursor: pointer; }
.modal-content { max-height: 65vh; overflow-y: auto; padding-right: 15px; }
.modal-content h2 { margin-top: 0; }
.modal-content p { font-style: italic; color: var(--color-text-secondary); }
.modal-youtube-btn { display: inline-block; background-color: var(--color-primary); color: #fff; padding: 10px 15px; border-radius: 5px; text-decoration: none; margin-bottom: 15px; }
.card-tags { display: flex; gap: 5px; margin-top: auto; padding-top: 10px; }
.card-tags span { font-size: 0.7em; background: #333; padding: 3px 8px; border-radius: 10px; color: var(--color-text-secondary); }
.section-details { border-top: 1px solid #444; padding-top: 15px; margin-top: 15px; }
.modal-content hr + .section-details { border-top: none; }
.stats-list { list-style: none; padding: 0; margin: 10px 0 0 0; }
.stat-container { margin-bottom: 12px; }
.stat-label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9em; color: var(--color-text-secondary); }
.stat-bar-wrapper { display: flex; align-items: center; gap: 10px; }
.stat-bar { flex-grow: 1; height: 8px; background-color: var(--color-surface-2); border-radius: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; background-color: var(--color-primary); border-radius: 4px; transition: width 0.5s ease-out; }
/* --- Suggestion Mode Styles --- */
.suggestion-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    font-size: 1.5em;
    border: none;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.2s ease;
}
.suggestion-toggle-btn:hover {
    transform: scale(1.1);
}

.suggest-icon {
    display: none; /* Hidden by default */
    cursor: pointer;
    margin-left: 8px;
    font-size: 0.8em;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}
.suggest-icon:hover {
    opacity: 1;
}

/* Show icons only when suggestion mode is active */
.suggestion-mode-active .suggest-icon {
    display: inline-block;
}

/* Suggestion Modal Form Styling */
#suggestion-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#suggestion-form textarea {
    width: 95%;
    padding: 10px;
    background-color: var(--color-background);
    border: 1px solid #444;
    color: var(--color-text-primary);
    border-radius: 4px;
    min-height: 80px;
    font-family: 'Roboto', sans-serif;
}
#suggestion-form button {
    padding: 10px 15px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

/* This new rule ensures icons inside the modal also appear */
.suggestion-mode-active .modal .suggest-icon {
    display: inline-block;
}