/* photosupervisor-user-panel.css */
/* --- Ogólne poprawki ikon/drzewa --- */

.photosupervisor-tree svg {
  width: 1.25rem !important;
  height: 1.25rem !important;
  display: inline;
  vertical-align: middle;
}
.photosupervisor-tree li { list-style: none; }
.photosupervisor-tree ul { margin-left: 0.75rem; padding-left: 0.25rem; }

/* --- Mapa o takiej samej szerokości jak slider (wyśrodkowane) --- */

/* Kontener mapy: szerokość jak slider, wyśrodkowany, pełna wysokość */
#ps-map-wrap {
  position: relative;
  width: min(1100px, 92vw);
  height: 100vh;
  margin: 0 auto;
  overflow: hidden;
}

/* Sama mapa wypełnia wrap */
#ps-map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin-top: 32px;
}

/* Jeśli widoczny pasek admina WP, odejmij jego wysokość */
body.admin-bar #ps-map-wrap {
  height: calc(100vh - 32px);
}

/* Lewy panel: białe tło, lekki blur, odsunięcie od górnych kontrolek */
.ps-overlay-left {
  position: fixed;
  top: 4.5rem;
  left: 1rem;
  width: min(240px, 92vw);
  max-height: calc(100% - 2rem - 140px);
  overflow: auto;
  z-index: 1000;

  background: rgba(255,255,255,.96);
  backdrop-filter: blur(2px);
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
  padding: 1rem;
}

/* Dolny panel: slider na środku, w granicach wrapa */
.ps-overlay-bottom {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(1100px, 92vw);
  z-index: 1000;

  background: rgb(255 255 255 / 26%);
  backdrop-filter: blur(2px);
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
  padding: 0.75rem;
}

/* --- MODAL UPLOAD --- */

#ps-photo-modal {
  display: none !important;
  position: fixed !important;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}
#ps-photo-modal.ps-show { display: flex !important; }
.ps-photo-modal-window {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 32px rgba(0,0,0,0.18);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  min-width: 320px;
  max-width: 95vw;
  width: 100%;
  position: relative;
}
.ps-photo-modal-close {
  position: absolute;
  top: 1rem; right: 1.2rem;
  background: none; border: none;
  color: #a1a1aa; font-size: 2rem;
  cursor: pointer; transition: color 0.2s;
  z-index: 10; line-height: 1;
}
.ps-photo-modal-close:hover { color: #111827; }
.ps-photo-modal-title {
  font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; color: #374151;
}
.ps-photo-modal-label { display: block; margin-bottom: 0.8rem; font-size: 0.96rem; color: #374151; }
.ps-photo-modal-textarea {
  width: 100%; padding: 0.6rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; margin-top: 0.25rem; font-size: 1rem; resize: none;
}
.ps-photo-modal-row {
  display: flex; flex-direction: row; gap: 1rem; align-items: flex-end; margin-bottom: 1rem;
}
.ps-photo-modal-file {
  width: 100%; padding: 0.6rem 0.4rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; margin-top: 0.25rem;
}
.ps-photo-modal-btn {
  background: #2563eb; color: #fff; padding: 0.8rem 1.4rem;
  border-radius: 0.5rem; border: none; box-shadow: 0 2px 10px rgba(37,99,235,0.12);
  margin-left: 1rem; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background 0.2s;
}
.ps-photo-modal-btn:hover { background: #1d4ed8; }
.ps-photo-modal-error { margin-top: 0.5rem; color: #ef4444; font-size: 0.98rem; }

@media (max-width: 600px) {
  .ps-photo-modal-window { min-width: unset; width: 97vw; padding: 1rem 0.5rem; }
  .ps-photo-modal-row { flex-direction: column; gap: 0.3rem; }
}

/* --- Slider miniaturek (na dole) --- */

#ps-photo-thumbs {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  max-width: 100%;
  scrollbar-width: thin;
}
#ps-photo-thumbs img {
  height: 80px;
  border-radius: 0.75rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.13);
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border 0.2s, box-shadow 0.2s;
}
#ps-photo-thumbs img.selected,
#ps-photo-thumbs img:focus {
  border: 2px solid #2563eb;
  box-shadow: 0 2px 12px rgba(37,99,235,0.13);
}

/* --- Modal podglądu zdjęcia --- */
#ps-photo-preview-modal {
  display: none;
  position: fixed;
  z-index: 10010;
  inset: 0;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}
#ps-photo-preview-modal.ps-show { display: flex; }
#ps-photo-preview-modal .ps-modal-window,
#ps-photo-preview-modal > div {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  max-width: 48rem;
  max-height: 85vh;
  overflow: auto;
}
#ps-photo-preview-modal img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto 1.5rem auto;
  border-radius: 1.2rem;
}
#ps-photo-preview-modal button {
  position: absolute; right: 1.25rem; top: 1.25rem;
  font-size: 2.2rem; background: none; border: none; color: #aaa;
  cursor: pointer; z-index: 10; line-height: 1;
}

/* Aktywny folder w drzewie katalogów */
.photosupervisor-tree a.ps-active-folder {
  border: 2px solid #2563eb;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 600;
  border-radius: 0.5rem;
  box-shadow: inset 0 0 0 3px rgba(37,99,235,0.12);
}
.photosupervisor-tree a.ps-active-folder:hover {
  background: #dbeafe;
}

/* --- Menu kontekstowe katalogów --- */
.ps-context-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 0.25rem 0;
  z-index: 2000;
  min-width: 180px;
}
.ps-context-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.95rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}
.ps-context-menu button:hover {
  background: #f3f4f6;
}

/* Ogólne reguły dla wszystkich modalowych overlayów */
.ps-photo-modal-overlay {
  display: none !important;
  position: fixed !important;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}
.ps-photo-modal-overlay.ps-show {
  display: flex !important;
}

.ps-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* tekst po lewej, ⋮ po prawej */
}

/* Styl przycisku ⋮ */
.ps-folder-menu-btn {
    background: none;
    border: none;
    outline: none;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

/* Usuwamy focus ring z przeglądarki */
.ps-folder-menu-btn:focus {
    outline: none;
    box-shadow: none;
}

/* Hover i aktywny stan */
.ps-folder-menu-btn:hover,
.ps-folder-menu-btn:active {
    background-color: rgba(0,0,0,0.07); /* delikatne tło */
}

/* Tree collapse */
.photosupervisor-tree ul ul { display: none; }
.photosupervisor-tree li.ps-expanded > ul { display: block; }

/* Toggle caret */
.ps-tree-toggle {
  width: 1.25rem; /* 20px */
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  margin-right: 0.25rem;
  color: #6b7280; /* gray-500 */
}
.ps-tree-toggle:hover {
  background: #f3f4f6; /* gray-100 */
}
.ps-tree-toggle svg {
  width: 0.9rem; height: 0.9rem;
  transition: transform 0.15s ease;
}
li.ps-expanded > a .ps-tree-toggle svg {
  transform: rotate(90deg);
}

/* Uni styl dla przycisku ⋮ (root i katalogi) */
.ps-actions-btn{
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px;              /* lekki „klik” */
  border-radius: 10px;       /* zaokrąglenie jak w root */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #6b7280;            /* gray-500 */
  cursor: pointer;
  user-select: none;
}
.ps-actions-btn:hover{
  background: #f3f4f6;       /* gray-100 */
  color: #374151;            /* gray-700 */
}
.ps-actions-btn:active{
  background: #e5e7eb;       /* gray-200 */
}
.ps-actions-btn:focus{
  outline: none;
}

/* rozmiar „⋮” */
.ps-actions-btn .ps-ellipsis{
  font-size: 18px;
  line-height: 1;
}

/* wyrównanie przycisku do prawej w wierszu folderu */
.ps-tree-item > .flex .ps-actions-btn{
  margin-left: auto;
}

.ps-tree-item > .flex {
  width: 100%;       /* pełna szerokość linii */
}
.ps-tree-item > .flex a {
  flex: 1;           /* link do folderu rozciąga się */
}


/* Wiersz folderu musi zajmować 100% szerokości */
.photosupervisor-tree .ps-tree-item > .flex{
  display:flex;
  align-items:center;
  gap:0.25rem;
  width:100% !important;
}

/* Link (nazwa katalogu) rozciąga się, żeby mógł wypchnąć ⋮ */
.photosupervisor-tree .ps-tree-item > .flex > a{
  flex:1 1 auto !important;
  min-width:0;
}

/* Sam przycisk ⋮ wypchnięty maksymalnie w prawo */
.photosupervisor-tree .ps-tree-item > .flex > .ps-actions-btn{
  margin-left:auto !important;
}

/* Na wszelki: caret niech nie przejmuje miejsca linku */
.photosupervisor-tree .ps-tree-item > .flex > .ps-tree-toggle{
  flex:0 0 auto;
}

/* === Alias: ujednolicenie klas modali „share” do istniejących styli === */

/* Overlay – jak .ps-photo-modal-overlay */
.ps-modal-overlay {
  display: none !important;
  position: fixed !important;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}
.ps-modal-overlay.ps-show {
  display: flex !important;
}

/* Okno – jak .ps-photo-modal-window */
.ps-modal-window {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 32px rgba(0,0,0,0.18);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  min-width: 320px;
  max-width: 95vw;
  width: 100%;
  position: relative;
}

/* Zamknięcie – jak .ps-photo-modal-close */
.ps-modal-close {
  position: absolute;
  top: 1rem; right: 1.2rem;
  background: none; border: none;
  color: #a1a1aa; font-size: 2rem;
  cursor: pointer; transition: color 0.2s;
  z-index: 10; line-height: 1;
}
.ps-modal-close:hover { color: #111827; }

@media (max-width: 600px) {
  .ps-modal-window { min-width: unset; width: 97vw; padding: 1rem 0.5rem; }
}
