/* ===============
    CSS VARIABLES
   =============== */
:root {
  /* Colors */
  --primary: rgb(169, 19, 16);
  --secondary: rgba(202, 71, 69, 0.923);
  --primary-light: #fdfcf7;
  --secondary-light: #3c4043;
  --focus: #ea4335;

  /* Text  */
  --text: #1E1B1B;
  --text-light: #1E1B1B;  /*Bruges ikke*/

  /* Backgrounds */
  --bg: #FAFAFA;
  --bg-card: #f5f4f4;
  --bg-hero: #fbefd9;
  /*#fed1d1*/
  /*#fbefd9*/

  /* Semantic */
  /* Semantic */
  --success: #34a853;
  --warning: #fbc02d;
  --error: #ea4335;

  /* Effects */
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.3);
  --radius: 1rem;
  --transition: transform 0.2s ease;
}


/* ===========
    CSS FONTS
   =========== */

.poppins-medium {
  font-family: "Poppins", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

.poppins-semibold {
  font-family: "Poppins", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
}


.dm-sans-bold {
  font-family: "DM Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}

.dm-sans-medium {
  font-family: "DM Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

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

body {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  overflow-x: hidden; 
  font-family: poppins-medium, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--primary-light);
  
  color: var(--text);
  min-height: 100vh;
  
}

/* Prevent background scroll when modal is open */

main {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 5rem;
   
}

body.modal-open {
  overflow: hidden;
}

span {
    color: var(--text-light);
}

h2 {
  font-family: poppins-bold, sans-serif;
  font-size: 32px;

  color: var(--text);
}

h3 {
  font-family: poppins-semibold, sans-serif;
  font-size: 24px;
  color: var(--text);
  line-height: 1.2;
}

p {
    font-family: DM sans-serif-medium, sans-serif;
    font-size: 16px;
    color: var(--text);
}

ul {
  list-style-type: none;
}

.gem {
  display: none;
}


/* ============================
         HEADER DESIGN 
============================= */

  header {
    display: flex;
    width: 100%;
    height: 5em;
    background: var(--primary);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(172, 198, 201, 0.2);
    color: var(--text);
    
    padding: 1rem 2em;
    justify-content: space-between;
    
    align-items: center;
    position: sticky;
    top: 0;
    
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.logo img {
  width: 5em;
  height: auto;
  aspect-ratio: 2/2;
}


.nav-list {
  display: flex;
  flex-direction: row;
  gap: 4em;
  
}

.nav-list a {
  font-size: 1.2em;
  color: var(--bg);
  text-decoration: none;
  
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2em;
}


.favoritelist-link img {
  width: 1.8em;
  height: 1.8em;
  
} 

.book-bord {
  background-color: var(--bg);
  color: var(--text);
  
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;

  padding: 0.5em 1em;
  border-radius: 100px;

}




.burgermenu {
  display: none; /*gemme den til start*/
  background: none;
  border: none;
  cursor: pointer;
  
}

.burgermenu img {
  width: 3em;
  height: 3em;

}

.nav-list a:hover, 
.favoritelist-link:hover,
.burgermenu:hover {
  color: rgb(218, 217, 214);
}

.book-bord:hover {
  background-color: var(--secondary);
}

/*====Focus-visiable====*/
.logo:focus-visible, .nav-list a:focus-visible, 
.favoritelist-link:focus-visible, .book-bord:focus-visible,
.burgermenu:focus-visible  {
  outline: 3px dashed var(--primary-light);
    outline-offset: 3px;

}




/*======Responsiv header======*/
@media (max-width: 900px) {

  header {
    padding: 0.5em 1em;
    height: 4.5em;

  }

  .main-nav {
    display: none;
    position: fixed;
    top: 4.5em;
    right: 0;
    bottom: 0;
    width: 350px;
    height: 100vh;
    padding: 2rem 1.5rem;
    background-color: var(--primary);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.25);

    transform: translateX(100%); /* Gemmer menuen ude til højre */
    transition: transform 0.3s ease;
  }

  .main-nav.open {
    display: block;
    transform: translateX(0); /*nustiller position så den bliver synlig på skærmen*/
  }

  .main-nav ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2em;
    padding: 0;
    margin: 0;
  }

  .main-nav a {
    display: block;
    padding: 0.75rem 0;
    color: var(--bg);

    font-size: 2em;
  }

  .burgermenu {
    display: block;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  body.menu-open {
    overflow: hidden; /*så man kan ik scrolle når burgermenuen er åben*/
  }
}

@media (max-width: 400px) {

  header {
    padding: 0.5em 1em;


  }

  .header-right {
    gap: 1em;
  }

  .burgermenu {
    display: block;
  }

  .book-bord {
    font-size: 16px;
  }

}




/* ==================================
   HERO SEKTION - spiloversigt
   ================================ */

   #hero-spiloversigt {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--bg-hero);
    background-image: url('../images/baggrund.svg');
    
    background-position: center ;
    padding: 5em 8em;
    
   }

   #hero-spiloversigt h1 {
    font-size: 4em;
   }

   #hero-spiloversigt p {
    font-size: 18px;
    max-width: 600px;
   }



   /*Responsiv hero*/
   @media (max-width: 768px) {
      #hero-spiloversigt {
         margin-bottom: 2rem;
        padding: 3em 4rem;
        margin: auto;

      }

      #hero-spiloversigt h1 {
         font-size: 2em;

      }


   }

   @media (max-width: 500px) {
      #hero-spiloversigt {
        
        padding: 2em 2rem;
        margin: auto;

      }

      #hero-spiloversigt p {
         font-size: 16px;

      }


   }


/* ============================================================
   FILTERBAR (SØG/SORT/FILTER/PLAYTIME//RYD-KNAP)
   ===================== */


#genre-select,
#sort-select {
  background: var(--bg-card);
  color: var(--text-light);
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}


#genre-select:focus,
#sort-select:focus {
  outline: 2px solid var(--secondary);
  border-color: var(--secondary);
}



#genre-select,
#sort-select {
  min-width: 160px;
  cursor: pointer;
}

/* Playtime filter styling */
.playtime-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.playtime-filter label {
  font-size: 0.875rem;
  color: var(--text-light);
  white-space: nowrap;
}

.playtime-filter input {
  width: 80px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.playtime-filter input:focus {
  outline: 2px solid var(--secondary);
  border-color: var(--secondary);
}


/* Ryd-knap styling */

#clear-filters {
  background: var(--bg-card);
  color: var(--text-light);
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 500;
}

#clear-filters:hover {
  background: var(--focus);
  color: white;
  border-color: var(--focus);
  transform: translateY(-2px);
}

#clear-filters:focus {
  outline: 2px solid var(--secondary);
  border-color: var(--secondary);
}

.no-results {
  text-align: center;
  color: var(--text-light);
  font-size: 1.2rem;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
}
/* 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);
  font-weight: bold;
  font-size: 1.2rem;
}




/*======================
      FILTER Sektion
=========================*/
.filter-sektion {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  justify-content:flex-start;
  padding: 1em 8rem;

  align-items: flex-end;

  gap: 1em;

}

/*===============
    Søgefelt
=============*/
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-right: 2rem;
  justify-self: end;
}

.header-search {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
  min-width: 100px;
  max-width: 500px;
}

.header-search input {
  
  padding: 0.75rem 1rem;
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  max-width: 50em;
  height: 3em;
  transition: var(--transition);
}



/*===============
    Filter
=============*/
/* Filtrering-ikon styling */
.filter-icon {
  width: 24px;
  height: 24px;
  transition: var(--transition);
}

/* Filtrering toggle button */
.filter-toggle {
  height: 48px;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}


.filter-toggle:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.filter-toggle.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-toggle:hover .filter-icon {
  filter: brightness(0) invert(1); /* Gør billedet hvidt ved hover */
}

.filter-toggle.active .filter-icon {
  filter: brightness(0) invert(1); /* Gør billedet hvidt når aktiv */
}

/* Filtrering badge (antal aktive filtre) */
.filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--focus);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/*======================
    FILTER PANELET - OPEN
=========================*/
  /* Filter panel dropdown */
  .filter-panel {
    position: absolute;
    top: 10%;
    right: 2rem;
    background: var(--bg);
    border: 1px solid var(--secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    min-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    display: none;
  }

  .filter-panel.open {
    display: block;
    animation: slideDown 0.2s ease;
  }

  .filter-panel-content {
    position: relative;
  }

  .filter-panel-close {
    position: absolute;
    top: 0em;
    right: 0em;
    width: 1em;
    height: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    padding: 0.8em;
    
    border-radius: 100px;
    font-size: 1.5em;
    cursor: pointer;
  }

  .filter-panel-close:hover {
    background-color: var(--focus);
    color: var(--primary-light);
  }



  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }



  .filter-panel h2 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.125rem;
    font-weight: 600;
  }

  .filter-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .filter-row label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
  }

  .filter-row select,
  .filter-row input {
    padding: 0.5rem;
    border: 1px solid var(--secondary);
    border-radius: calc(var(--radius) * 0.5);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
  }

  .filter-row select:focus,
  .filter-row input:focus {
    outline: none;
    border-color: var(--primary);
  }

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

  .range-inputs input {
    flex: 1;
  }

  .range-inputs span {
    color: var(--text-light);
    font-size: 0.9rem;
  }

  .filter-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--secondary);
  }

  .clear-btn,
  .close-btn {
    padding: 0.5rem 1rem;
    border-radius: calc(var(--radius) * 0.5);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid;
  }

  .clear-btn {
    background: transparent;
    color: var(--focus);
    border-color: var(--focus);
    
  }

  .clear-btn:hover {
    background: var(--focus);
    color: white;
  }

  .close-btn {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .close-btn:hover {
    background: transparent;
    color: var(--primary);
  }



  /* RESPONSIV Filter sektion */
/* Table og mindre mobile enheder (Breakpoints) */
@media (max-width: 900px) {

  .header-controls {
    gap: 0.5rem;
    margin-right: 0.5rem;
  }
  .header-search input {
    
    font-size: 0.9rem;
  }

  

  .filter-sektion {
    padding: 1em 2em;
  }

  .filter-panel {
    right: 0.5rem;
    left: 0.5rem;
    min-width: auto;
    max-width: none;
  }
  .filter-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
}


/* =================================
   SPILOVERSIGT overskrift og sortering)
   ================================= */

.games-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
  padding: 1em 8rem;
  margin: auto;
  
}

.sort-controls {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;  
}

.sort-controls label {
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
  
}

#main-sort-select {
  cursor: pointer;
}

.sort-controls select {
  padding: 0.5rem;
  
  color: var(--text);
  font-size: 0.9rem;
  min-width: 150px;
  
  padding: 0.4rem 1rem;
  border: 1px solid var(--secondary);
  border-radius: 10px;
  background: var(--bg);
  
}

.sort-controls select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Responsive breakpoints */
@media (max-width: 900px) {
  .games-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1em 2rem;
    margin: auto;
    
  }
  
  .games-header h2 {
    font-size: 1.25rem;
    margin: 0;
  }
  
  .sort-controls {
    align-self: auto;
    align-items: baseline;
  }
  
  .sort-controls label {
    font-size: 0.8rem;
  }
  
  .sort-controls select {
    font-size: 0.8rem;
    min-width: 120px;
    padding: 0.4rem;
  }
}




/* =======================
   ACTIVE FILTERS DISPLAY
   ======================= */

  .active-filters-section {
    width: 100%;
    padding: 1em 8rem;
    margin-top: -1rem; /* Close spacing to games header */
  }

  .active-filters-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .active-filters-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
  }

  .active-filters-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
  }

  .active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary); /* Rød baggrund */
    color: var(--primary-light);
    padding: 1rem 1.5rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }

  .active-filter-tag:hover {
    background: var(--secondary); /* Mørkere rød ved hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
  }

  .active-filter-tag:active {
    transform: translateY(0);
  }

  .filter-remove-icon {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1;
    margin-left: 0.25rem;
    color: var(--primary-light);
  }

  /* Responsive design for smaller screens */
  @media (max-width: 900px) {
    .active-filters-section {
      padding: 1em 2rem;
    }


    .active-filters-container {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
      

    }
    
    .active-filters-label {
      font-size: 0.8rem;
    }
    
    .active-filter-tag {
      font-size: 0.8rem;
      padding: 0.4rem 0.8rem;
    }
  }



  /* ================================
     GAME GRID og RESPONSIVE LAYOUT 
  ================================*/

  #game-list, .game-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(1, 1fr); /*mobil, 1 kolonne i grided.*/
    gap: 1.5rem;
    
    margin: auto;
    margin-bottom: 2rem;
      padding: 1em 2rem;
  } 

  /* Tablet - op til 2 kolonner */
  @media (min-width: 600px) {
    #game-list, .game-grid {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /*den propper så mange kolonner ind der overhovedet er plads til. Med en min bredde på 250px for hver kolonne*/
      gap: 2rem;
      padding: 2em 8rem;
      
    }
  }


  /* Store skærme - 4 kolonner */
  @media (min-width: 1400px) {
    #game-list, .game-grid {
      padding: 1em 8rem;
    
    }
  }


  /* =====================
           GAME CARDS
   ===================== */
  .game-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    
  
    border: 2px solid rgb(195, 195, 195);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
  }

  .game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
  }

  

  .game-poster {
     width: 100%;
    height: auto; 
    aspect-ratio: 4/4;
    
    max-height: 150em;
    object-fit: contain;
    transition: var(--transition);
  }


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

  
  .game-info {
    
    padding: 1.5rem;
  }

  .game-info h3 {
    color: var(--text);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .game-card-overskrift {
    display: flex;
    flex-direction: row;
    justify-content: space-between;

  }

  .info-liste {
    list-style-type: none;
  }

  .game-genre {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }

  .game-rating {
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .rating-icon {
    width: 1.5em;
    height: 1.5em;
    
  }

  .game-shelf {
  color: var(--text-light); 
  border: 2px solid var(--primary); /* Tykkelse, tekst og farve */
  padding: 5px 30px; /* Afstand mellem tekst og kant */
  display: inline-block; /* Så kanten passer præcist til teksten */
  border-radius: 25px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;
  }

  .game-age, .game-difficulty {
    display: flex;
    justify-content: flex-end;
  }


  /* Icon styling game cards (og detaljeside)*/
  .players-icon,
  .playtime-icon,
  .genre-icon,
  .age-icon, /* Detaljeside alders ikon */
  .difficulty-icon /* Detaljeside sværhedsgrad ikon */
  {
    width: 25px;
    height: 25px;
    margin-right: 10px;
  }

  /* Align game info items with icons */
  .game-players,
  .game-playtime,
  .game-genre {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
  }

  


 /*===================================
          FAVORIT KNAPPER
 ===============================*/ 
    /* Favorite icon positioning */
    .favorite-btn {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 32px;
      height: 32px;

      display: flex;
      justify-content: center;
      align-items: center;

      cursor: pointer;
      background: rgba(255, 255, 255, 0.9);
      border: 1px solid rgba(0, 0, 0, 0.2);
      border-radius: 50%;
      transition: transform 0.2s ease, background 0.2s ease;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

      /* Touch-friendly minimum size */
      min-width: 44px;
      min-height: 44px;
    }

    .favorite-btn:hover {
      transform: scale(1.1);
      background: rgba(255, 255, 255, 1);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    
    /* Active state for mobile touch feedback */
    .favorite-btn:active {
      transform: scale(0.95);
      background: rgba(240, 240, 240, 1);
    }

    .favorite-icon {
      width: 2.5em;
      height: 2.5em;
      
      pointer-events: none;
      
    }

/* =====================
    DIALOG/MODAL GAME
===================== */

   .modal-game-card {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    align-items: top;

   }



  dialog#game-dialog {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0;
    max-width: min(95vw, 1000px);
    max-height: 90vh;
    background: var(--bg-card);
    color: var(--text);
    overflow: hidden;
    position: fixed;
    margin: auto;
    width: min(95vw, 1000px);
  }


  dialog#game-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
  }

  #close-dialog {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-light);
    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(--focus);
    color: white;
    transform: scale(1.1);
  }

  #dialog-content {
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
    overflow-y: auto;
    max-height: 90vh;
    text-align: center;
  }

  .game-poster-container {
    position: relative; /* Positioning context for favorit-ikon */
    display: inline-block;
    margin: 20px auto;
  }

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

  .game-description {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.5;
  }

  .dialog-game-info {
    display: flex;
    flex-direction: column;
    max-width: 30em;
  }


  .dialog-game-info .game-shelf {
  color: var(--text-light); 
  border: 2px solid var(--primary);
  padding: 5px 100px;
  display: inline-block;
  border-radius: 25px;
  margin-bottom: 20px;
  margin-top: 30px;
  
  }

  #dialog-content .game-rules {
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    max-width: 90%;
    margin: 1rem auto;
    text-align: left;
  }

  /* Dialog ikoner i Grid layout */
  #dialog-content .game-icons-grid {
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-rows: auto auto;
    column-gap: 5rem;
    margin: 1rem auto; /* Samme margin som game-rules */
    justify-content: center;  /* centrér hele gridlayoutet */
    justify-items: start; /* men behold venstrejusteret indhold */
    align-items: center;
    margin-bottom: 30px;
  }

  #dialog-content .game-icons-grid p {
    margin-top: 10px;
    display: flex;
    color: var(--text);
  }

  

  /* Styling af hjerte ikon på detaljeside - samme styling som game cards */

  #dialog-content .favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    padding: 6px;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

    /* Touch-friendly minimum size */
    min-width: 44px;
    min-height: 44px;
  }

  .favorite-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }

  /* Active state for mobile touch feedback */
  .favorite-btn:active {
    transform: scale(0.95);
    background: rgba(240, 240, 240, 1);
  }



/* ==========================================
     RESPONSIVT DESIGN FOR DIALOG MODALET  
 ============================================*/


/* Tablet og større mobile enheder (breakpoints) */
@media (max-width: 768px) {
  #dialog-content {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
    text-align: center;
  }
   .game-poster-container {
    margin: 20px auto;
  }
   #dialog-content img.game-poster {
    max-width: 300px;
  }
}

/* Smartphones/iPhone (breakpoints) */
@media (max-width: 480px) {
  dialog#game-dialog {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  margin: 0;
  }
  #dialog-content {
    padding: 1rem;
    overflow-x: hidden;
    word-wrap: break-word;
  }
  .game-poster-container {
    margin: 20px auto;
  }
  #dialog-content img.game-poster {
    max-width: 250px;
    width: 100%;
    height: auto;
  }
  #dialog-content .game-icons-grid {
    column-gap: 2rem;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto auto;
    max-width: 90%; /* Samme bredde som game-rules på mobile også */
  }
  #dialog-content .game-icons-grid p {
    font-size: 0.8rem;
    word-break: break-word;
  }
  #dialog-content h1 {
    font-size: 1.5rem;
    word-wrap: break-word;
  }
  #dialog-content .game-rules {
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    max-width: 90%;
    margin: 1rem auto;
  }
}


/*=========================
       Footer
===========================*/

footer {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  padding: 16px 32px;
  justify-content: space-between;
  align-items: flex-end;


  background-color: var(--primary);
  
}

.logo-footer {
  display: block;
  width: 160px;
  height: 160px;
  flex: 0 0 160px;
}

.logo-footer img {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain; 
}



footer p {
  color: var(--primary-light);
  font-size: 16px;
  word-break: break-all;
}


@media (max-width: 480px) {
  footer {
    padding: 8px;
  }

  .logo-footer {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
  }

  .logo-footer img {
    width: 80px;
    height: 80px;
  }
  
}






/*=========================
       Focus-visiable
===========================*/
.header-search input:focus-visible, .filter-toggle:focus-visible, .filter-panel-close:focus-visible,
#header-sort-select:focus-visible, #header-genre-select:focus-visible, #header-players-from:focus-visible,
#header-playtime-select:focus-visible, #header-difficulty-select:focus-visible, #header-age-from:focus-visible,
#location-select:focus-visible, #header-clear-filters:focus-visible, #filter-close:focus-visible, 
#main-sort-select:focus-visible, .game-card:focus-visible, .favorite-btn:focus-visible, #close-dialog:focus-visible,
.active-filter-tag:focus-visible
{
  outline: 2px dashed var(--focus);
    
}