/**
 * Dev Bhoomi Vivah - Custom Style Enhancements & Overrides
 * Ensures pixel-perfect parity with Lovable React design
 */

/* ==========================================================================
   Typography & Letter Spacing
   ========================================================================== */
.font-display {
  font-family: "Cormorant Garamond", Georgia, serif !important;
}

body, button, input, select, textarea {
  font-family: "Mulish", system-ui, -apple-system, sans-serif;
}

.tracking-\[0\.3em\], .tracking-custom-03 {
  letter-spacing: 0.3em !important;
}

.tracking-\[0\.35em\], .tracking-custom-035 {
  letter-spacing: 0.35em !important;
}

.text-\[10px\] {
  font-size: 10px !important;
  line-height: 1.2 !important;
}

.text-\[11px\] {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

/* ==========================================================================
   Color System & Fallbacks
   ========================================================================== */
:root {
  --radius: 0.75rem;
  --background: oklch(0.98 0.015 80);
  --foreground: oklch(0.25 0.06 20);
  --card: #ffffff;
  --card-foreground: #222222;
  --primary: oklch(0.42 0.16 20);
  --primary-foreground: oklch(0.98 0.02 85);
  --secondary: oklch(0.94 0.04 75);
  --secondary-foreground: oklch(0.3 0.08 25);
  --muted: oklch(0.95 0.02 75);
  --muted-foreground: oklch(0.48 0.04 30);
  --gold: oklch(0.78 0.13 85);
  --marigold: oklch(0.76 0.17 60);
  --rose: oklch(0.62 0.2 0);
  --maroon: oklch(0.3 0.11 20);
  --cream: oklch(0.97 0.03 85);
  --whatsapp: #25d366;
  --border: oklch(0.88 0.04 70);
  --ring: oklch(0.42 0.16 20);
}

.festive-gradient {
  background-image: linear-gradient(120deg, var(--maroon, #4a151b), var(--primary, #6b1e24) 45%, var(--rose, #9a2c38)) !important;
}

.gold-gradient {
  background-image: linear-gradient(90deg, var(--marigold, #e8971b), var(--gold, #d4af37)) !important;
}

.text-gold { color: var(--gold, #d4af37) !important; }
.text-marigold { color: var(--marigold, #e8971b) !important; }
.text-maroon { color: var(--maroon, #4a151b) !important; }
.text-cream { color: var(--cream, #faf5ea) !important; }
.text-primary { color: var(--primary, #6b1e24) !important; }
.text-primary-foreground { color: var(--primary-foreground, #faf5ea) !important; }
.bg-maroon { background-color: var(--maroon, #4a151b) !important; }
.bg-cream { background-color: var(--cream, #faf5ea) !important; }
.bg-gold { background-color: var(--gold, #d4af37) !important; }
.bg-whatsapp { background-color: var(--whatsapp, #25d366) !important; }

.-translate-x-1\/2 {
  transform: translateX(-50%) !important;
}

.-translate-y-1\/2 {
  transform: translateY(-50%) !important;
}

.slider-prev, .slider-next {
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* ==========================================================================
   Modal Dialog System (Backdrop & Content)
   ========================================================================== */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background-color: rgba(20, 10, 10, 0.65) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex !important;
}

.modal-content {
  background-color: var(--card, #ffffff);
  color: var(--card-foreground, #222222);
  border-radius: var(--radius-2xl, 1rem);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border, #e5e7eb);
  max-width: 38rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  animation: modalEnter 0.22s ease-out;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   Admin Form Controls & Inputs
   ========================================================================== */
.admin-input,
.crud-manager-container input[type="text"],
.crud-manager-container input[type="number"],
.crud-manager-container input[type="date"],
.crud-manager-container input[type="email"],
.crud-manager-container input[type="password"],
.crud-manager-container select,
.crud-manager-container textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
  background-color: var(--background, #ffffff);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.admin-input:focus,
.crud-manager-container input:focus,
.crud-manager-container select:focus,
.crud-manager-container textarea:focus {
  border-color: var(--primary, #6b1e24);
  box-shadow: 0 0 0 2px rgba(107, 30, 36, 0.2);
}

/* ==========================================================================
   Hero Slider Transitions
   ========================================================================== */
.hero-slider .slide {
  opacity: 0;
  transition: opacity 1000ms ease-in-out;
  pointer-events: none;
}

.hero-slider .slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slider .slide img {
  transition: transform 6000ms ease-out;
  transform: scale(1);
}

.hero-slider .slide.active img {
  transform: scale(1.1);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}

.toast {
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #e5e7eb;
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastEnter 0.25s ease-out;
}

.toast-success {
  border-left: 4px solid var(--marigold, #d97706);
}

.toast-error {
  border-left: 4px solid #ef4444;
}

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

/* ==========================================================================
   Admin Panel Layout & Sidebar
   ========================================================================== */
.admin-shell {
  display: flex !important;
  min-height: 100vh !important;
  width: 100% !important;
}

#admin-sidebar {
  width: 16rem !important; /* 256px */
  min-width: 16rem !important;
  max-width: 16rem !important;
  background-color: var(--maroon, #4a151b) !important;
  color: var(--cream, #faf5ea) !important;
  display: flex !important;
  flex-direction: column !important;
  flex-shrink: 0 !important;
  z-index: 50 !important;
  transition: transform 0.25s ease-in-out !important;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2) !important;
}

.admin-main-wrapper {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background-color: rgba(246, 236, 224, 0.35) !important;
  min-height: 100vh !important;
}

/* Screens >= 768px: Sidebar is persistently docked on the left */
@media (min-width: 768px) {
  #admin-sidebar {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    transform: none !important;
    left: 0 !important;
  }
  #admin-menu-toggle {
    display: none !important;
  }
  #admin-overlay {
    display: none !important;
  }
}

/* Screens < 768px: Mobile slide-in drawer */
@media (max-width: 767px) {
  #admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
  }
  #admin-sidebar.sidebar-open {
    transform: translateX(0) !important;
  }
  #admin-menu-toggle {
    display: inline-flex !important;
  }
}
