/* ================================================================
   ADMIN.CSS — Admin panel styles
================================================================ */

/* ── Gate (password screen) ───────────────────────────────────── */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e0e0e;
  z-index: 1000;
}

.gate-card {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,55,.2);
  padding: 2.5rem 2rem;
  border-radius: 6px;
  text-align: center;
  width: 100%;
  max-width: 360px;
}

.gate-logo {
  font-size: 2.5rem;
  margin-bottom: .8rem;
  opacity: .6;
}

.gate-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: #d4af37;
  margin-bottom: 1.4rem;
  letter-spacing: .06em;
}

.gate-input {
  width: 100%;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  background: #252525;
  border: 1px solid rgba(255,255,255,.1);
  color: #f0e8d0;
  font-family: 'Montserrat', sans-serif;
  font-size: .9rem;
  border-radius: 3px;
  outline: none;
  transition: border-color .25s;
}

.gate-input:focus { border-color: #d4af37; }

.gate-card .btn-primary {
  width: 100%;
  background: #d4af37;
  color: #0e0e0e;
}

.gate-error {
  margin-top: .8rem;
  color: #e07070;
  font-size: .83rem;
}

.gate-back {
  display: block;
  margin-top: 1.2rem;
  font-size: .78rem;
  color: rgba(255,255,255,.35);
  text-decoration: none;
  letter-spacing: .06em;
}

.gate-back:hover { color: rgba(255,255,255,.7); }

/* ── Admin layout ─────────────────────────────────────────────── */
#admin-page { font-family: 'Montserrat', sans-serif; }

#admin-dash {
  display: flex;
  min-height: 100vh;
  background: #f5f5f7;
  color: #1a1a2e;
}

/* Sidebar */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: #d4af37;
  padding: 0 1.2rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  letter-spacing: .08em;
}

.admin-nav {
  flex: 1;
  padding: .8rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anav-btn {
  width: 100%;
  padding: .7rem 1.2rem;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.55);
  font-family: 'Montserrat', sans-serif;
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s, color .2s;
  border-radius: 0;
}

.anav-btn:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.85); }
.anav-btn.active { background: rgba(212,175,55,.12); color: #d4af37; border-right: 2px solid #d4af37; }

.admin-sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.btn-save {
  display: block;
  width: 100%;
  padding: .65rem 1rem;
  background: #d4af37;
  color: #0e0e0e;
  border: none;
  font-family: 'Montserrat', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  cursor: pointer;
  border-radius: 3px;
  transition: background .2s;
  text-transform: uppercase;
}

.btn-save:hover { background: #c49e28; }

.btn-logout {
  display: block;
  text-align: center;
  font-size: .72rem;
  color: rgba(255,255,255,.3);
  text-decoration: none;
  letter-spacing: .06em;
  padding: .3rem 0;
}

.btn-logout:hover { color: rgba(255,255,255,.6); }

/* Main content */
.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  max-width: calc(100vw - 220px);
}

/* Save banner */
.save-banner {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: #22c55e;
  color: #fff;
  padding: .6rem 1.2rem;
  border-radius: 4px;
  font-size: .82rem;
  font-weight: 500;
  z-index: 200;
  animation: fadeInOut 2.5s ease forwards;
}

@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateY(-8px); }
  15%  { opacity: 1; transform: translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Tabs */
.atab { display: none; }
.atab.active { display: block; }

.atab-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: #1a1a2e;
  margin-bottom: 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid #e0e0e8;
  letter-spacing: .04em;
}

/* Card */
.acard {
  background: #fff;
  border-radius: 6px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.acard h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #1a1a2e;
  margin-bottom: 1rem;
  letter-spacing: .04em;
}

/* Field grid */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.field-group { display: flex; flex-direction: column; gap: .4rem; }
.field-group.full { grid-column: 1 / -1; }

.field-group label, .field-group > label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #666;
}

.field-group input,
.field-group select,
.field-group textarea {
  padding: .55rem .8rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  color: #1a1a2e;
  outline: none;
  background: #fafafa;
  transition: border-color .2s, box-shadow .2s;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: #c9a84c;
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
  background: #fff;
}

.field-group small { font-size: .72rem; color: #999; margin-top: .2rem; }
.field-hint { font-size: .78rem; color: #999; margin-bottom: .8rem; }

/* Theme grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .8rem;
}

.theme-card { cursor: pointer; }
.theme-card input { display: none; }

.theme-swatch {
  border-radius: 6px;
  height: 80px;
  display: flex;
  align-items: flex-end;
  padding: .5rem .6rem;
  border: 2px solid transparent;
  transition: border-color .2s, transform .2s;
  overflow: hidden;
}

.theme-swatch span {
  font-size: .7rem;
  font-weight: 500;
  color: #3d3529;
  letter-spacing: .04em;
  background: rgba(255,255,255,.7);
  padding: .2rem .4rem;
  border-radius: 2px;
}

.theme-card:has(input:checked) .theme-swatch {
  border-color: #c9a84c;
  transform: scale(1.03);
}

/* Toggles */
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .8rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .82rem;
  color: #444;
  cursor: pointer;
}

.toggle-check { display: none; }

.toggle-ui {
  width: 40px;
  height: 22px;
  background: #ddd;
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}

.toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left .2s;
}

.toggle-check:checked + .toggle-ui { background: #c9a84c; }
.toggle-check:checked + .toggle-ui::after { left: 21px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #ddd;
  border-radius: 6px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.2rem;
  transition: border-color .25s, background .25s;
  cursor: pointer;
}

.upload-zone:hover { border-color: #c9a84c; background: rgba(201,168,76,.04); }

.upload-label { cursor: pointer; display: block; }

.upload-icon { font-size: 2rem; margin-bottom: .5rem; }

.upload-zone p { font-size: .85rem; color: #555; margin-bottom: .2rem; }
.upload-hint { font-size: .72rem !important; color: #999 !important; }

/* Slide list */
.slide-list { display: flex; flex-direction: column; gap: .6rem; }

.slide-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: #f8f8f8;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: .5rem;
}

.slide-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.slide-item-info { flex: 1; font-size: .78rem; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.slide-item-btns { display: flex; gap: .3rem; }

.slide-item-btns button {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  font-size: .8rem;
  transition: background .2s;
}

.slide-item-btns button:hover { background: #fee; }

/* Timeline admin */
.timeline-entry {
  border: 1px solid #e8e8e8;
  border-radius: 5px;
  padding: 1rem;
  margin-bottom: .8rem;
  background: #fafafa;
}

.timeline-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .8rem;
}

.timeline-entry-header span {
  font-weight: 600;
  font-size: .78rem;
  color: #666;
}

.btn-remove {
  background: none;
  border: 1px solid #ddd;
  color: #e05050;
  font-size: .72rem;
  padding: .3rem .6rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background .2s;
}

.btn-remove:hover { background: #fee; }

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 3px;
  font-family: 'Montserrat', sans-serif;
  font-size: .8rem;
  color: #555;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  margin-bottom: 1rem;
}

.btn-add:hover { background: rgba(201,168,76,.1); border-color: #c9a84c; color: #a07830; }

/* Texts editor */
.lang-switcher-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }

.ltab {
  padding: .4rem .9rem;
  border: 1px solid #ddd;
  background: #f5f5f5;
  border-radius: 3px;
  font-size: .78rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.ltab.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

.texts-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.texts-editor.hidden { display: none; }

.text-field { display: flex; flex-direction: column; gap: .3rem; }

.text-field label {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #888;
}

.text-field input,
.text-field textarea {
  padding: .5rem .7rem;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-family: 'Montserrat', sans-serif;
  font-size: .82rem;
  color: #333;
  background: #fafafa;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
}

.text-field input:focus,
.text-field textarea:focus { border-color: #c9a84c; background: #fff; }

/* RSVP toolbar */
.rsvp-toolbar {
  display: flex;
  gap: .6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn-danger {
  padding: .5rem 1rem;
  background: transparent;
  border: 1px solid #e05050;
  color: #e05050;
  font-family: 'Montserrat', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  transition: background .2s;
}

.btn-danger:hover { background: #fee; }

/* RSVP table */
#rsvpTable { overflow-x: auto; }

.rsvp-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.rsvp-tbl th {
  text-align: left;
  padding: .6rem .8rem;
  background: #f0f0f0;
  border-bottom: 2px solid #e0e0e0;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #555;
}

.rsvp-tbl td {
  padding: .55rem .8rem;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.rsvp-tbl tr:hover td { background: #fafafa; }

.badge-yes { color: #22c55e; font-weight: 600; }
.badge-no  { color: #e05050; font-weight: 600; }

.rsvp-empty { padding: 2rem; text-align: center; color: #aaa; font-size: .85rem; }

/* Backup */
.backup-card {}
.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.backup-row:last-child { border-bottom: none; }

.backup-row h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  margin-bottom: .2rem;
}

.backup-row p { font-size: .8rem; color: #666; }

.btn-outline-admin {
  padding: .5rem 1.2rem;
  border: 1px solid #c9a84c;
  color: #a07830;
  background: transparent;
  font-family: 'Montserrat', sans-serif;
  font-size: .78rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
}

.btn-outline-admin:hover { background: rgba(201,168,76,.1); }

/* Responsive admin */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: -220px;
    z-index: 200;
    transition: left .3s;
    height: 100vh;
  }

  .admin-sidebar.open { left: 0; }

  .admin-main {
    max-width: 100vw;
    padding: 1rem;
  }

  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid { grid-template-columns: 1fr; }
}

/* Utility */
.w-full { width: 100%; }
