/* 
 * Tara Thai Massage - Main Stylesheet
 * 
 * Purpose: Defines the visual design system, layout, and responsiveness for the site.
 * 
 * STRUCTURE:
 * 1. Variables (Colors, Typography)
 * 2. Reset & Base Styles
 * 3. Utility Classes
 * 4. Layout (Header, Hero, Sections, Footer)
 * 5. Components (Buttons, Cards, Modals)
 * 6. Animations
 * 7. Mobile Responsiveness
 */

/* =========================================
   1. VARIABLES
   ========================================= */
:root {
  /* Color Palette - Greens */
  --color-green-dark: #082b27;
  --color-green-medium: #0d403b;
  --color-green-deep: #062925;

  /* Color Palette - Golds */
  --color-gold-light: #c8b14e;
  --color-gold-rich: #b49931;

  /* Color Palette - Neutrals */
  --color-neutral-light: #f7f4e9;
  --color-neutral-accent: #626b48;

  /* Typography */
  --font-heading: "Playfair Display", "Times New Roman", serif;
  --font-body: "Lato", "Helvetica Neue", sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem; /* 8px */
  --spacing-sm: 1rem; /* 16px */
  --spacing-md: 1.75rem; /* 32px */
  --spacing-lg: 2.5rem; /* Reduced from 4rem (64px -> 48px) */
  --spacing-xl: 3.5rem; /* Reduced from 8rem (128px -> 80px) */

  /* Transitions */
  --transition-fast: 0.3s ease;
  --transition-smooth: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-green-dark);
  background-color: var(--color-neutral-light);
  line-height: 1.6;
  overflow-x: hidden;
  /* Refined Option B: Smooth multi-stop vertical gradient */
  background: linear-gradient(
    180deg,
    #F7F4E9 0%,
    #EFECD6 25%,
    #EBEBC5 50%,
    #D8DBBE 75%,
    #C0C5AA 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--color-green-dark);
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

h1 {
  font-size: 3.5rem;
}
h2 {
  font-size: 2.5rem;
}
h3 {
  font-size: 1.75rem;
  color: var(--color-gold-rich);
}
p {
  margin-bottom: var(--spacing-sm);
  font-size: 1.1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

/* =========================================
   3. UTILITY CLASSES
   ========================================= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.text-center {
  text-align: center;
}
.text-gold {
  color: var(--color-gold-rich);
}
.hidden {
  display: none !important;
}

/* =========================================
   4. LAYOUT COMPONENTS
   ========================================= */

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--color-green-dark); /* Dark background for premium feel */
  backdrop-filter: blur(10px);
  transition: var(--transition-fast);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-xs) 0;
  height: 80px; /* Slightly taller for balance */
}

.logo-container {
  width: auto;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
  align-items: center; /* Ensure vertical alignment */
}

.nav-links a {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 4px;
  color: var(--color-neutral-light); /* Light text for dark bg */
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold-rich);
  transition: var(--transition-fast);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px; /* Offset for fixed header */
  position: relative;
  overflow: hidden;
}

.hero-content {
  z-index: 2;
  max-width: 800px;
  animation: fadeUp 1s ease-out;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  color: var(--color-green-dark); /* Dark text on light upper gradient/image */
  margin-bottom: var(--spacing-md);
  font-style: italic;
}

/* Section Styling */
section {
  padding: var(--spacing-xl) 0;
  background: transparent !important; /* Force transparent to let body gradient show */
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-title span {
  display: block;
  font-size: 1rem;
  color: var(--color-gold-rich);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--spacing-xs);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
}

.service-card {
  background: rgba(255, 255, 255, 0.8); /* Slight frosted glass */
  padding: var(--spacing-md);
  border-radius: 8px;
  border: 1px solid rgba(200, 177, 78, 0.2);
  transition: var(--transition-fast);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(8, 43, 39, 0.1);
  background: #fff;
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-xs);
  border-bottom: 1px dotted var(--color-gold-light);
  padding-bottom: 4px;
}

/* Magnet Button */
.btn-magnet {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(
    180deg,
    var(--color-gold-light),
    var(--color-gold-rich)
  );
  color: #0a0a0a;

  padding: 0.75rem 2.2rem;
  border-radius: 999px;

  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  cursor: pointer;
  border: none;

  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);

  transition:
    transform 0.15s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.btn-magnet:hover {
  background: linear-gradient(
    180deg,
    var(--color-gold-light),
    var(--color-gold-light)
  );

  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);

  transform: translateY(-1px);
}

.btn-magnet:active {
  transform: translateY(0);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.28),
    inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* Footer */
footer {
  background: var(--color-green-dark);
  color: var(--color-neutral-light);
  padding: var(--spacing-lg) 0 var(--spacing-md);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

footer a {
  color: var(--color-gold-light);
  transition: color 0.3s;
}

footer a:hover {
  color: #fff;
}

/* Social Icons */
.social-icons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.social-icon {
  width: 24px;
  height: 24px;
  fill: var(--color-gold-light);
  transition: fill 0.3s, transform 0.3s;
}

.social-icon:hover {
  fill: #fff;
  transform: translateY(-2px);
}

/* =========================================
   6. ANIMATIONS
   ========================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo Styling */
.logo-container img {
  height: 50px;
  width: auto;
}

/* =========================================
   7. RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }

  .nav-links {
    display: none; /* Mobile menu implementation needed if requested */
  }

  .hero {
    height: auto;
    /* Fix clipping: 80px header + spacing */
    padding: calc(80px + var(--spacing-md)) 0 var(--spacing-xl);
  }
 
  /* Force landscape crop on mobile to match desktop style */
  .popup-image img {
    height: 200px; /* Decouples height from width to force crop */
    max-height: 35vh; /* Prevents tall image on small screens */
  }
}
/* =========================================
   8. SPECIFIC SECTION STYLES
   ========================================= */

/* Seasonal Promo Section Enhancement */
.seasonal-promo-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.seasonal-promo-image {
    flex: 1;
    min-width: 300px;
    position: relative;
    background: #ddd; /* Placeholder bg */
}

.seasonal-promo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.seasonal-promo-content {
    flex: 1;
    min-width: 300px;
    padding: var(--spacing-md);
    background: var(--color-gold-light); /* Or keep section bg */
    color: var(--color-green-dark); /* Dark text for contrast */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Ensure headings in promo are readable */
.seasonal-promo-content h3 {
    color: var(--color-green-dark) !important;
}

@media (max-width: 768px) {
    .seasonal-promo-container {
        flex-direction: column;
    }
    .seasonal-promo-image {
        height: 200px; /* Constrain height on mobile */
    }
}

/* =========================================
   9. PROMO POPUP STYLES
   ========================================= */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 2000;
  display: flex; /* Flex is toggled via JS */
  justify-content: center;
  align-items: center;
  padding: var(--spacing-sm);
  animation: fadeIn 0.35s ease;
}

/* Less white: warm “glass” + premium shadow */
.popup-content {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;

  background: rgba(255, 252, 245, 0.82); /* warm tint */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.18) inset;
}

/* Scrolling stays the same */
.popup-scroll-area {
  overflow-y: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Make the image feel integrated, not like a block on white */
.popup-image {
  aspect-ratio: 16 / 9;   /* Forces landscape shape on all screens */
  background: transparent;
  overflow: hidden;
  position: relative;
}

/* Gentle fade from image into content so there’s less “hard white” */
.popup-image::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  background: linear-gradient(
    to bottom,
    rgba(255, 252, 245, 0) 0%,
    rgba(255, 252, 245, 0.70) 60%,
    rgba(255, 252, 245, 0.92) 100%
  );
  pointer-events: none;
  z-index: 2;
}
.popup-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.40) 0%,
    rgba(0, 0, 0, 0) 18%,
    rgba(0, 0, 0, 0) 82%,
    rgba(0, 0, 0, 0.40) 100%
  );
  pointer-events: none;
  z-index: 1;
}
.popup-image img {
  width: 100%;
  height: 100%;              /* fixed height makes cover predictable */
  object-fit: cover;
  object-position: center 0%; /* shift crop upward so top text stays */
  display: block;
  /* SAFE VERTICAL ADJUSTMENT: Change translateY value to move image up (-) or down (+) */
  transform: translateY(0px);
}

/* Less padding + warmer background so it’s not stark white */
.popup-text {
  padding: calc(var(--spacing-md) * 0.9) var(--spacing-md) var(--spacing-md);
  background: rgba(255, 252, 245, 0.65);
}

.popup-text h3 {
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
}

.popup-text p {
  margin: 0 auto 1.1rem;
  max-width: 36ch;
  line-height: 1.55;
}

/* Close button: elegant, not bright white */
.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;

  border: none;
  cursor: pointer;
  line-height: 1;

  width: 42px;
  height: 42px;
  border-radius: 999px;

  background: rgba(20, 20, 20, 0.38);
  color: #fff;

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 100;
  transition: transform 0.15s ease, background 0.25s ease, opacity 0.25s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.close-btn:hover {
  background: rgba(20, 20, 20, 0.55);
  transform: scale(1.04);
}

.close-btn:active {
  transform: scale(0.98);
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .popup-overlay {
    animation: none;
  }
  .close-btn {
    transition: none;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================
   10. LIGHTBOX (IMAGE MODAL)
   ========================================= */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 3000;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  padding: var(--spacing-md);
  animation: fadeIn 0.2s ease;
}

#lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  cursor: default;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

#lightbox.active {
  display: flex;
}

#lightbox.active img {
  transform: scale(1);
}

.lightbox-trigger {
  cursor: zoom-in;
}