/* JABAL INN — Admin Panel Styles */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500&display=swap');

:root {
  --admin-bg: #f8f6f3;
  --admin-card: #ffffff;
  --admin-border: #e5ddd0;
  --admin-dark: #1a1814;
  --admin-text: #2a2520;
  --admin-muted: #8a8580;
  --admin-accent: #C3922E;
  --admin-accent-dark: #a87a22;
  --admin-danger: #c0392b;
  --admin-success: #27ae60;
  --admin-radius: 8px;
  --admin-shadow: 0 1px 3px rgba(0,0,0,0.08);
  --admin-shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --ff-ui: 'Montserrat', sans-serif;
  --ff-display: 'Playfair Display', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ff-ui);
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Login ── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--admin-dark);
}
.login-card {
  background: var(--admin-card);
  padding: 3rem 2.5rem;
  border-radius: 12px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card__logo {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}
.login-card__sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--admin-muted);
  margin-bottom: 2rem;
}
.login-card input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  font-family: var(--ff-ui);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.login-card input:focus { border-color: var(--admin-accent); }
.login-card .btn { width: 100%; }
.login-error {
  color: var(--admin-danger);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: none;
}

/* ── Layout ── */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--admin-dark);
  color: #e0dbd4;
  padding: 1.5rem 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar__brand {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.5rem;
}
.sidebar__brand h1 {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: #fff;
}
.sidebar__brand span {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--admin-accent);
}

.sidebar__nav { flex: 1; padding: 0.5rem 0; }
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  color: #b0aaa0;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar__link:hover { color: #fff; background: rgba(255,255,255,0.04); }
.sidebar__link--active {
  color: #fff;
  background: rgba(195,146,46,0.12);
  border-right: 3px solid var(--admin-accent);
}
.sidebar__link svg { width: 18px; height: 18px; opacity: 0.6; }
.sidebar__link--active svg { opacity: 1; }

.sidebar__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #b0aaa0;
  font-size: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--ff-ui);
}
.sidebar__logout:hover { color: var(--admin-danger); }

/* ── Main Content ── */
.main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 1200px;
}
.main__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.main__title {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 400;
}
.main__subtitle {
  font-size: 0.75rem;
  color: var(--admin-muted);
  margin-top: 0.25rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--admin-radius);
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn--primary {
  background: var(--admin-accent);
  color: #fff;
}
.btn--primary:hover { background: var(--admin-accent-dark); }
.btn--outline {
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
}
.btn--outline:hover { border-color: var(--admin-accent); color: var(--admin-accent); }
.btn--danger { background: var(--admin-danger); color: #fff; }
.btn--danger:hover { background: #a93226; }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.7rem; }
.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

/* ── Cards ── */
.card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--admin-shadow);
}
.card--flush { padding: 0; }

/* ── Item List ── */
.item-list { list-style: none; }
.item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
  transition: background 0.1s;
}
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: #faf8f5; }
.item-row[draggable="true"] { cursor: grab; }
.item-row.dragging { opacity: 0.4; }

.item-row__img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--admin-bg);
  flex-shrink: 0;
}
.item-row__info { flex: 1; min-width: 0; }
.item-row__title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.item-row__meta {
  font-size: 0.7rem;
  color: var(--admin-muted);
}
.item-row__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.item-row__drag {
  display: flex;
  align-items: center;
  color: var(--admin-muted);
  cursor: grab;
  padding: 0.25rem;
}
.item-row__drag svg { width: 16px; height: 16px; }

/* ── Toggle Switch ── */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--admin-border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle__slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle__slider { background: var(--admin-success); }
.toggle input:checked + .toggle__slider::after { transform: translateX(16px); }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--admin-muted);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  font-family: var(--ff-ui);
  font-size: 0.85rem;
  color: var(--admin-text);
  background: var(--admin-card);
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--admin-accent); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Tags Input ── */
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-card);
  min-height: 40px;
  cursor: text;
}
.tags-input:focus-within { border-color: var(--admin-accent); }
.tags-input .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: #f0ebe3;
  border-radius: 4px;
  font-size: 0.75rem;
}
.tags-input .tag button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--admin-muted);
  padding: 0;
}
.tags-input .tag button:hover { color: var(--admin-danger); }
.tags-input input {
  border: none;
  outline: none;
  font-family: var(--ff-ui);
  font-size: 0.8rem;
  flex: 1;
  min-width: 80px;
  padding: 0.2rem;
}

/* ── Image Upload ── */
.img-upload {
  border: 2px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #faf8f5;
}
.img-upload:hover, .img-upload.dragover {
  border-color: var(--admin-accent);
  background: rgba(195,146,46,0.04);
}
.img-upload__text {
  font-size: 0.8rem;
  color: var(--admin-muted);
}
.img-upload__hint {
  font-size: 0.65rem;
  color: var(--admin-muted);
  margin-top: 0.3rem;
  opacity: 0.6;
}
.img-upload input[type="file"] { display: none; }

.img-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.img-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--admin-bg);
}
.img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-preview__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Hero Slots ── */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.hero-slot {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--admin-radius);
  overflow: hidden;
  background: var(--admin-bg);
  cursor: pointer;
  border: 2px solid var(--admin-border);
  transition: border-color 0.2s;
}
.hero-slot:hover { border-color: var(--admin-accent); }
.hero-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slot__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero-slot input[type="file"] { display: none; }

/* ── Gallery Grid (admin) ── */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.gallery-admin-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--admin-radius);
  overflow: hidden;
  background: var(--admin-bg);
  cursor: grab;
}
.gallery-admin-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-admin-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-admin-item:hover .gallery-admin-item__overlay { opacity: 1; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--admin-card);
  border-radius: 12px;
  width: 95%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
}
.modal__title { font-family: var(--ff-display); font-size: 1.2rem; }
.modal__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--admin-muted);
  padding: 0.25rem;
}
.modal__body { padding: 1.5rem; }
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--admin-border);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--admin-radius);
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  animation: toastIn 0.3s ease;
  box-shadow: var(--admin-shadow-lg);
}
.toast--success { background: var(--admin-success); }
.toast--error { background: var(--admin-danger); }
.toast--info { background: var(--admin-dark); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Section view (hidden by default) ── */
.section-view { display: none; }
.section-view.active { display: block; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--admin-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: 0.3; }
.empty-state p { font-size: 0.85rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem;
  }
  .sidebar__brand { display: none; }
  .sidebar__nav {
    display: flex;
    gap: 0;
    padding: 0;
  }
  .sidebar__link {
    padding: 0.5rem 1rem;
    white-space: nowrap;
    font-size: 0.7rem;
  }
  .sidebar__link--active { border-right: none; border-bottom: 2px solid var(--admin-accent); }
  .sidebar__footer { display: none; }
  .main { padding: 1rem; }
  .form-row, .form-row--3 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; }
}

/* ── Loading ── */
.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--admin-border);
  border-top-color: var(--admin-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
