/* ═══════════════════════════════════════════════════════════════
   ADMIN SANCTUM — Cinematic dark fantasy admin panel
   Style inspired by card-game setup screen: tavern background,
   corner ornaments, hero title with flourish, ember particles.
   ═══════════════════════════════════════════════════════════════ */

.admin-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  font-family: 'Crimson Text', serif;
  color: #e8d5a3;
  /* Break out of .menu-content padding (24px 36px 0) so background fills full width */
  margin: -24px -36px 0;
  width: calc(100% + 72px);
}

@media (max-width: 768px) {
  .admin-stage {
    margin: -11px -8px 0;
    width: calc(100% + 16px);
  }
}

/* Background image (kingdom-night for dark mystic vibe) */
.admin-bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/kingdom-night.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.28) saturate(0.8);
  animation: adminBgPan 60s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes adminBgPan {
  0%   { transform: scale(1.05) translate(0, 0); }
  100% { transform: scale(1.12) translate(-20px, -15px); }
}

/* Vignette overlay */
.admin-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(5, 3, 2, 0.75) 90%),
    linear-gradient(180deg, rgba(10, 6, 2, 0.5) 0%, transparent 40%, rgba(10, 6, 2, 0.6) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Ember particles floating up */
.admin-embers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.admin-ember {
  position: absolute;
  bottom: -20px;
  left: var(--ad-x, 50vw);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 100, 0.9) 0%, rgba(212, 140, 60, 0.6) 40%, transparent 100%);
  box-shadow: 0 0 8px rgba(255, 180, 80, 0.6);
  animation: adminEmberRise 16s linear infinite;
  animation-delay: var(--ad-delay, 0s);
}
@keyframes adminEmberRise {
  0%   { bottom: -20px; opacity: 0; transform: translateX(0) scale(0.6); }
  10%  { opacity: 0.9; }
  50%  { transform: translateX(calc(var(--ad-x, 0) * 0.1)) scale(1); }
  90%  { opacity: 0.7; }
  100% { bottom: 105vh; opacity: 0; transform: translateX(-40px) scale(0.3); }
}

/* Back button (absolute top-left) */
.admin-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 20;
  padding: 10px 20px;
  background: rgba(20, 12, 6, 0.7);
  border: 1px solid rgba(212, 165, 69, 0.5);
  color: #e8d5a3;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  letter-spacing: 2px;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.25s;
}
.admin-back-btn:hover {
  background: rgba(50, 30, 14, 0.85);
  border-color: #d4a545;
  color: #fff5d8;
  transform: translateX(-3px);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.7), 0 0 14px rgba(212, 165, 69, 0.3);
}

/* Inner container */
.admin-page-inner {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 40px 50px;
}

/* ─── HERO TITLE ─── */
.admin-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 6px;
}

.admin-hero-title {
  font-family: 'Cinzel', 'Crimson Text', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: #ffd700;
  letter-spacing: clamp(3px, 1vw, 8px);
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 1),
    0 0 22px rgba(212, 165, 69, 0.55),
    0 0 50px rgba(212, 165, 69, 0.3);
  margin: 0;
  animation: adminTitleGlow 4s ease-in-out infinite;
  text-align: center;
}
@keyframes adminTitleGlow {
  0%, 100% { text-shadow: 0 2px 8px rgba(0,0,0,1), 0 0 22px rgba(212, 165, 69, 0.55), 0 0 50px rgba(212, 165, 69, 0.3); }
  50%      { text-shadow: 0 2px 8px rgba(0,0,0,1), 0 0 34px rgba(255, 210, 100, 0.85), 0 0 80px rgba(255, 210, 100, 0.5); }
}

/* Flourish lines + diamond accent */
.admin-hero-flourish {
  flex: 1;
  max-width: 180px;
  height: 2px;
  background: linear-gradient(to var(--dir, right),
    transparent 0%,
    rgba(212, 165, 69, 0.6) 30%,
    #d4a545 100%);
  position: relative;
}
.admin-hero-flourish--left { --dir: left; }
.admin-hero-flourish--right { --dir: right; }
.admin-hero-flourish::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #d4a545;
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 0 12px rgba(212, 165, 69, 0.65);
}
.admin-hero-flourish--left::before { right: -3px; }
.admin-hero-flourish--right::before { left: -3px; }

.admin-hero-subtitle {
  text-align: center;
  color: #b8a67a;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 3px;
  margin-bottom: 40px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

/* ─── GRID LAYOUT ─── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

/* ─── ADMIN CARDS ─── */
.admin-card {
  position: relative;
  padding: 26px 28px 22px;
  background: linear-gradient(180deg, rgba(30, 20, 10, 0.93) 0%, rgba(14, 8, 4, 0.97) 100%);
  border: 1.5px solid rgba(212, 165, 69, 0.35);
  border-radius: 10px;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.75),
    0 0 20px rgba(212, 165, 69, 0.08),
    inset 0 1px 0 rgba(255, 210, 100, 0.08);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
}
.admin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 165, 69, 0.6);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.85),
    0 0 28px rgba(212, 165, 69, 0.2),
    inset 0 1px 0 rgba(255, 210, 100, 0.12);
}

/* Corner ornaments (top-left + bottom-right) */
.admin-card::before,
.admin-card::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(212, 165, 69, 0.65);
  transition: border-color 0.3s;
}
.admin-card::before {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
}
.admin-card::after {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
}
.admin-card:hover::before,
.admin-card:hover::after {
  border-color: #d4a545;
}

/* Tone variants (via left border accent) */
.admin-card--gold    { border-left: 4px solid #d4a545; }
.admin-card--danger  { border-left: 4px solid #c04848; }
.admin-card--info    { border-left: 4px solid #6b9ddb; }
.admin-card--maint   { border-left: 4px solid #e58c3a; }

/* Card icon (PNG, 44px, drop shadow) */
.admin-card-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(60, 42, 18, 0.8) 0%, rgba(20, 12, 6, 0.4) 70%, transparent 100%);
  border-radius: 50%;
}
.admin-card-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(212, 165, 69, 0.4));
}

/* Card title */
.admin-card-title {
  font-family: 'Cinzel', 'Crimson Text', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 2px;
  margin: 0 0 10px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
}

/* Card description */
.admin-card-desc {
  color: #c8b896;
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

/* Plan B notice (inside maintenance card) */
.admin-plan-b {
  padding: 8px 12px;
  background: rgba(180, 60, 60, 0.12);
  border-left: 3px solid #c04848;
  color: #ffb6a0;
  font-size: 0.82rem;
  border-radius: 4px;
  margin-bottom: 14px;
}
.admin-plan-b code {
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 3px;
  color: #ffd84a;
  font-size: 0.8rem;
}

/* ─── INPUTS ─── */
.admin-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-input,
.admin-datetime,
.admin-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(212, 165, 69, 0.3);
  border-radius: 5px;
  color: #e8d5a3;
  font-family: 'Crimson Text', serif;
  font-size: 0.96rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.admin-input::placeholder,
.admin-textarea::placeholder { color: #6a5a3a; font-style: italic; }

.admin-input:focus,
.admin-datetime:focus,
.admin-textarea:focus {
  outline: none;
  border-color: #d4a545;
  background: rgba(15, 8, 3, 0.75);
  box-shadow: 0 0 0 3px rgba(212, 165, 69, 0.12), 0 0 12px rgba(212, 165, 69, 0.25);
}

.admin-textarea {
  resize: vertical;
  min-height: 70px;
  font-family: 'Crimson Text', serif;
}
.admin-textarea--small { min-height: 50px; margin-bottom: 8px; }

/* Label */
.admin-label {
  display: block;
  color: #b8a67a;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 5px;
  margin-top: 10px;
}

/* Datetime row (2 cols) */
.admin-datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-field { display: flex; flex-direction: column; }

/* ─── MAINTENANCE STATUS ─── */
.admin-maint-status {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.45);
  border-left: 3px solid #d4a545;
  color: #e8d5a3;
  font-size: 0.95rem;
  margin-bottom: 14px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* ─── BUTTONS ─── */
.admin-btn {
  padding: 11px 22px;
  border: none;
  border-radius: 6px;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Shimmer glint on hover */
.admin-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transition: left 0.6s;
}
.admin-btn:hover::after { left: 100%; }

/* Gold button (primary/save) */
.admin-btn--gold {
  background: linear-gradient(180deg, #b88722 0%, #7a5312 100%);
  border: 1px solid #d4a545;
  color: #fff5d8;
}
.admin-btn--gold:hover {
  background: linear-gradient(180deg, #d4a34a 0%, #8e6218 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), 0 0 18px rgba(255, 200, 100, 0.45);
}

/* Danger button (red, destructive) */
.admin-btn--danger {
  background: linear-gradient(180deg, #a83232 0%, #6a1818 100%);
  border: 1px solid #c04848;
  color: #ffe0d4;
}
.admin-btn--danger:hover {
  background: linear-gradient(180deg, #d04545 0%, #8a2525 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), 0 0 18px rgba(220, 60, 60, 0.55);
}

/* Info button (blue, neutral) */
.admin-btn--info {
  background: linear-gradient(180deg, #3e6ba3 0%, #223e60 100%);
  border: 1px solid #6b9ddb;
  color: #e0eeff;
}
.admin-btn--info:hover {
  background: linear-gradient(180deg, #5a8ac8 0%, #2e5280 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), 0 0 18px rgba(107, 157, 219, 0.5);
}

/* Success button (green, reopen) */
.admin-btn--success {
  background: linear-gradient(180deg, #3b8d52 0%, #1e5230 100%);
  border: 1px solid #5cc878;
  color: #dffce4;
}
.admin-btn--success:hover {
  background: linear-gradient(180deg, #52b574 0%, #2e7043 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), 0 0 18px rgba(92, 200, 120, 0.5);
}

.admin-btn:active { transform: translateY(0); }

/* Button row (maintenance card) */
.admin-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Status message */
.admin-status {
  margin-top: 10px;
  min-height: 20px;
}
.admin-status p {
  margin: 0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  animation: adminStatusSlide 0.4s ease;
}
@keyframes adminStatusSlide {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .admin-page-inner { padding: 60px 18px 30px; }
  .admin-hero { gap: 12px; }
  .admin-hero-flourish { max-width: 60px; }
  .admin-hero-title { font-size: 1.7rem; letter-spacing: 3px; }
  .admin-hero-subtitle { font-size: 0.88rem; letter-spacing: 2px; margin-bottom: 24px; }
  .admin-grid { grid-template-columns: 1fr; gap: 16px; }
  .admin-card { padding: 20px 18px; }
  .admin-card-title { font-size: 1.15rem; }
  .admin-datetime-row { grid-template-columns: 1fr; gap: 8px; }
  .admin-btn-row { flex-direction: column; }
  .admin-btn-row .admin-btn { width: 100%; }
}

@media (max-width: 500px) {
  .admin-back-btn { top: 12px; left: 12px; padding: 8px 14px; font-size: 0.85rem; }
  .admin-hero-title { font-size: 1.4rem; }
  .admin-card-title { font-size: 1.05rem; }
}
