/* ============================================
   THE MIDNIGHT PANCHAYAT - Premium Animations
   ============================================ */

/* ===== LOADING SCREEN ===== */
#loader {
  position: fixed;
  inset: 0;
  background: #0d0b08;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-moon {
  font-size: 64px;
  animation: moonPulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(212,160,23,0.8));
}
@keyframes moonPulse {
  0%, 100% { transform: scale(1) rotate(-5deg); filter: drop-shadow(0 0 20px rgba(212,160,23,0.6)); }
  50% { transform: scale(1.15) rotate(5deg); filter: drop-shadow(0 0 40px rgba(212,160,23,1)); }
}

.loader-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: #d4a017;
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: fadeIn 0.8s ease 0.3s both;
}

.loader-sub {
  font-family: 'Dancing Script', cursive;
  font-size: 18px;
  color: #b8a88a;
  animation: fadeIn 0.8s ease 0.5s both;
}

.loader-bar-wrap {
  width: 200px;
  height: 2px;
  background: rgba(212,160,23,0.2);
  border-radius: 2px;
  overflow: hidden;
  animation: fadeIn 0.8s ease 0.7s both;
}
.loader-bar {
  height: 100%;
  background: linear-gradient(to right, #d4a017, #f0c040, #d4a017);
  border-radius: 2px;
  animation: loadBar 1.8s cubic-bezier(0.4,0,0.2,1) 0.7s both;
}
@keyframes loadBar { from { width: 0%; } to { width: 100%; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== CUSTOM CURSOR ===== */
.cursor-glow {
  position: fixed;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,160,23,0.6), transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.05s, width 0.2s, height 0.2s;
  mix-blend-mode: screen;
}
.cursor-dot {
  position: fixed;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #d4a017;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.02s;
  box-shadow: 0 0 10px 4px rgba(212,160,23,0.5);
}
body:hover .cursor-glow { width: 40px; height: 40px; }

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ===== HERO ANIMATIONS ===== */
.hero-content { position: relative; z-index: 2; }

.hero-title-wrap {
  overflow: hidden;
}

.char {
  display: inline-block;
  animation: charIn 0.6s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes charIn {
  from { opacity: 0; transform: translateY(100%) rotateX(-90deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* Glowing text shimmer */
.shimmer-text {
  background: linear-gradient(120deg, #d4a017 0%, #f0c040 30%, #d4a017 60%, #ffdc6a 80%, #d4a017 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 3s linear infinite;
}
@keyframes textShimmer { to { background-position: 200% center; } }

/* ===== 3D CARD HOVER ===== */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1), box-shadow 0.4s ease;
  will-change: transform;
}
.card-3d:hover {
  box-shadow: 0 25px 50px rgba(0,0,0,0.6), 0 0 30px rgba(212,160,23,0.15);
}
.card-3d-inner {
  transform: translateZ(20px);
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1);
}

/* ===== STAGGERED ENTRANCE ===== */
.stagger-item {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.stagger-item.visible { opacity: 1; transform: translateY(0); }

/* ===== MAGNETIC BUTTON ===== */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.23,1,0.32,1);
  will-change: transform;
}

/* ===== SCROLL PROGRESS BAR ===== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(to right, #d4a017, #f0c040);
  z-index: 10001;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(212,160,23,0.6);
}

/* ===== HERO FLOATING ELEMENTS ===== */
.float-1 { animation: float1 6s ease-in-out infinite; }
.float-2 { animation: float2 8s ease-in-out infinite 1s; }
.float-3 { animation: float3 7s ease-in-out infinite 2s; }

@keyframes float1 {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes float2 {
  0%, 100% { transform: translateY(0) rotate(5deg); }
  50% { transform: translateY(-15px) rotate(-5deg); }
}
@keyframes float3 {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-25px) scale(1.05); }
}

/* ===== NUMBER COUNTER ANIMATION ===== */
.counter-num {
  display: inline-block;
  transition: all 0.1s;
}

/* ===== GLOWING BORDER ===== */
.glow-border {
  position: relative;
}
.glow-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #d4a017, transparent, #d4a017, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderRotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}
.glow-border:hover::before { opacity: 1; }
@keyframes borderRotate { to { filter: hue-rotate(360deg); } }

/* ===== WAVE SECTION DIVIDER ===== */
.wave-divider {
  position: relative;
  height: 60px;
  overflow: hidden;
}
.wave-divider svg {
  position: absolute;
  bottom: 0;
  width: 100%;
}

/* ===== MENU CARD SPARKLE ===== */
.menu-item-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(212,160,23,0.15), transparent 70%);
  border-radius: 0 var(--radius) 0 100%;
  opacity: 0;
  transition: opacity 0.3s;
}
.menu-item-card:hover::after { opacity: 1; }

/* ===== TYPEWRITER CURSOR ===== */
.typewriter::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: #d4a017;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ===== SMOOTH PAGE TRANSITION ===== */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: #0d0b08;
  z-index: 99998;
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s cubic-bezier(0.76,0,0.24,1);
}
.page-transition-overlay.active {
  transform: scaleY(1);
  transform-origin: top;
}

/* ===== HERO BG ANIMATION ===== */
.animated-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 10s ease-in-out infinite;
}
.bg-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(212,160,23,0.08) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.bg-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(107,124,69,0.08) 0%, transparent 70%);
  top: 50%; right: -100px;
  animation-delay: 3s;
}
.bg-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(212,160,23,0.06) 0%, transparent 70%);
  bottom: -50px; left: 30%;
  animation-delay: 6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ===== GOLDEN SPARKLES ===== */
.sparkle {
  position: absolute;
  pointer-events: none;
  animation: sparkleAnim 1s ease-out forwards;
}
@keyframes sparkleAnim {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  100% { transform: scale(1.5) rotate(180deg); opacity: 0; }
}

/* ===== REVEAL ANIMATION VARIANTS ===== */
.reveal-left {
  opacity: 0; transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal-right {
  opacity: 0; transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal-scale {
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.reveal-left.visible, .reveal-right.visible, .reveal-scale.visible {
  opacity: 1; transform: none;
}

/* ===== NEON GLOW ON GOLD ===== */
.neon-gold {
  text-shadow:
    0 0 10px rgba(212,160,23,0.5),
    0 0 20px rgba(212,160,23,0.3),
    0 0 40px rgba(212,160,23,0.2);
}

/* ===== STAT COUNTER CARD ===== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--gold-dark), var(--gold), var(--gold-dark));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}
.stat-card:hover::before { transform: scaleX(1); }
.stat-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(212,160,23,0.1); }
.stat-number { font-size: 48px; font-weight: 900; color: var(--gold); font-family: 'Playfair Display', serif; display: block; }
.stat-label { font-size: 14px; color: var(--cream-muted); margin-top: 8px; }

/* ===== TILT CARD ===== */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ===== ADMIN SIDEBAR ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: #0a0806;
}
.admin-sidebar {
  background: #100e0a;
  border-right: 1px solid rgba(212,160,23,0.15);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-logo {
  padding: 28px 24px;
  border-bottom: 1px solid rgba(212,160,23,0.1);
}
.admin-logo h2 { font-family: 'Playfair Display', serif; font-size: 18px; color: #d4a017; }
.admin-logo span { font-family: 'Dancing Script', cursive; font-size: 14px; color: #b8a88a; }
.admin-nav { padding: 16px 12px; flex: 1; }
.admin-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  color: #b8a88a; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; margin-bottom: 4px;
  text-decoration: none;
}
.admin-nav-item:hover { background: rgba(212,160,23,0.1); color: #f5e6c8; }
.admin-nav-item.active { background: rgba(212,160,23,0.15); color: #d4a017; border-left: 3px solid #d4a017; }
.admin-nav-icon { font-size: 18px; width: 24px; text-align: center; }
.admin-main { padding: 32px; background: #0d0b08; overflow-y: auto; }
.admin-header { margin-bottom: 32px; }
.admin-header h1 { font-family: 'Playfair Display', serif; font-size: 28px; color: #f5e6c8; margin-bottom: 4px; }
.admin-header p { color: #b8a88a; font-size: 14px; }

/* Admin Cards */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.admin-stat { background: #1a1510; border: 1px solid rgba(212,160,23,0.15); border-radius: 12px; padding: 24px; }
.admin-stat-number { font-size: 36px; font-weight: 700; color: #d4a017; font-family: 'Playfair Display', serif; }
.admin-stat-label { font-size: 13px; color: #b8a88a; margin-top: 4px; }
.admin-stat-icon { font-size: 28px; margin-bottom: 12px; }

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #b8a88a; border-bottom: 1px solid rgba(212,160,23,0.15); }
.admin-table td { padding: 14px 16px; font-size: 14px; color: #f5e6c8; border-bottom: 1px solid rgba(212,160,23,0.08); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(212,160,23,0.04); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 50px; font-size: 12px; font-weight: 600; }
.badge-green { background: rgba(107,124,69,0.2); color: #8a9e5a; border: 1px solid rgba(107,124,69,0.3); }
.badge-yellow { background: rgba(212,160,23,0.15); color: #d4a017; border: 1px solid rgba(212,160,23,0.3); }
.badge-red { background: rgba(192,57,43,0.15); color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }

.admin-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.admin-btn-gold { background: #d4a017; color: #0d0b08; }
.admin-btn-gold:hover { background: #f0c040; }
.admin-btn-danger { background: rgba(192,57,43,0.2); color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }
.admin-btn-danger:hover { background: rgba(192,57,43,0.4); }
.admin-btn-outline { background: transparent; color: #b8a88a; border: 1px solid rgba(212,160,23,0.2); }
.admin-btn-outline:hover { border-color: #d4a017; color: #d4a017; }

.admin-card { background: #1a1510; border: 1px solid rgba(212,160,23,0.12); border-radius: 14px; padding: 24px; margin-bottom: 24px; }
.admin-card h3 { font-family: 'Playfair Display', serif; font-size: 18px; color: #f5e6c8; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(212,160,23,0.1); }

/* Admin Login */
.admin-login { min-height: 100vh; background: #0a0806; display: flex; align-items: center; justify-content: center; }
.login-box { width: 420px; background: #1a1510; border: 1px solid rgba(212,160,23,0.2); border-radius: 20px; padding: 48px; text-align: center; box-shadow: 0 40px 80px rgba(0,0,0,0.6); }
.login-icon { font-size: 64px; margin-bottom: 16px; animation: moonPulse 2s ease-in-out infinite; }
.login-box h2 { font-family: 'Playfair Display', serif; font-size: 24px; color: #d4a017; margin-bottom: 4px; }
.login-box p { color: #b8a88a; font-size: 14px; margin-bottom: 32px; }
.login-input { width: 100%; padding: 14px 18px; background: #0d0b08; border: 1px solid rgba(212,160,23,0.2); border-radius: 10px; color: #f5e6c8; font-family: 'Poppins', sans-serif; font-size: 15px; margin-bottom: 16px; text-align: center; letter-spacing: 4px; transition: all 0.3s; }
.login-input:focus { outline: none; border-color: #d4a017; box-shadow: 0 0 0 3px rgba(212,160,23,0.2); }
.login-btn { width: 100%; padding: 14px; background: #d4a017; color: #0d0b08; border: none; border-radius: 10px; font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.3s; }
.login-btn:hover { background: #f0c040; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(212,160,23,0.3); }

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; border-right: none; border-bottom: 1px solid rgba(212,160,23,0.15); }
  .admin-main { padding: 16px; }
  .admin-card { padding: 16px; border-radius: 12px; }
  .admin-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .admin-table th, .admin-table td {
    padding: 10px 12px;
  }
}
/* =======================================================
   PREMIUM EDITORIAL MOTION SYSTEM (ABOUT & CONTACT)
   Direction: Editorial, warm, tactile, smooth, fast-feeling
   ======================================================= */

/* Intro reveal container */
.motion-page-intro {
  opacity: 0;
  transform: translateY(20px);
  animation: motionIntroReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes motionIntroReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger delay classes */
.motion-delay-1 { animation-delay: 0.1s; }
.motion-delay-2 { animation-delay: 0.2s; }
.motion-delay-3 { animation-delay: 0.35s; }

/* Editorial Image Reveal: subtle scale 0.98 -> 1 + opacity */
.motion-image-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.98) translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease;
  will-change: transform, opacity;
}

.motion-image-card.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.motion-image-card:hover {
  transform: scale(1.015) translateY(-3px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 20px rgba(212, 160, 23, 0.15);
}

.motion-image-card img {
  width: 100%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.motion-image-card:hover img {
  transform: scale(1.02);
}

/* Content cards / chips entrance */
.motion-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  will-change: transform, opacity;
}

.motion-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.motion-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(212, 160, 23, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 160, 23, 0.1);
}

/* Timeline items staggered reveal */
.motion-timeline-item {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.motion-timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Form input focus transitions */
.form-control {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.form-control:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.2) !important;
  background-color: #1a140d !important;
}

/* Tactile button press feedback */
.btn {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.25s ease !important;
}

.btn:active {
  transform: scale(0.97) translateY(1px) !important;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .motion-page-intro,
  .motion-image-card,
  .motion-card,
  .motion-timeline-item {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile optimizations: smaller distances */
@media (max-width: 600px) {
  .motion-image-card {
    transform: scale(0.99) translateY(10px);
  }
  .motion-card {
    transform: translateY(12px);
  }
  .motion-timeline-item {
    transform: translateX(-10px);
  }
  .motion-card:hover,
  .motion-image-card:hover {
    transform: none; /* avoid hover jank on touch */
  }
}
