/*
 * Admin panel only — layout/interaction CSS that AdminShell.jsx handled
 * with framer-motion + Tailwind's `dark:` variant. Loaded alongside
 * site.css (which already carries the --admin-* color tokens) on every
 * admin/*.php page.
 */

body.admin-body {
  background: var(--admin-bg);
}

/* --- Mobile sidebar drawer: fixed off-canvas, slides in from the left,
   same breakpoints/positioning as the original's <aside> classes. ---- */
@media (max-width: 1023px) {
  #admin-sidebar {
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  #admin-sidebar.is-open {
    transform: translateX(0);
  }
}

/* --- Sidebar collapse (desktop only) — icons-only column. ------------ */
@media (min-width: 1024px) {
  #admin-sidebar.is-collapsed {
    width: 64px;
  }
  #admin-sidebar.is-collapsed .admin-nav-label,
  #admin-sidebar.is-collapsed .admin-nav-group-label,
  #admin-sidebar.is-collapsed #admin-sidebar-collapse-label {
    display: none;
  }
  #admin-sidebar.is-collapsed .admin-nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  #admin-sidebar.is-collapsed #admin-sidebar-collapse-btn {
    justify-content: center;
  }
  #admin-sidebar.is-collapsed #admin-sidebar-collapse-icon {
    transform: rotate(180deg);
  }
}

/* --- Active nav link (was framer-motion's shared layoutId "pill") ---
   Brand red instead of plain gold, to match the public site's nav
   (nav links there use the same bg-jred / text-white active state). --- */
.admin-nav-active {
  background: #c8102e;
  color: #ffffff !important;
  box-shadow: 0 2px 10px -2px rgba(200, 16, 46, 0.55);
}
.admin-nav-active svg {
  color: #ffffff;
}

/* --- Primary action button — the site's red CTA, reused everywhere an
   admin page has a solid "Save / Add / Generate" button (was solid gold
   with a --tw-* opacity hover; now matches the homepage's red buttons,
   with the gold trim kept only as a hover-state accent). ----------------- */
.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 9999px;
  background: #c8102e;
  background-image: linear-gradient(90deg, #8f0018 0%, #c8102e 55%, #8f0018 100%);
  color: #ffffff;
  font-weight: 600;
  transition: filter 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 2px 10px -2px rgba(200, 16, 46, 0.5);
}
.admin-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}
.admin-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Profile dropdown fade/scale-in ------------------------------------ */
#admin-profile-menu {
  transform-origin: top right;
}

/* --- Dashboard stat cards: hover lift (was whileHover={{ y: -4 }}) --- */
.admin-stat-card {
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.admin-stat-card:hover {
  transform: translateY(-4px);
}

/* --- Generic admin panel/card fade-in-on-load (was framer's
   initial={opacity:0,y:16} -> animate) — simple one-shot CSS animation,
   no IntersectionObserver needed since everything here is above the
   fold on page load. --------------------------------------------------- */
@keyframes admin-fade-up {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
.admin-fade-up {
  animation: admin-fade-up 400ms ease both;
}

/* --- Simple table/card styling shared across admin list pages -------- */
.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-muted);
  padding: 0.75rem 1rem;
}
.admin-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--admin-text);
  border-top: 1px solid var(--admin-border);
}
.admin-table tr:hover td {
  background: var(--admin-surface-hover);
}

/* --- Toast notifications (assets/js/admin-toast.js) -------------------- */
#admin-toast-host {
  position: fixed;
  z-index: 200;
  top: 1rem;
  right: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  pointer-events: none;
}
@media (min-width: 640px) {
  #admin-toast-host {
    left: auto;
    width: 22rem;
  }
}
.admin-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  max-width: 22rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.35);
  color: var(--admin-text);
  font-size: 0.85rem;
  line-height: 1.35;
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1), opacity 220ms ease;
  border-left: 4px solid #64748b;
}
.admin-toast.is-in {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.admin-toast.is-out {
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
}
.admin-toast-success {
  border-left-color: #10b981;
}
.admin-toast-error {
  border-left-color: #c8102e;
}
.admin-toast-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05rem;
}
.admin-toast-success .admin-toast-icon {
  color: #10b981;
}
.admin-toast-error .admin-toast-icon {
  color: #c8102e;
}
.admin-toast-icon svg {
  width: 100%;
  height: 100%;
}
.admin-toast-text {
  flex: 1;
  padding-top: 0.05rem;
}
.admin-toast-close {
  flex: none;
  color: var(--admin-text-muted);
  padding: 0.1rem;
  border-radius: 0.35rem;
}
.admin-toast-close:hover {
  color: var(--admin-text);
  background: var(--admin-surface-hover);
}
