/* Grundlæggende layout og farver */
body {
  margin: 0;
  background-color: #0d0d0d;
  font-family: Arial, sans-serif;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* CENTER HELPER - Bruges til at centrere login-boksen præcis som på index.html */
.login-wrapper {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* LOGIN KONFIGURATION - Kopieret fra mainStyles.css for ensartet udseende */
.login-container {
  background-color: #1a1a1a;
  padding: 2.5em;
  border-radius: 15px;
  border: 1px solid #333;
  text-align: center;
  width: 100%;
  max-width: 350px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.login-container h2 {
  color: #ffd166;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-container h6 {
  margin-top: 0;
  color: #888;
  margin-bottom: 25px;
}

.login-container label {
  display: block;
  text-align: left;
  font-size: 0.8rem;
  margin-bottom: 5px;
  color: #ffd166;
}

.login-container input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  box-sizing: border-box;
}

/* Knap-styling der matcher resten af sitet */
.login-container button {
  width: 100%;
  background: transparent;
  color: #ffd166;
  border: 2px solid #ffd166;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}

.login-container button:hover {
  background: #ffd166;
  color: #000;
  box-shadow: 0 0 15px rgba(255, 209, 102, 0.4);
}

/* --- GALLERI SPECIFIK CSS (Søgning, Grid og Modal) --- */

/* Header / Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}

.topbar h1 {
  font-size: 1.2rem;
  margin: 0;
  color: #ffd166;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffd166 !important;
  text-decoration: none;
  font-weight: bold;
  border: 2px solid #ffd166;
  padding: 6px 16px;
  border-radius: 6px;
  background: transparent;
  transition: all 0.2s ease-in-out;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Søgefelt og Login-knap wrapper */
.search-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.search-container {
    flex-grow: 1;
    max-width: 500px; /* Begrænser søgefeltets bredde så det ikke fylder alt */
}

#gallery-search {
    width: 100%;
    padding: 12px 20px;
    background: #1a1a1a;
    border: 1px solid #ffd166;
    border-radius: 25px;
    color: white;
    outline: none;
    box-sizing: border-box;
}

.login-header-btn {
    background-color: #ffd166;
    color: #000 !important;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    white-space: nowrap;
    display: inline-block;
}

/* Galleri Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.gallery-item {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    transition: 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    border-color: #ffd166;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.gallery-info {
    padding: 15px;
}

/* Modal / Popup Styling */
#image-modal {
  display: none; /* Skjult som standard */
  position: fixed; 
  z-index: 2000; 
  left: 0; 
  top: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.95); 
  flex-direction: column;
  justify-content: center; 
  align-items: center; 
  pointer-events: auto; /* Tillader klik når den ER vist */
}

/* VIGTIGT: Sørg for at modal kun fanger klik når den har display: flex */
#image-modal[style*="display: flex"] {
    display: flex !important;
}

/* Opdateret Modal-billed styling */
#image-modal img {
  max-width: 90%; 
  max-height: 70vh; 
  border: 2px solid #ffd166; 
  border-radius: 12px; /* Runde hjørner på hele billedet */
  display: block;
  object-fit: contain;
  background-color: #000;
  margin-bottom: 15px; /* Skaber luft mellem billede og tekstfelt */
}

/* Opdateret tekstfelt med alle hjørner rundede */
#modal-caption {
  width: 90%;
  max-width: fit-content;
  background: #fff; 
  color: #000; 
  padding: 15px 25px;
  text-align: center;
  box-sizing: border-box;
  
  /* Her rundes alle fire hjørner */
  border-radius: 12px; 
  
  font-size: 1.1rem;
  line-height: 1.4;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5); /* Giver boksen lidt dybde */
}

/* Navigationsknapper */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 20px 15px;
    cursor: pointer;
    font-size: 2rem;
    z-index: 2100;
}

.prev-btn { left: 10px; }
.next-btn { right: 10px; }

.modal-close {
  position: absolute; 
  top: 20px; 
  right: 25px; 
  color: #fff; 
  font-size: 40px; 
  font-weight: bold;
  cursor: pointer;
  z-index: 2200;
}