/* =====================
   CSS VARIABLES
   ===================== */

:root {
  /* Colors */
  --primary-color: #505C38; 
  --secondary-color: #000000;
  --third-color: #FFF6F1;   

  /* Text - colors */
  --primary-text: white;
  --secondary-text: black;

  /* Backgrounds */
  --background: #FFF6F1;
  --background-card: #FFF6F1;

  /* Semantic */
  --warning: #F9DB25;
  --error: #ea4335;

  /* Effects */
  --shadow: 0 4px 6px -1px rgba(255, 0, 0, 0.255);
  --shadow-lg: 0 10px 15px -3px rgb(0, 0, 0);
  --radius: 1rem;
  --transition: 250ms ease;
}

/* =====================
   GLOBAL STYLES
   ===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "luckiest guy";
  font-size: 2rem;
  line-height: 1.6;
  background: var(--third-color);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: 5px;
}

/* =====================
   LAYOUT (main container)
   ===================== */
main {
  max-width: min(1400px, 95vw);
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 8rem) 1rem 2rem;
}

/* =====================
   FILTERBAR (SØG/SORT/FILTER)
   ===================== */
.filterbar {
  background: var(--primary-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid white;
}

/* Filter rækker */
.filter-row-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-row-ranges {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

/* Filter grupper */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-family: "poppins";
  font-size: large;
  font-weight: 100;
  color: var(--primary-text);
  display: block;
  letter-spacing: 5px;
}

/* Range grupper */
.range-group {
  flex: 1;
}

.range-label {
  margin-bottom: 0.5rem;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.range-separator {
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 1.2rem;
}

/* Input felter styling */
#search-input,
#genre-select,
#sort-select,
#rating-from,
#rating-to {
  background: #ffffff;
  color: #492E2E;  
  border: 2px solid white; 
  border-radius: calc(var(--radius) * 0.5);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  width: 100%;
}

#search-input:focus,
#genre-select:focus,
#sort-select:focus,
#rating-from:focus,
#rating-to:focus {
  outline: none;
  border-color: var(--third-color);
  box-shadow: 0 0 0 3px rgba(172, 198, 201, 0.2);
}

#search-input::placeholder,
#rating-from::placeholder,
#rating-to::placeholder {
  color: #492E2E; /* Gør placeholder-teksten mørk og læsbar */
  opacity: 0.7; 
}

#genre-select,
#sort-select {
  cursor: pointer;
}

/* Search group særlig styling */
.search-group {
  grid-column: 1 / 2;
}

/* =====================
   HEADER & FOOTER
   ===================== */
header {
  background: var(--primary-color);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(172, 198, 201, 0.2);
  color: var(--primary-text);
  padding: 1rem 2rem;
  text-align: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition);

   display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif; 
}

/* Logo */
.logo-link {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: block;
}

.logo {
  width: 80px; 
  height: auto;
  display: block;
}

/* Placer Book bord-knappen helt ude til højre */
.book-btn {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--third-color);
  color: #492E2E;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  text-decoration: none;
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif;
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Tydelig fokus når man navigerer med tastatur */
.logo-link:focus-visible {
  outline: 3px solid white;
  outline-offset: 5px;
  border-radius: 5px;
}
header h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: 5px;
}

footer {
  background: var(--primary-color);
  color: var(--primary-text);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 4rem;
}

footer p{
  font-size: small;
}


/* =====================
   MOVIE GRID & CARDS
   ===================== */
#game-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: 2rem 0;
}
@media (min-width: 600px) {
  #game-list {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 992px) {
  #game-list {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (min-width: 1400px) {
  #game-list {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

.game-card {
  background: var(--primary-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.game-card:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.game-poster {
  width: 100%;
  height: 400px;
  object-fit: cover;
  background: white;
  transition: var(--transition);
}

.game-card:hover .game-poster {
  transform: scale(1.05);
}

.game-info {
  padding: 1.5rem;
}

.game-info h3 {
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 600; 
  color: white; 
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}


.game-genre {
  color: white; 
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}



/* =====================
   SPIL DIALOG
   ===================== */
dialog#game-dialog {
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif;
  font-size: medium;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: min(95vw, 1000px);
  max-height: 90vh;
  background: var(--primary-color);
  color: var(--primary-text);
  overflow: hidden;
  position: relative;
  margin: auto;
}

/* Sørg for at alle elementer inden i dialogen arver eller tvinger typografien */
dialog#game-dialog * {
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif;
  letter-spacing: 0.12rem;
}

/* slørret baggrund når man klikker på et kort */
dialog#game-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

/* luk siden knappen */
#close-dialog {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: black;
  color: var(--primary-text);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}

#close-dialog:hover {
  background: var(--error);
  color: white;
  transform: scale(1.1);
}

#dialog-content {
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 2fr;
  gap: 2rem;
  align-items: start;
  overflow-y: auto;
  max-height: 90vh;
}

@media (max-width: 768px) {
  #dialog-content {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
    text-align: center;
  }
}

#dialog-content img.game-poster {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  #dialog-content img.game-poster {
    max-width: 300px;
    margin: 0 auto;
  }
}

.dialog-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#dialog-content h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 1rem 0;
}


#dialog-content p {
  color: var(--primary-text);
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

#dialog-content p strong {
  color: var(--primary-text);
  font-weight: 600;
}

#dialog-content .game-genre {
  color: white;
  font-weight: 500;
  font-size: 1.1rem;
}

#dialog-content .game-rating {
  color: var(--warning);
  font-weight: 600;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  #dialog-content .game-rating {
    justify-content: center;
  }
}

#dialog-content .game-description {
  color: var(--secondary-text); /* Ændret til mørk/sort farve */ 
  font-size: 1.1rem ;
  line-height: 1.7;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--third-color);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary-color);
  font-style: italic; 
}

/* =====================
   CLEAR FILTERS BUTTON
   ===================== */
#clear-filters {
  background: linear-gradient(135deg, var(--error) 0%, #c62828 100%);
  color: white;
  border: none;
  border-radius: calc(var(--radius) * 0.5);
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

#clear-filters:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
}

#clear-filters:active {
  transform: translateY(0);
}

#clear-filters:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.3);
}

.btn-icon {
  font-size: 1.1rem;
}

.btn-text {
  font-size: 0.95rem;
}

.no-results {
  text-align: center;
  color: #492E2E;
  font-size: 1.2rem;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--third-color);
  border-radius: var(--radius);
}

/* =====================
   RESPONSIVE FILTERBAR
   ===================== */
@media (max-width: 900px) {
  .filter-row-main {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-row-ranges {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #clear-filters {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .filterbar {
    padding: 1rem;
  }

  .range-inputs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .range-separator {
    transform: rotate(90deg);
  }

  #clear-filters {
    padding: 1rem;
    width: 100%;
  }
}

/* =====================
   RESPONSIVE & ACCESSIBILITY
   ===================== */
@media (max-width: 480px) {
  #game-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .game-card {
    max-width: 350px;
    margin: 0 auto;
  }
  header h1 {
    font-size: 1.75rem;
  }
}

/* Focus styles for keyboard navigation */
.game-card:focus-visible,
#close-dialog:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 4px;
  border-radius: 4px;
}

/* =====================
   DARK MODE ADJUSTMENTS
   ===================== */
  #close-dialog {
    background: rgba(23, 23, 23, 0.9);
  }
.hero-section {
  padding: 6rem 2rem 2rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.hero-text h2 {
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif;
  font-size: 2.5rem;
  color: #492E2E;
  margin-bottom: 1rem;
  line-height: 1.2;
  letter-spacing: 0.12rem;  
}

.hero-text p {
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif;
  color: #492E2E;
  font-size: 0.95rem;
  line-height: 1.6;
  letter-spacing: -0.1px;
  margin-bottom: 2rem;
  max-width: 450px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.hero-btn {
  background: #505C38; 
  color: #FFF6F6;
  padding: 0.8rem 1.8rem;
  border-radius: 2rem;
  text-decoration: none;
  font-family: "Trebuchet MS", "Arial Unicode MS", sans-serif;
  font-weight: bold;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.hero-btn:hover {
  opacity: 0.9;
}

/* Gør den hvide fokus-firkant synlig på ALLE elementer, når man trykker Tab */
:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Spiloversigt overskrift og undertekst */  
.spil-oversigt-titel {
  font-family: 'Trebuchet MS', 'Arial Unicode MS', sans-serif;
  font-size: 2.5rem;
  color: #492E2E;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.12rem;  
}

.spil-oversigt-tekst {
  font-family: 'Trebuchet MS', 'Arial Unicode MS', sans-serif;
  font-size: 1rem;
  letter-spacing: -0.1px;
  color: #492E2E;
  text-align: center;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
