/**
 * The Directory - Global Styles
 * Clean Light Mode Refactor matching HiDubai styling
 */

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --color-canvas-bg: #FFFFFF;
  --color-surface-card: #F8FAFC;
  --color-border-light: #E2E8F0;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --color-neon-violet: #6D28D9;
  --color-thermal-orange: #F97316;
  --color-click-cyan: #06B6D4;
  --radius-large: 12px;
  --radius-pill: 32px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  background-color: var(--color-canvas-bg);
  color: var(--text-primary);
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
}

/* Concierge Container Typography & Layout */
.concierge-container header {
  margin-bottom: 48px;
}

#app-canvas-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(109, 40, 217, 0.15) 0%, rgba(249, 115, 22, 0.1) 50%, transparent 100%);
  background-size: 200% 200%; /* For parallax effect */
  animation: mesh-parallax 15s ease infinite alternate;
  z-index: -1; /* Ensure it's behind other content */
  pointer-events: none; /* Allow clicks to pass through */
}

#app-navbar-viewport {
  position: sticky !important;
  top: 0 !important;
  z-index: 99999 !important;
  width: 100%;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.85) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px);
}

.nav-content-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 24px;
}

.nav-mobile-toggle-row {
  display: none !important;
}

.nav-brand-container {
  flex-shrink: 0;
}

.nav-mobile-toggle-row {
  display: none !important;
  transition: var(--transition-smooth);
}

#app-navbar-viewport a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  padding: 0 15px;
}

.nav-brand-container span {
  background: linear-gradient(135deg, var(--color-neon-violet), var(--color-thermal-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  display: inline-block;
}

.nav-item {
  position: relative;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.nav-item::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(135deg, var(--color-neon-violet), var(--color-thermal-orange));
  transform: scaleX(0);
  transform-origin: right;
  transition: var(--transition-smooth);
}

.nav-item:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-item:hover {
  color: var(--color-neon-violet);
}

.nav-btn-primary {
  background: var(--text-primary);
  color: #FFFFFF;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-btn-primary:hover {
  filter: brightness(0.9);
}

.nav-desktop-group,
.nav-links-center,
.nav-desktop-utility {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-desktop-utility {
  gap: 24px;
}

.nav-signup-link {
  font-size: 0.9rem;
}

#app-landing-root {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
}

#app-hero-container {
  width: 100%;
  position: relative;
  z-index: 1 !important;
  background: linear-gradient(
    135deg, 
    rgba(109, 40, 217, 0.95) 0%, 
    rgba(249, 115, 22, 0.95) 100%
  ), 
  url('../assets/hero.jpg');
  background-size: cover !important;
  background-position: center !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 40px 16px;
  text-align: center;
  box-sizing: border-box;
}

#app-hero-container img {
  /* This rule is for the h1, not img. It will be moved below. */
}

#app-hero-container .subtitle {
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  color: #FFFFFF !important;
  margin-top: 8px;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  letter-spacing: -0.02em;
}

.concierge-container header h1 { /* Targeting the h1 inside the header */
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  line-height: 1.2;
  margin: 0;
  font-weight: 800;
  color: #FFFFFF !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  letter-spacing: -0.02em;
}

.logo-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 auto 12px auto !important;
  width: 100% !important;
  text-align: center;
}

.brand-logo-shield {
  height: 64px;
  display: block !important;
  margin: 0 auto !important;
  max-width: 130px !important;
  height: auto !important;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2); /* Keep existing shadow */
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: crisp-edges !important;
  transform: translateZ(0);
}

.search-matrix {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02), 0 12px 24px -4px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.02), inset 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
  position: relative;
  overflow: hidden;
  padding: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.search-matrix:focus-within {
  transform: translateY(-2px) scale(1.005) !important;
  box-shadow: 0 20px 32px -8px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.04), inset 0 0 0 1px var(--color-neon-violet) !important;
}

.search-matrix input,
.search-matrix select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  padding: 16px;
  width: 100%;
  border-right: 1px solid var(--color-border-light);
}

.search-matrix button {
  background: linear-gradient(135deg, var(--color-neon-violet), var(--color-thermal-orange));
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  padding-inline: 32px;
  cursor: pointer;
  transition: var(--transition-smooth);
  height: 100%;
}

@media (min-width: 769px) {
  /* Standard desktop grid handled by .search-matrix base rules */
}

.intent-pill {
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--color-border-light);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: #FFFFFF;
}

.intent-pill:hover {
  border-color: var(--color-click-cyan);
}

.intent-pill.active {
  background: var(--color-click-cyan);
  color: #FFFFFF;
  border-color: transparent;
}

.intent-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.popular-categories-section {
  margin-top: 40px;
}

.popular-categories-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 24px;
  color: #FFFFFF !important;
  font-weight: 700;
}

.merchant-discovery-card {
  background: #FFFFFF;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-large);
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  height: 100%;
  width: 85vw;
  max-width: 320px;
  flex-shrink: 0;
}

.merchant-discovery-card:hover {
  transform: scale(1.02);
  border-color: var(--color-thermal-orange);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.glass-surface {
  background: #FFFFFF;
  border: 1px solid var(--color-border-light);
}

#app-popular-categories-viewport,
#app-directory-grid-viewport,
#app-benefits-viewport {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Animation Keyframes */
@keyframes tactile-ripple {
  0% { width: 0; height: 0; opacity: 0.5; }
  100% { width: 100px; height: 100px; opacity: 0; }
}

@keyframes mesh-parallax {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Global Responsive Media Queries */
@media (max-width: 768px) {
    /* Fix the squished vertical cards */
    .discovery-lane-scroller {
        width: 100% !important;
        overflow-x: auto !important;
        display: flex !important;
        gap: 16px !important;
        -webkit-overflow-scrolling: touch;
    }
    .merchant-discovery-card {
        width: 85vw !important;
        max-width: 320px !important;
        flex-shrink: 0 !important;
    }
    
    /* Hide standard inline text desktop menu links */
    .nav-desktop-group {
        display: none !important;
    }
    
    /* Turn on the responsive mobile layout container row */
    .nav-mobile-toggle-row {
        display: flex !important;
        animation: nav-mobile-fade-in 0.4s ease forwards;
        align-items: center;
        gap: 16px;
    }

    /* Responsive Search Matrix */
    .search-matrix {
        display: flex !important;
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 12px;
        border-radius: var(--radius-large);
        background: transparent;
        box-shadow: none;
        border: none;
        overflow: visible;
    }
    
    .search-matrix input,
    .search-matrix select,
    .search-matrix button {
        width: 100% !important;
        background: #FFFFFF;
        border: 1px solid var(--color-border-light);
        border-radius: 8px;
        height: 56px;
    }

    .search-matrix input,
    .search-matrix select {
        border-right: none;
    }
    
    .location-badge {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px solid var(--color-border-light);
        padding-top: 12px;
        width: 100%;
        text-align: center;
    }
}

/* Premium Mobile Overlay Refinements */
#nav-mobile-overlay {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100vh - 72px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99;
    flex-direction: column;
    padding: 40px;
    gap: 24px;
    border-top: 1px solid var(--color-border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Slide-in animation triggered when JS toggles display: flex */
#nav-mobile-overlay[style*="display: flex"] {
    animation: mobile-menu-slide-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mobile-menu-slide-in {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

.greeting-fade-active {
  transition: opacity 0.5s ease-in-out;
}

.greeting-hidden {
  opacity: 0;
}

@keyframes nav-mobile-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dropdown Menu Styles */
.nav-dropdown-item {
  position: relative;
}

.dropdown-menu-pane {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #FFFFFF;
  border: 1px solid var(--color-border-light);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 180px;
  z-index: 100000 !important;
  padding: 8px 0;
}

.dropdown-menu-pane a {
  display: block;
  padding: 10px 20px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
}

.nav-dropdown-item:hover .dropdown-menu-pane {
  display: block;
}

/* Authentication Modal Overlay */
#app-auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.5);
  backdrop-filter: blur(8px);
  display: none;
  z-index: 2000;
}

#app-auth-modal-overlay.active-visible {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.auth-modal-box {
  background: #FFFFFF;
  padding: 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  position: relative;
  transform: scale(0.95);
  opacity: 0;
  transition: var(--transition-smooth);
}

.auth-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

#app-auth-modal-overlay.active-visible .auth-modal-box {
  transform: scale(1);
  opacity: 1;
}

/* Split-Screen Explore View */
#explore-list-side {
  width: 40%;
  height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 24px;
  border-right: 1px solid var(--color-border-light);
}

#app-gis-map-container {
  width: 60%;
  height: calc(100vh - 70px);
  position: sticky;
  top: 70px;
}

.explore-filter-matrix input,
.explore-filter-matrix select {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--color-border-light);
  padding: 12px;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}