/* ============================================
   GSE Concept — Admin Gallery Styles
   ============================================ */

/* ---- Rouage (gear button) — bas à droite ---- */
#admin-gear-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  top: auto;
  z-index: 8000;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #181818;
  border: 1px solid #333;
  color: rgba(255,255,255,0.28);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.35s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
#admin-gear-btn:hover {
  color: #db7310;
  border-color: #db7310;
  background: #1e1e1e;
  transform: rotate(45deg);
}
#admin-gear-btn.admin-gear-on {
  color: #db7310;
  border-color: #db7310;
  background: rgba(219,115,16,0.08);
  animation: gear-spin 6s linear infinite;
}
@keyframes gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- Modal de connexion admin ---- */
#admin-login-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}
.admin-modal-box {
  position: relative;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-top: 2px solid #db7310;
  border-radius: 10px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  color: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}
.admin-modal-box h3 {
  font-family: 'Oswald', sans-serif;
  color: #f0f0f0;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.admin-modal-box p {
  color: rgba(255,255,255,0.35);
  font-size: 0.78rem;
  margin-bottom: 22px;
  letter-spacing: 0.02em;
}
.admin-modal-box input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.admin-modal-box input[type="password"]:focus { border-color: #db7310; }
.admin-modal-btns { display: flex; gap: 8px; }
.admin-modal-btns button {
  flex: 1;
  padding: 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
#admin-modal-cancel {
  background: transparent;
  border-color: #333;
  color: rgba(255,255,255,0.45);
}
#admin-modal-cancel:hover {
  border-color: #555;
  color: rgba(255,255,255,0.7);
}
#admin-modal-ok {
  background: #db7310;
  border-color: #db7310;
  color: #fff;
}
#admin-modal-ok:hover { opacity: 0.88; }
.admin-modal-error {
  margin-top: 10px;
  color: #ff6b6b;
  font-size: 0.78rem;
  min-height: 1.2em;
}


#admin-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 48px;
  background: #0f0f0f;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
}

/* Push body content below toolbar (toolbar 48px, s'ajoute au padding-top: 70px de la navbar) */
body.admin-active { padding-top: calc(70px + 48px); }

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #db7310;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 4px;
}
.admin-badge::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #db7310;
  box-shadow: 0 0 6px #db7310;
  flex-shrink: 0;
}

label.admin-btn { margin-bottom: 0; }

.admin-btn {
  background: transparent;
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 0 13px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  height: 30px;
  box-sizing: border-box;
  line-height: 1;
  vertical-align: middle;
}
.admin-btn:hover {
  color: #fff;
  border-color: #db7310;
  background: rgba(219,115,16,0.1);
}

.save-btn  { border-color: rgba(46,204,113,0.35); color: #2ecc71; }
.save-btn:hover  { background: rgba(46,204,113,0.12); border-color: #2ecc71; }

.logout-btn {
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  margin-left: auto;
}
.logout-btn:hover {
  color: #e74c3c;
  border-color: #e74c3c;
  background: rgba(231,76,60,0.1);
}

/* Delete button on each item */
.admin-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 10;
  background: rgba(231, 76, 60, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-weight: 700;
  line-height: 1;
}
.tz-gallery .row > [class*="col"]:hover .admin-delete-btn,
.tz-gallery .row > [class*="lightbox"]:hover .admin-delete-btn {
  opacity: 1;
}

/* Drag ghost (Sortable) */
.admin-drag-ghost {
  opacity: 0.4;
  outline: 2px dashed #db7310;
}

/* Zone de drop (drag & drop depuis l'OS) */
.tz-gallery .row.admin-drop-over {
  outline: 3px dashed #db7310;
  outline-offset: 4px;
  background: rgba(219, 115, 16, 0.07);
  border-radius: 6px;
}

/* Skeleton loader */
@keyframes skeleton-pulse {
  0%   { background-color: rgba(255,255,255,0.06); }
  50%  { background-color: rgba(255,255,255,0.14); }
  100% { background-color: rgba(255,255,255,0.06); }
}
.containerr.skeleton-loading {
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  min-height: 180px;
  border-radius: 6px;
}
.containerr.skeleton-loading img,
.containerr.skeleton-loading .overlay {
  opacity: 0;
}

/* Badge / éditeur alt text */
.admin-alt-editor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.65);
  color: rgba(255,255,255,0.75);
  font-size: 0.72rem;
  font-family: 'Inter', sans-serif;
  padding: 3px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
  border-radius: 0 0 4px 4px;
  transition: color 0.2s, background 0.2s;
}
.admin-alt-editor:hover {
  background: rgba(219,115,16,0.7);
  color: #fff;
}
.admin-alt-input {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.9);
  color: #fff;
  border: 1px solid #db7310;
  border-radius: 0 0 4px 4px;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  padding: 3px 6px;
  text-align: center;
  outline: none;
  z-index: 20;
}

/* Drag cursor on images and gallery vignettes */
body.admin-active .containerr,
body.admin-active .vignette-inner {
  cursor: grab;
}
body.admin-active .containerr:active,
body.admin-active .vignette-inner:active {
  cursor: grabbing;
}

/* Toast */
#admin-toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #181818;
  color: rgba(255,255,255,0.8);
  border: 1px solid #333;
  border-left: 3px solid #db7310;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 99999;
  pointer-events: none;
  white-space: nowrap;
}
#admin-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Gallery Manager Panel ---- */
#admin-gallery-manager {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gm-panel {
  position: relative;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-top: 2px solid #db7310;
  border-radius: 10px;
  width: 94%;
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.75);
  font-family: 'Inter', sans-serif;
  color: #fff;
}
.gm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #222;
}
.gm-header h3 {
  font-family: 'Oswald', sans-serif;
  color: #f0f0f0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0;
}
.gm-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.gm-close:hover { color: rgba(255,255,255,0.8); }

.gm-body {
  overflow-y: auto;
  padding: 14px 22px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.gm-body::-webkit-scrollbar { width: 4px; }
.gm-body::-webkit-scrollbar-track { background: transparent; }
.gm-body::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.gm-loading {
  color: rgba(255,255,255,0.3);
  text-align: center;
  padding: 30px 0;
  font-size: 0.82rem;
}
.gm-error {
  color: #ff6b6b;
  text-align: center;
  padding: 20px 0;
  font-size: 0.82rem;
}

/* Group */
.gm-group { margin-bottom: 20px; }
.gm-group-title {
  color: rgba(255,255,255,0.25);
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #222;
}

/* Item row */
.gm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 6px;
  transition: background 0.12s;
  margin-bottom: 1px;
}
.gm-item:hover { background: rgba(255,255,255,0.03); }
.gm-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gm-item-label {
  font-weight: 500;
  font-size: 0.88rem;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-item-meta {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.28);
}
.gm-item-meta a {
  color: rgba(219,115,16,0.55);
  text-decoration: none;
}
.gm-item-meta a:hover { color: #db7310; text-decoration: underline; }

.gm-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.gm-btn-sm {
  background: transparent;
  border: 1px solid #2e2e2e;
  color: rgba(255,255,255,0.35);
  border-radius: 5px;
  width: 28px;
  height: 28px;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.gm-btn-sm:hover {
  background: rgba(219,115,16,0.12);
  border-color: rgba(219,115,16,0.5);
  color: #db7310;
}
.gm-btn-sm.gm-delete:hover {
  background: rgba(231,76,60,0.1);
  border-color: rgba(231,76,60,0.5);
  color: #e74c3c;
}

/* Footer */
.gm-footer {
  padding: 12px 22px;
  border-top: 1px solid #222;
  display: flex;
  justify-content: center;
}
.gm-create-btn {
  border-color: rgba(46,204,113,0.4) !important;
  color: rgba(46,204,113,0.75) !important;
}
.gm-create-btn:hover {
  border-color: #2ecc71 !important;
  color: #2ecc71 !important;
  background: rgba(46,204,113,0.08) !important;
}

/* Create form */
.gm-create-form {
  padding: 14px 22px;
  border-top: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gm-input {
  width: 100%;
  padding: 9px 12px;
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.gm-input:focus { border-color: #db7310; }
.gm-input[readonly] { color: rgba(255,255,255,0.3); }
.gm-input-sm { font-size: 0.78rem; padding: 7px 12px; }

.gm-create-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.gm-confirm-btn {
  border-color: #2ecc71 !important;
  color: #2ecc71 !important;
}
.gm-confirm-btn:hover {
  background: rgba(46,204,113,0.15) !important;
}
.gm-create-error {
  color: #ff6b6b;
  font-size: 0.8rem;
  min-height: 1em;
}

/* Gallery manager button in toolbar — même style que les autres */
.gallery-mgr-btn {
  border-color: rgba(219,115,16,0.35) !important;
  color: rgba(219,115,16,0.8) !important;
}
.gallery-mgr-btn:hover {
  border-color: #db7310 !important;
  color: #db7310 !important;
  background: rgba(219,115,16,0.1) !important;
}

/* Auto-save hint dans la toolbar */
.admin-autosave-hint {
  color: rgba(255,255,255,0.45);
  font-size: 0.78rem;
  font-style: italic;
  margin-left: 4px;
}

/* Bouton admin dans la navbar */
.navbar-admin-btn {
  font-size: 1.1rem;
  opacity: 0.3;
  transition: opacity 0.2s, color 0.2s;
  padding: 4px 8px !important;
}
.navbar-admin-btn:hover {
  opacity: 1;
  color: #db7310 !important;
}

/* ============================================
   Production Manager
   ============================================ */

/* Overlay backdrop */
#prod-admin-manager {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prod-mgr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}
#prod-admin-manager .gm-panel { position: relative; }

/* Zone upload logo */
.prod-logo-area {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.prod-logo-label {
  width: 88px;
  height: 88px;
  background: #0f0f0f;
  border: 1px dashed #444;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}
.prod-logo-label:hover { border-color: #db7310; }
#prod-logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.25);
  font-size: 0.68rem;
  text-align: center;
  pointer-events: none;
}

/* Formulaire d'édition inline dans le panel */
.prod-edit-form {
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px 12px;
  margin-bottom: 2px;
  background: rgba(255,255,255,0.02);
  border-radius: 0 0 6px 6px;
}

/* Items dans la grille production */
.prod-trigger {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
}
.prod-trigger img.picto {
  margin: 0;
}
.prod-del-overlay {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(231,76,60,0.9);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}
.prod-dyn-item:hover .prod-del-overlay { opacity: 1; }

.prod-dyn-caption {
  display: block;
  font-size: 0.73rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
}
.prod-no-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.18);
  background: #1a1a1a;
  border-radius: 6px;
  width: 72px;
  height: 72px;
}

/* Miniature dans la liste du panel */
.prod-list-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  background: #0f0f0f;
  flex-shrink: 0;
}
.prod-list-thumb-empty {
  width: 36px;
  height: 36px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.2);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Modale description (visible pour tous les visiteurs) */
#prod-desc-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prod-desc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}
.prod-desc-box {
  position: relative;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-top: 3px solid #db7310;
  border-radius: 10px;
  padding: 36px 40px;
  max-width: 580px;
  width: 90%;
  font-family: 'Inter', sans-serif;
}
.prod-desc-box h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #db7310;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.prod-desc-box p {
  font-size: 0.9rem;
  color: #b0b0b0;
  line-height: 1.75;
  margin: 0;
}
.prod-desc-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.prod-desc-close:hover { color: #db7310; }
