/* ============================================================
   DPSS Kanpur — Gallery Slideshow + Login Modal + Admin Panel
   ============================================================ */

/* ── 8-cell gallery grid ── */
.gal-grid-8 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) {
  .gal-grid-8 { grid-template-columns: repeat(4, 1fr); }
}
.gal-cell8 {
  border-radius: 12px; height: 130px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; position: relative; overflow: hidden; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
}
.gal-cell8:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.gal-cell8 .gal-cell-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; color: #0b4d1e;
  font-size: 11px; font-weight: 800; text-align: center; padding: 8px;
  letter-spacing: .05em;
  border-radius: 0 0 12px 12px;
  text-shadow: none;
}

/* ── SLIDESHOW POPUP ── */
#slideshow-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, .93);
  flex-direction: column; align-items: center; justify-content: center;
}
#slideshow-overlay.open { display: flex; }
.ss-top {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; position: absolute; top: 0; left: 0;
}
.ss-title { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .05em; }
.ss-close {
  background: rgba(255, 255, 255, .12); border: none; color: #fff;
  width: 38px; height: 38px; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .2s;
}
.ss-close:hover { background: rgba(255, 255, 255, .25); }
.ss-main {
  width: 92vw; max-width: 680px; height: 62vw; max-height: 420px;
  border-radius: 16px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #111; box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.ss-slide {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center;
  font-size: 5rem; border-radius: 16px; position: absolute;
  opacity: 0; transition: opacity .4s;
}
.ss-slide.active { opacity: 1; position: relative; }
.ss-counter { color: rgba(255, 255, 255, .55); font-size: 12px; margin-top: 12px; letter-spacing: .1em; }
.ss-nav { display: flex; gap: 16px; margin-top: 16px; }
.ss-btn {
  background: rgba(255, 255, 255, .12); border: none; color: #fff;
  padding: 10px 24px; border-radius: 30px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: .2s; letter-spacing: .06em;
}
.ss-btn:hover { background: var(--gold); color: var(--g1); }
.ss-dots { display: flex; gap: 8px; margin-top: 14px; }
.ss-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, .25); cursor: pointer; transition: .2s; border: none;
}
.ss-dot.active { background: var(--goldf); transform: scale(1.3); }

/* ── ADMIN FAB (hidden — admin opens via nav menu) ── */
#admin-fab { display: none; }

/* ── LOGIN MODAL ── */
#login-modal {
  display: none; position: fixed; inset: 0; z-index: 9800;
  background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
#login-modal.open { display: flex; }
.login-card {
  background: #fff; border-radius: 20px; width: 92%; max-width: 380px;
  padding: 32px 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  position: relative;
}
.login-x {
  position: absolute; top: 14px; right: 14px; background: #f1f5f9;
  border: none; width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; font-size: 14px; color: #666;
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-head .ico { font-size: 2.4rem; margin-bottom: 8px; }
.login-head h2 {
  font-family: 'Playfair Display', serif;
  color: var(--g1); font-size: 1.4rem; margin-bottom: 4px;
}
.login-head p { font-size: 12px; color: var(--muted); }
.login-label {
  font-size: 12px; font-weight: 700; color: var(--g1);
  display: block; margin-bottom: 5px;
}
.login-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid #ddd;
  border-radius: 8px; font-size: 13px; font-family: 'Nunito', sans-serif;
  margin-bottom: 12px; box-sizing: border-box;
}
.login-pass-wrap { position: relative; }
.login-pass-wrap .login-input { padding-right: 40px; margin-bottom: 0; }
.login-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px;
}
.login-err { color: #dc2626; font-size: 12px; min-height: 18px; margin-top: 8px; }
.login-btn {
  width: 100%; background: var(--g1); color: #fff; border: none;
  padding: 13px; border-radius: 8px; font-size: 14px; font-weight: 700;
  cursor: pointer; margin-top: 4px; font-family: 'Nunito', sans-serif;
  transition: .2s;
}
.login-btn:hover:not(:disabled) { background: var(--g2); }
.login-btn:disabled { opacity: .65; cursor: not-allowed; }
.login-foot { text-align: center; font-size: 11px; color: var(--muted); margin-top: 14px; }

/* ── ADMIN MODAL ── */
#admin-modal {
  display: none; position: fixed; inset: 0; z-index: 9500;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
#admin-modal.open { display: flex; }
.adm-sheet {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 700px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .2);
  overflow: hidden;
}
@media (min-width: 700px) {
  #admin-modal { align-items: center; }
  .adm-sheet { border-radius: 16px; max-height: 85vh; }
}
.adm-header {
  background: var(--g1); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.adm-header h2 {
  color: #fff; font-size: 16px; font-weight: 700;
  font-family: 'Playfair Display', serif;
}
.adm-header span { color: var(--goldf); font-size: 11px; }
.adm-header-right { display: flex; align-items: center; gap: 8px; }
.adm-x {
  background: rgba(255, 255, 255, .15); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; font-size: 1rem; cursor: pointer;
}
#adm-logout-btn {
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 11px; font-weight: 700;
  cursor: pointer; display: none; font-family: 'Nunito', sans-serif;
}
.adm-tabs {
  display: flex; border-bottom: 2px solid #eee; overflow-x: auto;
  flex-shrink: 0; background: #fff;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--muted);
  border: none; background: none; cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: .2s; flex-shrink: 0;
}
.adm-tab.active { color: var(--g1); border-bottom-color: var(--gold); }
@media (min-width: 500px) {
  .adm-tab { padding: 11px 16px; font-size: 12px; }
}
.adm-body {
  flex: 1; overflow-y: auto; padding: 20px;
  width: 100%; box-sizing: border-box;
}
.adm-panel {
  display: none; max-width: 100%; box-sizing: border-box;
  overflow: hidden; word-wrap: break-word;
}
.adm-panel.active { display: block; }

/* Admin form elements */
.adm-label {
  font-size: 12px; font-weight: 700; color: var(--g1);
  display: block; margin-bottom: 5px; margin-top: 14px;
}
.adm-input, .adm-select, .adm-textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #ddd;
  border-radius: 8px; font-size: 13px; font-family: 'Nunito', sans-serif;
  background: #fafafa; transition: border-color .2s;
}
.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
  outline: none; border-color: var(--g2);
}
.adm-textarea { resize: vertical; min-height: 70px; }
.adm-input[type="date"], .adm-input[type="time"] { padding: 10px 14px; }
.adm-input[type="color"] { height: 44px; padding: 4px 8px; cursor: pointer; }
.adm-input[type="file"] { padding: 8px; }

.adm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--g1); color: #fff; border: none;
  padding: 11px 22px; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: .2s; margin-top: 14px;
}
.adm-btn:hover:not(:disabled) { background: var(--g2); }
.adm-btn:disabled { opacity: .65; cursor: not-allowed; }
.adm-btn-cancel { background: #6b7280; }
.adm-btn-cancel:hover:not(:disabled) { background: #4b5563; }
.adm-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-btn-danger { background: #dc2626; }
.adm-btn-danger:hover:not(:disabled) { background: #b91c1c; }

.adm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-item {
  background: #f7fbf8; border: 1.5px solid var(--bdr); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; position: relative;
}
.adm-item-title { font-size: 13px; font-weight: 700; color: var(--g1); margin-bottom: 3px; }
.adm-item-sub { font-size: 11px; color: var(--muted); }
.adm-item-actions { display: flex; gap: 6px; margin-top: 8px; }
.adm-item-actions .adm-btn { padding: 5px 12px; font-size: 11px; margin-top: 0; }
.adm-item-del {
  position: absolute; top: 10px; right: 10px;
  background: #fee2e2; color: #dc2626;
  border: none; border-radius: 6px; padding: 4px 8px;
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.adm-item-actions .adm-item-del { position: static; }
.adm-section-title {
  font-size: 13px; font-weight: 800; color: var(--g1);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--bdr);
}
.adm-section-title + .adm-section-title,
.adm-item + .adm-section-title { margin-top: 20px; }

.adm-gal-cell {
  background: linear-gradient(135deg, #0b4d1e, #1a6b2f);
  border-radius: 10px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; position: relative; cursor: pointer;
}
.adm-gal-cell .gal-cell-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, .4); color: #fff; font-size: 10px;
  text-align: center; padding: 5px; border-radius: 0 0 10px 10px;
}

.adm-photo-prev-round {
  display: none; width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--gold); margin: 8px 0;
}
.adm-photo-prev-round.sm {
  width: 70px; height: 70px; border: 2px solid var(--g2); margin: 6px 0;
}
#g-prev { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
#g-prev img {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 8px; border: 2px solid var(--g2);
}

/* ── ADMIN TOAST ── */
#adm-toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--g1); color: #fff; padding: 10px 22px; border-radius: 30px;
  font-size: 13px; font-weight: 700; z-index: 99999; opacity: 0;
  transition: all .3s ease; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}
#adm-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
