/* ==========================================================================
   Admin Dashboard - Dark Luxury Gold & Obsidian Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Cormorant+Garamond:ital,wght@0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  /* Dark Luxury Theme Tokens */
  --adm-bg: #0d0c0b;
  --adm-sidebar: #151311;
  --adm-surface: #1b1815;
  --adm-card: #211e1a;
  --adm-card-hover: #292520;
  --adm-border: #332d26;
  --adm-border-subtle: #24201b;

  --adm-gold: #d4af37;
  --adm-gold-light: #f3e5ab;
  --adm-gold-dark: #996515;
  --adm-gold-glow: rgba(212, 175, 55, 0.22);
  --adm-gold-dim: rgba(212, 175, 55, 0.1);

  --adm-text-bright: #ffffff;
  --adm-text-main: #e8e2d9;
  --adm-text-muted: #948b7f;
  --adm-text-dark: #5c554b;

  --adm-danger: #ef4444;
  --adm-danger-bg: rgba(239, 68, 68, 0.12);
  --adm-success: #10b981;
  --adm-success-bg: rgba(16, 185, 129, 0.12);

  --adm-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --adm-font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;

  --adm-radius-sm: 8px;
  --adm-radius-md: 14px;
  --adm-radius-lg: 20px;
  --adm-radius-full: 9999px;

  --adm-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--adm-bg) !important;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(183, 110, 121, 0.04) 0%, transparent 45%),
    linear-gradient(180deg, #0d0c0b 0%, #12100e 100%) !important;
  color: var(--adm-text-main);
  font-family: var(--adm-font-sans);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Layout Wrapper */
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.admin-sidebar {
  width: 280px;
  flex: 0 0 280px;
  background: var(--adm-sidebar);
  border-right: 1px solid var(--adm-border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.admin-sidebar::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: var(--adm-border);
  border-radius: 4px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 6px 12px 6px;
  border-bottom: 1px solid var(--adm-border-subtle);
}

.admin-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--adm-gold), var(--adm-gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #0e0d0c;
  box-shadow: 0 4px 16px var(--adm-gold-glow);
}

.admin-brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--adm-text-bright);
  letter-spacing: 0.3px;
}

.admin-brand-text .admin-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--adm-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.admin-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Nav Menu */
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--adm-radius-md);
  color: var(--adm-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: var(--adm-transition);
}

.admin-nav-item i {
  font-size: 1.15rem;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--adm-text-muted);
  transition: var(--adm-transition);
}

.admin-nav-item:hover {
  background: var(--adm-card);
  color: var(--adm-text-bright);
  border-color: var(--adm-border);
}

.admin-nav-item:hover i {
  color: var(--adm-gold);
}

.admin-nav-item.active {
  background: var(--adm-gold-dim);
  color: var(--adm-gold-light);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 4px 16px var(--adm-gold-glow);
}

.admin-nav-item.active i {
  color: var(--adm-gold);
}

/* Sidebar Footer Actions */
.sidebar-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--adm-border-subtle);
}

.sidebar-btn-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--adm-radius-sm);
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  color: var(--adm-text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--adm-transition);
}

.sidebar-btn-link:hover {
  background: var(--adm-card-hover);
  border-color: var(--adm-gold);
  color: var(--adm-gold-light);
  transform: translateY(-1px);
}

.sidebar-btn-logout {
  background: var(--adm-danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--adm-danger);
}

.sidebar-btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--adm-danger);
  color: #ff6b6b;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.admin-main {
  flex: 1;
  min-width: 0;
  padding: 36px 44px;
  overflow-y: auto;
  max-width: 1300px;
}

.admin-tab-section {
  animation: fadeInTab 0.3s ease-out;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header Banner */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-header-title h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--adm-text-bright);
  letter-spacing: -0.5px;
}

.admin-header-title p {
  color: var(--adm-text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* Buttons */
.btn-gold {
  background: linear-gradient(135deg, #d4af37 0%, #b89028 100%);
  color: #0e0d0c;
  border: none;
  padding: 12px 24px;
  border-radius: var(--adm-radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--adm-gold-glow);
  transition: var(--adm-transition);
  text-decoration: none;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #dfbc45 0%, #c49a2e 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--adm-text-bright);
  border: 1px solid var(--adm-border);
  padding: 10px 20px;
  border-radius: var(--adm-radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--adm-transition);
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--adm-card);
  border-color: var(--adm-gold);
  color: var(--adm-gold-light);
  transform: translateY(-1px);
}

/* ==========================================================================
   Statistics Cards Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: var(--adm-transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--adm-gold), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--adm-gold-dim);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--adm-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.stat-info .stat-num {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--adm-text-bright);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-info .stat-title {
  font-size: 0.8rem;
  color: var(--adm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-top: 4px;
}

/* ==========================================================================
   Section Card Boxes
   ========================================================================== */
.admin-card-box {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.admin-card-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--adm-gold-light);
  border-bottom: 1px solid var(--adm-border-subtle);
  padding-bottom: 14px;
}

.admin-card-box h3 i {
  color: var(--adm-gold);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--adm-text-muted);
  letter-spacing: 0.2px;
}

.form-control {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  padding: 12px 16px;
  color: var(--adm-text-bright);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--adm-transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--adm-gold);
  box-shadow: 0 0 0 3px var(--adm-gold-glow);
  background: #141210;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

/* ==========================================================================
   Frame Management Grid
   ========================================================================== */
.frame-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.frame-manage-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--adm-transition);
}

.frame-manage-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

.frame-preview-img {
  width: 100%;
  aspect-ratio: 4/5;
  background: #0d0c0b;
  border-radius: var(--adm-radius-sm);
  object-fit: contain;
  border: 1px solid var(--adm-border-subtle);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--adm-border);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--adm-gold);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Photo Moderation Gallery Grid
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-md);
  overflow: hidden;
  position: relative;
  transition: var(--adm-transition);
}

.gallery-card:hover {
  transform: translateY(-3px);
  border-color: var(--adm-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}

.gallery-card-meta {
  padding: 12px 14px;
  font-size: 0.85rem;
}

/* ==========================================================================
   Login Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--adm-border);
    padding: 20px;
  }

  .admin-main {
    padding: 24px 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}
