/* ---------------------------------- */
/* Alap CSS (header, container stb.) */
/* ---------------------------------- */

.container {
  max-width: 1000px;
  margin: 20px auto;
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  overflow: hidden;
}

.container img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ---------------------------------- */
/* Referencia kártyák konténer és kártyák */
/* ---------------------------------- */

.referencia-kartya-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.referencia-kartya {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 15px 20px 40px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
  min-height: 180px;
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: move;
  user-select: none; /* fontos, hogy ne jelölődjön ki fogás közben */
}

.referencia-kartya.dragging {
  opacity: 0.5;
  cursor: grabbing;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transform: scale(1.05);
}


.referencia-kartya:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index: 10;
  position: relative;
}

.referencia-kartya img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.referencia-kartya h2 {
  margin-top: 10px;
  margin-bottom: 10px;
}

.referencia-kartya p {
  white-space: pre-line;
}

.szerkesztes-gomb {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background-color 0.3s ease;
  max-width: 90%;
  box-sizing: border-box;
}

.szerkesztes-gomb:hover {
  background-color: #0056b3;
}

.nincs-referencia {
  text-align: center;
  margin: 40px 0;
  font-style: italic;
  color: #666;
}

.torles-gomb {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background-color 0.3s ease;
}

.torles-gomb:hover {
  background-color: #a71d2a;
}

.nincs-kep {
  width: 100%;
  height: 200px;
  background-color: #f0f0f0;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  border: 1px dashed #ccc;
  margin-bottom: 10px;
}

/* ---------------------------------- */
/* Gombok és linkek */
/* ---------------------------------- */

.btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.9em;
  text-decoration: none;
  border-radius: 12px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: #007bff;
  color: white;
  border: none;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #0056b3;
  color: white;
}

.kartya-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.kartya-link h2,
.kartya-link p {
  color: inherit;
  text-decoration: none;
}

/* ---------------------------------- */
/* Részletes referencia megjelenítő */
/* ---------------------------------- */

.reszletes-container {
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background: white;
  margin-bottom: 100px; /* vagy több, ha a footer magasabb */
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.reszletes-container img.fokep {
  max-width: 100%;
  height: auto;
  margin-bottom: 60px;
  border-radius: 8px;
}

/* ---------------------------------- */
/* Galéria stílus */
/* ---------------------------------- */

.galeria {
  margin-bottom: 80px; /* vagy nagyobb, ha a footer magas */
}

.galeria h3 {
  margin-bottom: 15px;
}

.galeria-kepek {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.galeria-kep {
  flex: 0 1 auto;
  max-width: 250px;
  height: auto;
}

.galeria-kep img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 5px;
  display: block;
}

.galeria-kep img:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 8px 15px rgba(0,0,0,0.3);
}

/* ---------------------------------- */
/* Lightbox */
/* ---------------------------------- */

#lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}

#lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.7);
  transition: transform 0.3s ease;
}

/* ---------------------------------- */
/* Drag & Drop képrendező */
/* ---------------------------------- */

.drag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drag-item {
  width: 150px;        /* fix szélesség */
  height: 150px;       /* fix magasság */
  cursor: grab;
  position: relative;
  box-sizing: border-box;
}

.drag-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* megtartja az arányokat, kitölti a boxot */
  border: 1px solid #ccc;
  border-radius: 5px;
  pointer-events: none; /* hogy ne akadjon meg drag közben */
}

.drag-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}


.delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255,0,0,0.8);
  border: none;
  color: white;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
}

#kepLista {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 600px;
}

#kepLista li {
  padding: 10px;
  margin-bottom: 8px;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  cursor: move;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

#kepLista li.dragElem {
  opacity: 0.5;
}

#kepLista li.over {
  border: 2px dashed #007bff;
  background-color: #e0f0ff;
}

/* ---------------------------------- */
/* Reszponzív stílusok */
/* ---------------------------------- */

@media (max-width: 900px) {
  .referencia-kartya-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .galeria-kepek {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .galeria-kepek {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .referencia-kartya-container {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .drag-item {
    width: 100px;
    height: 100px;
  }
}

/* ---------------------------------- */
/* Kiegészítő képek konténer és képek drag & drop-hoz */
/* ---------------------------------- */

#kepek-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kep {
  width: 150px;
  height: 150px;
  border: 2px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
}

.kep.dragging {
  opacity: 0.5;
}

.kep.over {
  border: 2px dashed #00aaff;
}
