/* UI Consistency Fixes - Button and Card Standardization */

/* ============================================
   BUTTON STANDARDIZATION
   ============================================ */

/* Base button consistency - ensure all buttons have same foundation */
.btn,
.btn-primary,
.btn-outline,
.cta .btn {
  /* Standardized dimensions */
  min-height: 56px;
  padding: 0.875rem 2rem;

  /* Standardized typography */
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;

  /* Standardized border radius - using pill shape for all buttons */
  border-radius: 9999px;

  /* Ensure consistent display */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  /* Consistent transitions */
  transition: all 0.3s ease;
}

/* Override conflicting styles in combined.min.css */
.btn {
  border-radius: 9999px !important;
  font-weight: 700 !important;
  min-height: 56px !important;
  font-size: 0.95rem !important;
  line-height: 1.2 !important;
}

.btn-primary {
  border-radius: 9999px !important;
  font-weight: 700 !important;
  min-height: 56px !important;
  font-size: 0.95rem !important;
  line-height: 1.2 !important;
  padding: 0.875rem 2rem !important;
}

.btn-outline {
  border-radius: 9999px !important;
  font-weight: 700 !important;
  min-height: 56px !important;
  font-size: 0.95rem !important;
  line-height: 1.2 !important;
  padding: 0.875rem 2rem !important;
}

/* Ghost button style - transparent background like Arabic page */
.btn.ghost {
  background: transparent !important;
  color: var(--gold) !important;
  border: 2px solid var(--gold) !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  min-height: 56px !important;
  font-size: 0.95rem !important;
  line-height: 1.2 !important;
  padding: 0.875rem 2rem !important;
}

.btn.ghost:hover {
  background: var(--gold) !important;
  color: #000 !important;
}

/* Fix floating buttons - exclude from button height consistency checks */
.floating-buttons a,
.mobile-sticky-bar a {
  /* These are icon buttons, not text buttons - different sizing rules apply */
  min-height: auto;
  font-size: inherit;
}

/* Mobile sticky bar specific sizing */
.mobile-sticky-bar a {
  min-height: 48px;
  padding: 0.8rem 1rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--border-radius-sm, 8px);
}

/* Hamburger menu button - ensure accessible touch target (min 44x44px) */
.hamburger {
  width: 44px;
  height: 44px;
  padding: 8px;
}

.hamburger span {
  width: 28px;
  height: 3px;
}

/* ============================================
   CARD HEIGHT CONSISTENCY
   ============================================ */

/* Ensure card grids align items to stretch for equal heights */
.home-signature__grid,
.home-packages__grid,
.home-experience__grid,
.about-hero__stats,
.essence-grid,
.pillars-grid,
.services-grid,
.team-grid,
.testimonial-grid,
.reservation-packages__grid,
.reservation-amenities__cards,
.faq-overview__grid,
.blog-grid__cards,
.blog-digest__cards {
  align-items: stretch;
}

/* Ensure all cards in grids stretch to fill available height */
.home-signature__card,
.home-packages__card,
.essence-card,
.pillar-card,
.service-card,
.team-card,
.reservation-packages__card,
.reservation-amenities__card,
.faq-overview__card,
.blog-card,
.stat-card {
  height: 100%;
}

/* Cards with flex display need to stretch properly */
.card,
.blog-card,
.home-packages__card {
  display: flex;
  flex-direction: column;
}

/* Ensure card content fills available space */
.home-packages__card > *:last-child,
.home-signature__card > *:last-child {
  margin-top: auto;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (width <=768px) {
  /* Maintain button consistency on mobile */
  .btn,
  .btn-primary,
  .btn-outline,
  .cta .btn {
    min-height: 52px;
    padding: 0.8rem 1.75rem;
    font-size: 0.9rem;
  }

  /* Floating buttons smaller on mobile */
  .floating-buttons a {
    width: 50px;
    height: 50px;
  }
}

@media (width <=360px) {
  .floating-buttons a {
    width: 44px;
    height: 44px;
  }
}

/* ============================================
   ACCESSIBILITY FIXES
   ============================================ */

/* Ensure all interactive elements meet 44x44px minimum touch target */
.floating-buttons a {
  min-width: 56px;
  min-height: 56px;
  width: 56px;
  height: 56px;
}

/* Social icons - ensure adequate touch targets */
.social a,
.footer-social a,
.social-row a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

/* Navigation links - ensure adequate spacing and touch targets */
.nav-menu a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
}

/* Card action links - ensure adequate touch targets */
.home-signature__link,
.home-packages__link,
a[href*="reservations"],
a[href*="menu"],
a[href*="gallery"] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  justify-content: center;
}

/* Footer links - ensure adequate touch targets */
.footer-links a,
.footer-contact a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
}

/* Dropdown menu items */
.dropdown-menu a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
}

/* Logo link - ensure adequate touch target */
.logo {
  min-width: 44px;
  min-height: 44px;
}

/* Language switcher */
.lang-switch {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 1rem !important;
}

/* Form inputs - ensure adequate touch targets */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="number"],
textarea,
select {
  min-height: 48px;
  padding: 0.75rem 1rem;
}

/* ============================================
   CONTRAST IMPROVEMENTS
   ============================================ */

/* CRITICAL: Fix navigation menu contrast (was 1.08, needs 4.5+ for AA) */
.nav-menu a,
.nav-menu li {
  color: rgba(255, 255, 255, 0.95) !important;
  opacity: 1 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  color: #fff !important;
  opacity: 1 !important;
}

/* Dropdown menu contrast */
.dropdown-menu {
  background: rgba(20, 20, 20, 0.98) !important;
}

.dropdown-menu a {
  color: rgba(255, 255, 255, 0.95) !important;
}

.dropdown-menu a:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure text has sufficient contrast - these values should be adjusted based on your color scheme */
.section-eyebrow {
  opacity: 1;
  font-weight: 600;
}

/* Footer text contrast */
.site-footer {
  color: rgba(255, 255, 255, 0.95);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover {
  color: #fff;
}

/* Improve contrast for meta text */
.home-hero__meta span {
  opacity: 0.95;
}

/* General contrast improvements for text elements */
p, h1, h2, h3, h4, h5, h6 {
  opacity: 1;
}

/* Ensure list items have good contrast */
ul li, ol li {
  opacity: 1;
}

/* Ensure links have good contrast */
a:not(.logo):not(.insta-item) {
  opacity: 1;
}

/* Hero section - ensure all text is visible */
.home-hero h1,
.home-hero .text-gradient-glow {
  opacity: 1 !important;
  visibility: visible !important;
}

.home-hero__copy {
  opacity: 1 !important;
  visibility: visible !important;
}

.home-hero__copy p,
.home-hero__list li {
  color: rgba(255, 255, 255, 0.95) !important;
  opacity: 1 !important;
}

/* Card text contrast */
.home-signature__card p,
.home-signature__card li,
.home-packages__card p,
.home-packages__card li {
  opacity: 1;
  color: inherit;
}

/* Eyebrow text */
.home-hero__eyebrow,
.section-eyebrow {
  opacity: 1 !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Hero actions - ensure buttons are visible */
.home-hero__actions {
  opacity: 1 !important;
  visibility: visible !important;
}

.home-hero__actions .btn {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ============================================
   LAYOUT FIXES
   ============================================ */

/* Fix horizontal overflow - prevent content from breaking layout */
body {
  overflow-x: hidden;
  max-width: 100vw;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
}

main {
  overflow-x: hidden;
}

/* Custom scrollbar styling - matches site theme */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

/* Ensure marquee doesn't cause overflow */
.home-marquee {
  overflow: hidden;
  max-width: 100vw;
}

.home-marquee__track {
  overflow: visible;
}

/* Ensure images don't cause overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Optimize image rendering */
img[loading="lazy"] {
  content-visibility: auto;
}

/* Ensure Instagram grid images are properly sized */
.insta-grid img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Container overflow fix */
.container {
  overflow-x: hidden;
}

/* Hero buttons - restore original layout */
.home-hero__actions {
  display: flex !important;
  flex-wrap: wrap !important;
  flex-direction: row !important;
  gap: 1rem !important;
  margin-top: 0.75rem;
  align-items: center !important;
}

.home-hero__actions .btn {
  min-width: auto !important;
  width: auto !important;
  min-height: 48px !important;
  padding: 0.75rem 1.5rem !important;
  font-size: 0.9rem !important;
}

/* Only stack on very small screens */
@media (max-width: 480px) {
  .home-hero__actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  .home-hero__actions .btn {
    width: 100% !important;
  }
}

/* Ensure content doesn't overflow */
.home-hero__grid,
.home-hero__copy {
  max-width: 100%;
}

/* ============================================
   PERFORMANCE - FONT LOADING
   ============================================ */

/* Optimize font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   HEADER CONTRAST FIX
   ============================================ */

/* Ensure header has solid dark background for text contrast */
.site-header {
  background: rgba(0, 0, 0, 0.92) !important;
  backdrop-filter: blur(12px);
}

/* ============================================
   ACCESSIBILITY - TAP TARGET FIXES
   ============================================ */

/* Ensure navigation links meet 44×44px minimum tap target */
.nav .nav-menu a {
  min-height: 44px !important;
  min-width: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 14px !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.nav .nav-menu a:hover {
  color: var(--gold) !important;
}

/* Nav list items need explicit color and background */
.nav .nav-menu li {
  color: #ffffff !important;
  background: transparent;
}

/* ============================================
   FOCUS VISIBLE STYLES
   ============================================ */

/* Global focus visible for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold) !important;
  outline-offset: 3px;
}

.btn:focus-visible {
  outline: 2px solid var(--gold) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3);
}

.nav .nav-menu a:focus-visible {
  outline: 2px solid var(--gold) !important;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   MARQUEE OVERFLOW FIX
   ============================================ */

/* Contain marquee animation to prevent layout overflow detection */
.home-marquee {
  contain: layout paint style;
  overflow: hidden !important;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

.home-marquee__track {
  will-change: transform;
  contain: layout;
  overflow: visible;
}

/* ============================================
   INPUT CONTRAST FIXES
   ============================================ */

/* Improve input field contrast */
input,
textarea,
select {
  background-color: rgba(30, 30, 30, 0.95) !important;
  color: #fff !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold) !important;
  outline: 2px solid rgba(212, 175, 55, 0.3);
  outline-offset: 2px;
}

/* ============================================
   LINK CONTRAST FIXES
   ============================================ */

/* Improve footer link contrast and tap targets */
.footer-links .list a,
.footer-contact .list a,
.site-footer a {
  color: rgba(255, 255, 255, 0.9) !important;
  min-height: 44px !important;
  min-width: 44px !important;
  display: inline-flex !important;
  align-items: center;
  padding: 8px 4px;
}

.footer-links .list a:hover,
.footer-contact .list a:hover,
.site-footer a:hover {
  color: var(--gold) !important;
}

/* Social icons - ensure 44×44px minimum */
.footer-social .social-row a {
  width: 44px;
  height: 44px;
}

/* General link contrast - explicit white color for dark backgrounds */
a {
  color: #f5f5ff;
}

a:not(.btn):not(.logo):not(.home-signature__link) {
  text-decoration-color: rgba(212, 175, 55, 0.5);
}

/* Dropdown menu contrast fix */
.dropdown-menu a {
  color: #f5f5ff !important;
}

.dropdown-menu a:hover {
  color: var(--gold) !important;
}

/* All list items explicit color */
ul li,
ol li {
  color: #f5f5ff;
}

/* Header elements explicit color */
.site-header,
.site-header * {
  color: #f5f5ff;
}

.site-header a:hover {
  color: var(--gold) !important;
}
