/*
 * Suncrest Guest Guide - Main Styles
 * Design System matching Suncrest Resorts
 */

/* ========================================
   CSS VARIABLES - DESIGN TOKENS
   ======================================== */
:root {
  /* Colors (HSL Format) */
  --primary: 38 37% 35%;           /* Luxury brown #6F5940 */
  --primary-light: 38 45% 45%;     /* Lighter brown */
  --primary-foreground: 48 20% 96%; /* Cream text on brown */
  --secondary: 40 29% 76%;         /* Beige/tan */
  --accent: #D6C9B3;               /* Beige badge color */

  --background: 48 20% 96%;        /* Cream background #F7F6F3 */
  --card-bg: 48 20% 96%;           /* Card background */

  --success: 142 71% 45%;          /* Green */
  --destructive: 0 84% 60%;        /* Red */

  --border: 40 25% 88%;            /* Subtle borders */
  --muted: 48 15% 92%;             /* Muted backgrounds */
  --muted-foreground: 0 0% 45%;    /* Secondary text */

  --text-primary: 0 0% 12%;        /* Main text color */

  /* Gradients */
  --gradient-ocean: linear-gradient(135deg, hsl(38, 37%, 35%) 0%, hsl(38, 45%, 45%) 100%);
  --gradient-sunset: linear-gradient(135deg, hsl(40, 29%, 76%) 0%, hsl(40, 35%, 85%) 100%);
  --gradient-hero: linear-gradient(135deg, hsl(38, 37%, 35%) 0%, hsl(40, 29%, 76%) 50%, hsl(48, 20%, 96%) 100%);

  /* Shadows */
  --shadow-soft: 0 2px 8px hsl(0, 0%, 12%, 0.06);
  --shadow-elegant: 0 8px 30px hsl(0, 0%, 12%, 0.12);
  --shadow-luxury: 0 20px 60px hsl(38, 37%, 35%, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-luxury: 'Playfair Display', Georgia, serif;

  /* Spacing & Sizing */
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --container-max-width: 1200px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: hsl(var(--text-primary));
  background-color: hsl(var(--background));
  padding-top: 70px; /* Space for fixed navigation */
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
.font-luxury {
  font-family: var(--font-luxury);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: hsl(var(--primary-light));
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========================================
   FIXED NAVIGATION BAR
   ======================================== */
.fixed-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  height: 70px;
}

.fixed-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-luxury);
  font-size: 1.25rem;
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 700;
}

.nav-logo:hover {
  color: hsl(var(--primary-light));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: hsl(var(--primary));
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover {
  background: hsl(var(--background));
  color: hsl(var(--primary-light));
}

.nav-link-home {
  background: hsl(var(--primary));
  color: white;
}

.nav-link-home:hover {
  background: hsl(var(--primary-light));
  color: white;
}

/* Dropdown Navigation */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
  user-select: none;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-elegant);
  min-width: 250px;
  padding: 0.5rem;
  display: none;
  z-index: 1001;
}

.nav-dropdown.active .nav-dropdown-menu {
  display: block;
  animation: dropdownFade 0.2s ease;
}

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

.nav-dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: hsl(var(--primary));
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
}

.nav-dropdown-menu a:hover {
  background: hsl(var(--muted));
  transform: translateX(4px);
}

.nav-dropdown-toggle::after {
  content: '▼';
  font-size: 0.75rem;
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.nav-dropdown.active .nav-dropdown-toggle::after {
  transform: rotate(180deg);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-links {
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .nav-link span:not(.nav-icon) {
    display: none;
  }

  .nav-logo {
    font-size: 1rem;
  }

  .nav-dropdown-menu {
    right: -1rem;
    min-width: 200px;
  }

  .nav-dropdown-menu a {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
}

/* ========================================
   HEADER STYLES
   ======================================== */
.header {
  background: var(--gradient-ocean);
  color: white;
  padding: 3rem 1rem;
  text-align: center;
}

.villa-header {
  background: var(--gradient-hero);
  color: hsl(var(--text-primary));
  padding: 2rem 1rem;
  text-align: center;
}

.logo {
  height: 60px;
  margin-bottom: 1rem;
}

.subtitle,
.villa-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

/* ========================================
   BREADCRUMB NAVIGATION
   ======================================== */
.breadcrumb {
  padding: 1rem 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.breadcrumb a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: hsl(var(--muted-foreground));
}

/* ========================================
   SEARCH SECTION
   ======================================== */
.search-section {
  padding: 2rem 0;
  background: white;
}

.search-input {
  width: 100%;
  max-width: 600px;
  padding: 1rem 1.5rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}

.search-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: var(--shadow-elegant);
}

.search-results {
  max-width: 600px;
  margin: 1rem auto 0;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-elegant);
  display: none;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.2s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: hsl(var(--muted));
}

.category-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: hsl(var(--primary));
  color: white;
  border-radius: 50px;
}

.no-results {
  padding: 2rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

/* ========================================
   CATEGORY/VILLA CARDS
   ======================================== */
.categories,
.villa-selector {
  padding: 3rem 0;
}

.category-grid,
.villa-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.category-card,
.villa-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: hsl(var(--text-primary));
  display: block;
}

.category-card:hover,
.villa-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-elegant);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.villa-image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.villa-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card h2,
.villa-card h2 {
  color: hsl(var(--primary));
  margin-bottom: 0.5rem;
}

.category-card p,
.villa-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* ========================================
   GUIDE CONTAINER & SECTIONS
   ======================================== */
.guide-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.guide-header {
  margin-bottom: 2rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--primary));
  font-weight: 500;
  margin-bottom: 1rem;
  transition: gap 0.2s ease;
}

.back-button:hover {
  gap: 0.75rem;
}

.villa-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* ========================================
   TABLE OF CONTENTS (LEGACY - NOW USING DROPDOWN)
   ======================================== */
.toc-section {
  display: none; /* Hidden by default, replaced by dropdown */
}

.toc {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.toc h3 {
  margin: 0 1rem 0 0;
  font-size: 1.125rem;
  color: hsl(var(--primary));
  white-space: nowrap;
}

.toc a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: hsl(var(--muted));
  color: hsl(var(--primary));
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.toc a:hover,
.toc a.active {
  background: hsl(var(--primary));
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* ========================================
   APPLIANCE GUIDE SECTIONS
   ======================================== */
.appliance-guide {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 90px; /* Space for fixed nav */
}

.appliance-guide h2 {
  color: hsl(var(--primary));
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid hsl(var(--border));
}

.appliance-image {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.appliance-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* User Manual Button */
.manual-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: hsl(var(--primary));
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
}

.manual-button:hover {
  background: hsl(var(--primary-light));
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-elegant);
}

/* ========================================
   STEP-BY-STEP INSTRUCTIONS
   ======================================== */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--gradient-ocean);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: var(--shadow-soft);
}

.step-content h4 {
  display: inline;
  color: hsl(var(--primary));
  margin: 0 0.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.step-content p {
  display: inline;
  color: hsl(var(--text-primary));
  margin: 0;
  line-height: 1.6;
}

/* Legacy step-list styles */
.instructions h3 {
  color: hsl(var(--primary));
  margin-bottom: 1.5rem;
}

.step-list {
  list-style: none;
  padding: 0;
}

.step-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  transition: transform 0.2s ease;
}

.step-list li:hover {
  transform: translateX(4px);
}

/* ========================================
   VIDEO & MEDIA
   ======================================== */
.video-container {
  margin: 2rem 0;
  background: hsl(var(--muted));
  padding: 1.5rem;
  border-radius: var(--radius);
}

.video-container h3 {
  margin-bottom: 1rem;
}

.video-container video {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* ========================================
   TROUBLESHOOTING & TIPS
   ======================================== */
.troubleshooting,
.tips-box {
  margin: 2rem 0;
  background: hsl(var(--muted));
  padding: 1.5rem;
  border-radius: var(--radius);
}

.troubleshooting h3,
.tips-box h3 {
  color: hsl(var(--primary));
  margin-bottom: 1rem;
}

.troubleshooting details {
  background: white;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.troubleshooting summary {
  font-weight: 600;
  color: hsl(var(--primary));
  user-select: none;
}

.troubleshooting details[open] summary {
  margin-bottom: 0.75rem;
}

.troubleshooting p {
  color: hsl(var(--muted-foreground));
  margin-bottom: 0;
}

.tips-box ul {
  list-style: none;
  padding: 0;
}

.tips-box li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: hsl(var(--muted-foreground));
}

.tips-box li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: hsl(var(--primary));
  font-weight: bold;
}

/* ========================================
   EMERGENCY CONTACT BUTTON
   ======================================== */
.emergency-button {
  display: none; /* Hidden per user request */
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: hsl(var(--success));
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  box-shadow: var(--shadow-elegant);
  text-decoration: none;
  font-weight: 600;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  transition: all 0.3s ease;
}

.emergency-button:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-luxury);
  color: white;
}

.emergency-button.pulse {
  animation: pulse 1s ease-out;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: #1E1E1E;
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  margin-top: 4rem;
}

.footer a {
  color: var(--accent);
}

.footer a:hover {
  color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet and below */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.25rem;
  }

  .category-grid,
  .villa-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile landscape and below */
@media (max-width: 768px) {
  body {
    padding-top: 70px;
    font-size: 15px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.125rem; }

  .header,
  .villa-header {
    padding: 2rem 1rem;
  }

  .category-grid,
  .villa-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .appliance-guide {
    padding: 1.5rem;
    margin: 1.5rem 0;
  }

  .appliance-guide h2 {
    font-size: 1.5rem;
  }

  .steps-container {
    gap: 1.25rem;
  }

  .step {
    gap: 1rem;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .step-content h4 {
    font-size: 1.125rem;
  }

  .step-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .tips-section,
  .troubleshooting {
    padding: 1.25rem;
  }

  .manual-button {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }

  .emergency-button {
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .search-input {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .breadcrumb {
    font-size: 0.875rem;
    padding: 0.75rem 0;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0 1rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .header,
  .villa-header {
    padding: 1.5rem 0.75rem;
  }

  .appliance-guide {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .steps-container {
    gap: 1rem;
  }

  .step {
    flex-direction: column;
    align-items: flex-start;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .card-icon {
    font-size: 2.5rem;
  }

  .category-card,
  .villa-card {
    padding: 1.25rem;
  }

  .manual-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: 100%;
    justify-content: center;
  }

  .emergency-button {
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  details summary {
    font-size: 0.9375rem;
    padding: 0.875rem;
  }

  details p {
    padding: 0.875rem;
    font-size: 0.875rem;
  }
}

/* Very small devices */
@media (max-width: 360px) {
  .nav-logo span:last-child {
    font-size: 0.875rem;
  }

  .category-card h2,
  .villa-card h2 {
    font-size: 1.25rem;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .fixed-nav,
  .emergency-button,
  .search-section,
  .breadcrumb {
    display: none !important;
  }

  body {
    background: white;
    padding-top: 0;
  }

  .appliance-guide {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .header,
  .villa-header {
    page-break-after: avoid;
  }
}
