/* Custom Luxury Styling for Royal Events Center (REC) - White & Navy Blue Theme */

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

:root {
  --primary-navy: #0B192C;
  --primary-navy-dark: #070F1B;
  --primary-navy-light: #1E2E45;
  --accent-gold: #D4AF37;
  --bg-pure-white: #FFFFFF;
  --bg-off-white: #F8FAFC;
  --text-dark: #0A1128;
  --text-body: #334155;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
}

/* =====================================================
   GLOBAL OVERFLOW FIX — Prevents horizontal scrolling
   ===================================================== */
html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-body);
  background-color: var(--bg-off-white);
  overflow-x: hidden;
  scroll-behavior: smooth;
  max-width: 100%;
  width: 100%;
}

/* All sections and containers must not exceed viewport width */
section, header, footer, div, nav {
  max-width: 100%;
}

/* Grid children must have min-width:0 to allow shrinking */
.grid > * {
  min-width: 0;
}

/* All text elements wrap properly */
p, h1, h2, h3, h4, h5, h6, span, a, li {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Images never exceed their container */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Flex children also need min-width constraint */
.flex > * {
  min-width: 0;
}

h1, h2, h3, h4 {
  font-family: 'Cinzel', 'Playfair Display', serif;
  color: var(--text-dark);
}

.font-serif-luxury {
  font-family: 'Cinzel', 'Playfair Display', serif;
}

/* Metallic Gold & Navy Accent Text */
.text-navy-gradient {
  color: var(--primary-navy);
}

.text-gold-accent {
  color: var(--accent-gold);
}

.bg-navy-primary {
  background-color: var(--primary-navy);
}

.bg-navy-primary:hover {
  background-color: var(--primary-navy-dark);
}

.bg-gold-accent {
  background-color: var(--accent-gold);
}

/* Glassmorphism Navigation & Cards */
.glass-nav-white {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(11, 25, 44, 0.05);
}

.glass-card-white {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 30px -5px rgba(11, 25, 44, 0.06), 0 4px 6px -2px rgba(11, 25, 44, 0.03);
}

.glass-card-white:hover {
  border-color: var(--primary-navy);
  box-shadow: 0 20px 35px -10px rgba(11, 25, 44, 0.12);
}

.glass-card-navy {
  background: var(--primary-navy);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Smooth Lift Effects */
.hover-lift {
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hover-lift:hover {
  transform: translateY(-6px);
}

/* Accordion Single Expansion Rules */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.accordion-item.active .accordion-content,
.accordion-content.active {
  max-height: 800px;
  opacity: 1 !important;
  visibility: visible !important;
}

.accordion-item.active .fa-chevron-down,
.accordion-item.active .accordion-chevron,
.accordion-item.active .accordion-icon i {
  transform: rotate(180deg);
}

.fa-chevron-down, .accordion-chevron, .accordion-icon {
  transition: transform 0.3s ease;
}

/* Masonry Layout */
.masonry-grid {
  column-count: 1;
  column-gap: 1.5rem;
}

@media (min-width: 640px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .masonry-grid {
    column-count: 3;
  }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

/* Floating WhatsApp Pulsing */
@keyframes pulse-whatsapp {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-float-btn {
  animation: pulse-whatsapp 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: var(--primary-navy);
  border-radius: 5px;
  border: 2px solid #F1F5F9;
}
::-webkit-scrollbar-thumb:hover {
  background: #1E2E45;
}

/* =====================================================
   RESPONSIVE DESIGN — MOBILE & TABLET COMPATIBILITY
   ===================================================== */

/* --- Base Utility --- */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* =====================================================
   CRITICAL: OVERFLOW PREVENTION (Mobile/Tablet)
   All containers clamp to viewport width
   ===================================================== */
@media (max-width: 1023px) {
  /* Every section is clamped */
  section, header, footer, main, article, aside {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* All grid and flex containers shrink properly */
  .grid, .flex {
    max-width: 100%;
  }

  /* Container max-width clamping without forced duplicate padding on nested wrappers */
  .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl, .max-w-xl {
    max-width: 100% !important;
  }

  /* Ensure top-level containers have uniform horizontal padding on mobile without duplicating on inner wrappers */
  header > div,
  section > div,
  footer > div {
    box-sizing: border-box;
  }

  /* Prevent any element from being wider than screen */
  [class*="col-span"] {
    max-width: 100%;
    min-width: 0;
  }

  /* Hero section specific fix */
  .min-h-\[90vh\] .grid {
    grid-template-columns: 1fr !important;
  }

  /* All images in hero are full width */
  .h-\[450px\] {
    height: 240px !important;
    width: 100% !important;
  }

  /* CTA button rows wrap on small screens */
  .flex.flex-wrap.items-center.gap-4,
  .flex.flex-col.sm\:flex-row {
    width: 100%;
  }

  /* Phone numbers row wraps */
  .flex.flex-wrap.items-center.gap-3 {
    flex-wrap: wrap;
  }

  /* Prevent any child from being wider than its parent */
  * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* But restore specific elements that need auto widths */
  img {
    height: auto;
  }

  /* Inline flex/grid items */
  i, svg, span.fa-solid, span.fa-brands, span.fa-regular {
    max-width: none !important;
  }
}

/* --- Navigation & Header --- */
@media (max-width: 767px) {
  /* Logo sizing on mobile */
  header img[alt*="Logo"] {
    height: 2.75rem !important;
  }

  /* Ensure mobile menu drawer is full width */
  #mobile-menu {
    width: 100%;
  }

  /* Prevent horizontal overflow from long text in nav */
  #mobile-menu a {
    word-break: break-word;
  }

  /* Sticky bottom bar - make buttons large enough for touch */
  .md\:hidden.fixed.bottom-0 a,
  .md\:hidden.fixed.bottom-0 button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- Hero Section (index.html) --- */
@media (max-width: 767px) {
  /* Stack hero columns vertically */
  .lg\:col-span-6 {
    grid-column: span 12 / span 12;
  }

  /* Hero headline - reduce size */
  h1.text-4xl.sm\:text-6xl.lg\:text-7xl {
    font-size: 2rem;
    line-height: 1.2;
  }

  /* Hero image - reduce height on mobile */
  .h-\[450px\].sm\:h-\[520px\] {
    height: 260px !important;
  }

  /* Phone numbers row - stack vertically */
  .flex.items-center.gap-6.pt-6.border-t {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Hero CTA buttons - full width & perfect alignment on mobile */
  .flex.flex-wrap.items-center.gap-4.mb-10 a,
  .flex.flex-col.sm\:flex-row a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* --- Feature Pillars Bar --- */
@media (max-width: 639px) {
  /* 2-column grid on smallest screens */
  .grid.grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* --- Service Cards Grid --- */
@media (max-width: 639px) {
  /* Single column on mobile */
  .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4,
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: 1fr;
  }

  /* Service card images - standard height on mobile */
  .relative.h-56 {
    height: 10rem !important;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  /* 2-column on tablet for 4-col grids */
  .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 2-column on tablet for 3-col grids */
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Statistics Counter Section --- */
@media (max-width: 639px) {
  .grid.grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .grid.grid-cols-2.lg\:grid-cols-4 > div {
    padding: 1rem;
  }

  .grid.grid-cols-2.lg\:grid-cols-4 .text-3xl {
    font-size: 1.75rem;
  }
}

/* --- CTA Banner (dark navy section) --- */
@media (max-width: 767px) {
  .py-16.bg-\[\#0B192C\] .flex.items-center.gap-6 {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .py-16.bg-\[\#0B192C\] h2 {
    font-size: 1.25rem !important;
    text-align: center;
  }

  .py-16.bg-\[\#0B192C\] p {
    text-align: center;
  }
}

/* --- Services Page (8 Category Cards) --- */
@media (max-width: 639px) {
  /* Category card images */
  .bg-white.rounded-3xl .relative.h-56 {
    height: 9rem;
  }

  /* Search bar on mobile */
  .max-w-2xl.mx-auto.relative form {
    border-radius: 1rem;
  }

  .max-w-2xl.mx-auto.relative input[type="text"] {
    font-size: 0.8rem;
    padding-right: 5rem;
  }

  .max-w-2xl.mx-auto.relative button[type="submit"] {
    font-size: 0.65rem;
    padding: 0.5rem 0.75rem;
  }
}

/* --- Service Category Page --- */
@media (max-width: 767px) {
  /* Category nav bar - horizontal scroll */
  #catSwitchBar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  #catSwitchBar::-webkit-scrollbar {
    display: none;
  }

  /* Category banner heading */
  #catTitleHeading {
    font-size: 1.75rem !important;
  }

  /* Category services grid - single column on mobile */
  #categoryServicesGrid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  /* Service card bottom padding for mobile sticky bar */
  #categoryServicesGrid {
    padding-bottom: 5rem;
  }

  /* Mobile header missing - fix booking button */
  header .flex.items-center.gap-4 a.bg-\[\#0B192C\] {
    font-size: 0.65rem;
    padding: 0.5rem 0.75rem;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  /* 2 columns on tablet */
  #categoryServicesGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* --- About Page --- */
@media (max-width: 767px) {
  /* About story text + image stacking */
  .lg\:col-span-7,
  .lg\:col-span-5 {
    grid-column: span 12 / span 12;
  }

  /* About hero image height */
  .lg\:col-span-5 .h-\[450px\] {
    height: 220px !important;
  }

  /* Pillars - single column on mobile */
  .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  /* 2-col pillars on tablet */
  .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Contact Page --- */
@media (max-width: 767px) {
  /* Phone cards - 2-col on mobile */
  .grid.grid-cols-1.md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .grid.grid-cols-1.md\:grid-cols-4 > a {
    padding: 0.875rem;
  }

  .grid.grid-cols-1.md\:grid-cols-4 h3 {
    font-size: 0.75rem;
  }

  /* Contact form + info - stack vertically */
  .grid.lg\:grid-cols-2 {
    grid-template-columns: 1fr;
  }

  /* Map height on mobile */
  .rounded-3xl.overflow-hidden.border-2.h-\[340px\] {
    height: 220px;
  }

  /* Contact form padding */
  .p-8.rounded-3xl {
    padding: 1.25rem;
  }
}

/* --- Booking Page --- */
@media (max-width: 767px) {
  /* Booking form padding */
  .p-8.sm\:p-12.rounded-3xl {
    padding: 1rem !important;
  }

  /* Time slot buttons - stack on mobile */
  .grid.grid-cols-1.sm\:grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Service banner */
  #selectedServiceBanner {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  #selectedServiceBanner .flex.items-center.gap-4 {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* --- Gallery Page --- */
@media (max-width: 639px) {
  /* 1 column masonry on mobile */
  .masonry-grid {
    column-count: 1 !important;
  }

  /* Gallery filter buttons - scrollable row */
  .flex.flex-wrap.justify-center.gap-3 {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  .flex.flex-wrap.justify-center.gap-3::-webkit-scrollbar {
    display: none;
  }

  .flex.flex-wrap.justify-center.gap-3 button {
    flex-shrink: 0;
  }
}

/* --- Footer --- */
@media (max-width: 767px) {
  footer .flex.flex-col.md\:flex-row {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  footer .flex.flex-wrap.items-center.justify-center {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}

/* --- General Typography Responsive --- */
@media (max-width: 479px) {
  /* Extra small screens */
  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.4rem !important;
  }

  .text-4xl {
    font-size: 1.75rem !important;
  }

  .text-6xl {
    font-size: 2.25rem !important;
  }

  /* Page header banners — ensure full clearance under fixed navbar */
  .pt-36 {
    padding-top: 7.5rem !important;
  }

  .pt-28 {
    padding-top: 6.5rem !important;
  }
}

/* --- Touch Targets (Accessibility) --- */
@media (max-width: 1023px) {
  a, button, input[type="submit"], input[type="button"] {
    min-height: 40px;
  }

  /* Prevent text from overflowing containers */
  p, span, li {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}

/* --- Tablet-specific polish (640px – 1024px) --- */
@media (min-width: 640px) and (max-width: 1023px) {
  /* Logo in navbar */
  header img[alt*="Logo"] {
    height: 3rem;
  }

  /* Page header banners */
  .pt-36 {
    padding-top: 7rem;
  }

  /* Section padding */
  .py-20 {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  /* CTA banner row */
  .py-16.bg-\[\#0B192C\] .flex.flex-col.md\:flex-row {
    flex-direction: row;
    align-items: center;
  }
}

/* --- Quote Calculator & Event Calendar Styles --- */
.quote-box {
  background-color: #ffffff;
  border: 1px solid #c0d1e0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.quote-box-header {
  background-color: #1F4E79;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.6rem 1rem;
  text-align: center;
  letter-spacing: 0.5px;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
}

.quote-table tr {
  border-bottom: 1px solid #e2e8f0;
}

.quote-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  vertical-align: middle;
}

.quote-table td.label-cell {
  font-weight: 700;
  color: #1e293b;
  text-align: right;
  width: 42%;
  background-color: #f8fafc;
  border-right: 1px solid #cbd5e1;
}

.quote-table td.value-cell {
  background-color: #ffffff;
  color: #0f172a;
}

/* --- Quote Table & Calendar Mobile Optimization --- */
@media (max-width: 767px) {
  .quote-table,
  .quote-table tbody,
  .quote-table tr,
  .quote-table td {
    display: block !important;
    width: 100% !important;
  }

  .quote-table tr {
    border-bottom: 1px solid #cbd5e1;
  }

  .quote-table td.label-cell {
    width: 100% !important;
    text-align: left !important;
    background-color: #f1f5f9;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
  }

  .quote-table td.value-cell {
    width: 100% !important;
    padding: 0.6rem 0.75rem;
  }

  .cal-day-btn {
    min-height: 38px;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }

  .cal-day-btn span {
    white-space: nowrap !important;
    line-height: 1 !important;
    display: inline-block;
  }
}

.quote-table input[type="text"],
.quote-table input[type="number"],
.quote-table input[type="date"],
.quote-table input[type="tel"],
.quote-table input[type="email"],
.quote-table select {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.875rem;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s ease;
}

.quote-table input:focus,
.quote-table select:focus {
  border-color: #1F4E79;
  box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.15);
}

.pay-now-btn {
  background-color: #28a745;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: inline-flex;
  items-center: center;
  justify-content: center;
  gap: 0.5rem;
}

.pay-now-btn:hover {
  background-color: #218838;
}

/* Calendar styling */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day-header {
  background-color: #0B192C;
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  padding: 0.6rem 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
}

.calendar-day-cell {
  min-height: 110px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.calendar-day-cell:hover {
  border-color: #1F4E79;
  box-shadow: 0 4px 12px rgba(11, 25, 44, 0.1);
  transform: translateY(-2px);
}

.calendar-day-cell.other-month {
  background-color: #f8fafc;
  opacity: 0.45;
}

.calendar-day-cell.today {
  border: 2px solid #D4AF37;
  background-color: #fffdf5;
}

.badge-available {
  background-color: #d1fae5;
  color: #065f46;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  display: inline-block;
}

.badge-booked {
  background-color: #fee2e2;
  color: #991b1b;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  display: inline-block;
}

.badge-featured {
  background-color: #dbeafe;
  color: #1e40af;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  display: inline-block;
}

/* Footer Contact Info Precision Alignment */
footer a, footer span, footer i {
  min-height: 0 !important;
  line-height: 1.2 !important;
}

footer .flex.items-center {
  align-items: center !important;
}

/* Mobile Navigation Drawer Full Support */
#mobile-menu {
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#mobile-menu:not(.hidden) {
  display: block !important;
}
