/* =========================================================
   FOTKY VOZU – KARTY A SEKCE
========================================================= */
.fotky-vozu-section {
  background-color: #3a3a47;
  border: 1.5px solid #f0f0f2;
  border-radius: 25px;
  box-shadow: 0 0 10px rgba(2, 2, 2, 2.3);
  padding: 30px;
  margin: 40px auto;
  max-width: 1100px;
  color: #fff;
}

.fotky-vozu-section .grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.fotky-vozu-section .card {
  background: #202026;
  border: 2px solid #9F9B36;
  border-radius: 8px;
  width: 180px;
  padding: 15px;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
  color: #fff;
  font-weight: bold;
  transition: box-shadow 0.2s;
}

.fotky-vozu-section .card:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Trochu výraznější stín po najetí */
}

.fotky-vozu-section .card::after {
  content: "📷";
  position: absolute;
  top: -9px;
  right: 20px;
  font-size: 20px;
  opacity: 0.6;
}

/* =========================================================
   MODAL (NÁHLEDY) + IMAGE OVERLAY (VELKÁ FOTKA)
========================================================= */
.modal,
.image-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75); /* Trochu tmavší pozadí pro lepší kontrast */
  justify-content: center;
  align-items: center;
}

.modal {
  z-index: 2000;
}

.image-overlay {
  z-index: 3000;
}

/* Modal s náhledy fotek */
.modal-content {
  background: #3a3a47;
  padding: 20px;
  border-radius: 8px;
  width: 700px;
  max-width: 90vw; /* Pojistka pro menší monitory */
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 2001;
  color: #fff;
}

/* Zavírací křížek modalu */
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 24px;
  color: #fff;
  z-index: 2002;
  transition: transform 0.2s;
}

.close:hover {
  transform: scale(1.1);
}

/* Zavírací křížek pro velkou fotku */
.overlay-close {
  position: absolute;
  top: 15px;
  right: 20px;
  cursor: pointer;
  font-size: 32px;
  color: #f91212;
  z-index: 3001;
  transition: transform 0.2s;
}

.overlay-close:hover {
  transform: scale(1.1);
}

/* =========================================================
   SLIDER (MŘÍŽKA NÁHLEDŮ)
========================================================= */
.slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  flex-wrap: wrap;
}

.img-wrapper {
  position: relative;
  flex: 0 0 auto;
}

.slider img {
  width: 180px;
  border: 2px solid #ccc;
  border-radius: 6px;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.slider img:hover {
  transform: scale(1.05);
  border-color: #f08a24; /* Tvoje firemní oranžová */
}

/* Ikonka lupy na náhledu */
.zoom-fixed-preview {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  font-size: 16px;
  padding: 4px;
  pointer-events: none;
}

/* =========================================================
   VELKÁ FOTKA V OVERLAYI
========================================================= */
.image-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
  z-index: 3000;
  user-select: none;
}

/* =========================================================
   ŠIPKY PRO LISTOVÁNÍ (DESKTOP)
========================================================= */
.overlay-prev,
.overlay-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 55px;
  width: 60px;
  height: 80px;
  cursor: pointer;
  z-index: 3005; /* Bezpečně nad fotkou */
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background-color 0.2s ease, transform 0.1s;
}

.overlay-prev { left: 25px; }
.overlay-next { right: 25px; }

.overlay-prev:hover,
.overlay-next:hover {
  background-color: rgba(240, 138, 36, 0.9); /* Firemní oranžová */
}

.overlay-prev:active,
.overlay-next:active {
  transform: translateY(-50%) scale(0.9);
}

/* =========================================================
   ŠIPKY PRO LISTOVÁNÍ (MOBILY A TABLETY)
========================================================= */
@media (max-width: 768px) {
  .overlay-prev,
  .overlay-next {
    position: fixed;
    width: 45px;
    height: 60px;
    font-size: 40px;
    background-color: rgba(0, 0, 0, 0.5); /* Opraven překlep */
    border-radius: 8px;
    /* Zajištění, že na mobilech nepřebírají dotykové chování fotky */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .overlay-prev {
    left: max(5px, env(safe-area-inset-left));
  }

  .overlay-next {
    right: max(5px, env(safe-area-inset-right));
  }
}

/* =========================================================
   Fotky vozu 2.0 – foto checklist karty
========================================================= */
body.jc .fotky-vozu-section {
  max-width: none !important;
  margin: 24px 10px 34px !important;
  padding: 26px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,.70) !important;
  background:
    radial-gradient(circle at 16% 0%, rgba(69,145,213,.12), transparent 30%),
    linear-gradient(135deg, #353544 0%, #30303d 100%) !important;
  box-shadow: 0 16px 36px rgba(0,0,0,.42) !important;
}

body.jc .fotky-vozu-section .grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) !important;
  gap: 14px !important;
  margin: 0 !important;
}

body.jc .fotky-vozu-section .card {
  width: auto !important;
  min-height: 122px !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 10px !important;
  border: 1px solid rgba(159,155,54,.70) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(31,41,55,.78), rgba(26,26,34,.72)) !important;
  color: #f5f7fb !important;
  text-align: left !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 8px 18px rgba(0,0,0,.22) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease !important;
}

body.jc .fotky-vozu-section .card:hover {
  transform: translateY(-2px);
  border-color: rgba(69,145,213,.85) !important;
  background:
    linear-gradient(180deg, rgba(37,52,75,.86), rgba(27,35,48,.76)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 24px rgba(0,0,0,.30) !important;
}

body.jc .fotky-vozu-section .card::before {
  content: "📷";
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: rgba(69,145,213,.14);
  border: 1px solid rgba(69,145,213,.30);
  font-size: 21px;
  line-height: 1;
}

body.jc .fotky-vozu-section .card::after {
  content: "Bez fotky";
  position: static !important;
  width: auto !important;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(148,163,184,.14);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  font-weight: 850;
  opacity: 1 !important;
}

body.jc .fotky-vozu-section .card.is-filled {
  border-color: rgba(52,211,153,.48) !important;
  background:
    linear-gradient(180deg, rgba(20,83,70,.52), rgba(26,26,34,.74)) !important;
}

body.jc .fotky-vozu-section .card.is-filled::after {
  content: attr(data-photo-status);
  background: rgba(16,185,129,.20);
  border-color: rgba(52,211,153,.35);
  color: #d1fae5;
}

body.jc .fotky-vozu-section .card.has-cover {
  background-image:
    linear-gradient(180deg, rgba(15,23,42,.30), rgba(15,23,42,.82)),
    var(--photo-cover) !important;
  background-size: cover !important;
  background-position: center !important;
}

body.jc .fotky-vozu-section .card.has-cover::before {
  background: rgba(0,0,0,.34);
  border-color: rgba(255,255,255,.18);
}

body.jc .fotky-vozu-section .card .photo-card-title,
body.jc .fotky-vozu-section .card {
  font-size: 17px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
}

body.jc .fotky-vozu-section .card .photo-card-status {
  display: none !important;
}

body.jc .modal-content {
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(69,145,213,.12), transparent 32%),
    #30303d !important;
  box-shadow: 0 20px 50px rgba(0,0,0,.55) !important;
}

body.jc .modal-content h3 {
  margin: 0 0 14px !important;
  color: #f5f7fb !important;
  font-size: 24px !important;
  font-weight: 900 !important;
}

body.jc .modal-content input[type="file"] {
  width: 100% !important;
  padding: 10px !important;
  border: 1px dashed rgba(69,145,213,.48) !important;
  border-radius: 13px !important;
  background: rgba(31,41,55,.45) !important;
  color: #dbeafe !important;
  box-sizing: border-box !important;
}

body.jc .modal-content input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: #25364f;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

body.jc .slider {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 12px !important;
  margin-top: 14px !important;
  padding: 0 !important;
  overflow: visible !important;
}

body.jc .img-wrapper {
  width: 100%;
  border-radius: 13px;
  overflow: hidden;
  background: #252634;
  box-shadow: 0 8px 18px rgba(0,0,0,.30);
}

body.jc .slider img {
  width: 100% !important;
  height: 120px !important;
  object-fit: cover !important;
  border: 0 !important;
  border-radius: 13px !important;
}

@media (max-width: 1180px) {
  body.jc .fotky-vozu-section .grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  body.jc .fotky-vozu-section {
    margin: 16px 10px 26px !important;
    padding: 12px !important;
    border-radius: 14px !important;
  }

  body.jc .fotky-vozu-section .grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.jc .fotky-vozu-section .card {
    min-height: 92px !important;
    padding: 14px !important;
    display: grid !important;
    grid-template-columns: 44px 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
  }

  body.jc .fotky-vozu-section .card::before {
    width: 40px;
    height: 40px;
  }

  body.jc .fotky-vozu-section .card::after {
    white-space: nowrap;
  }

  body.jc .modal-content {
    width: calc(100vw - 26px) !important;
    max-width: calc(100vw - 26px) !important;
    padding: 16px !important;
    border-radius: 16px !important;
  }

  body.jc .slider {
    grid-template-columns: 1fr !important;
  }

  body.jc .slider img {
    height: 190px !important;
  }
}
