/* =========================================
   Chatsworth Park Health Care Center
   Premium / AI-Modern Design System
   ========================================= */

/* --- CSS Variables & Theming --- */
:root {
  /* Colors - AI/Modern Palette */
  --primary-hue: 178;
  /* Modern Teal */
  --primary-color: hsl(var(--primary-hue), 70%, 45%);
  /* Slightly darker for contrast */
  --primary-dark: hsl(var(--primary-hue), 80%, 25%);
  --primary-light: hsl(var(--primary-hue), 80%, 85%);
  --accent-color: hsl(260, 60%, 65%);
  /* Soft Purple */

  --bg-color: #f4f6f8;
  /* Softer, premium off-white */
  --surface-color: #ffffff;
  --text-color: #1a1a1a;
  --text-muted: #555555;
  --border-color: rgba(0, 0, 0, 0.08);

  --glass-bg: rgba(255, 255, 255, 0.85);
  /* More opaque for readability */
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-color), #2BB8D6);
  --gradient-accent: linear-gradient(135deg, var(--accent-color), #A06CD5);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2));

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;

  /* Typography */
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Roboto', system-ui, -apple-system, sans-serif;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-normal: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Layout */
  --container-width: 1280px;
  --header-height: 80px;
  --top-bar-height: 48px;
}

[data-theme="dark"] {
  --bg-color: #0b0d10;
  --surface-color: #15181e;
  --text-color: #e6e6e6;
  --text-muted: #a0a0a0;
  --border-color: rgba(255, 255, 255, 0.08);

  --glass-bg: rgba(21, 24, 30, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);

  --primary-color: hsl(var(--primary-hue), 70%, 55%);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--text-color);
}

h1 {
  font-size: 3.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 2rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* --- Utility Classes --- */
.container {
  width: 92%;
  max-width: var(--container-width);
  margin: 0 auto;
}

.section {
  padding: var(--spacing-xl) 0;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.bg-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(32, 178, 170, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(32, 178, 170, 0.5);
}

.btn-secondary {
  background: transparent;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-text {
  padding: 0;
  color: var(--primary-color);
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.btn-text:hover {
  border-bottom-color: var(--primary-color);
}

.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* --- Header & Navigation --- */
.top-bar {
  background: var(--primary-dark);
  color: white;
  height: var(--top-bar-height);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-links {
  display: flex;
  gap: 2rem;
}

.top-bar a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.9;
}

.top-bar a:hover {
  opacity: 1;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

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

.logo {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  /* Using padding on links instead */
  list-style: none;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: var(--text-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background: rgba(var(--primary-hue), 255, 255, 0.05);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface-color);
  min-width: 200px;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 1001;
}

/* Mega Menu variant (optional, using simple dropdown logic for now but styled wider) */
.dropdown-menu.mega {
  min-width: 600px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  border-radius: 6px;
}

.dropdown-link:hover {
  background: var(--bg-color);
  color: var(--primary-color);
}

.dropdown-header {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  font-weight: 700;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}

/* --- Hero Section --- */
.hero-premium {
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(to right, var(--bg-color) 40%, rgba(255, 255, 255, 0) 40%),
    url('../images/hero_modern_nursing_home.png') no-repeat right center/cover;
}

/* Re-style for dark mode overlap */
[data-theme="dark"] .hero-premium {
  background: linear-gradient(to right, var(--bg-color) 40%, rgba(0, 0, 0, 0) 40%),
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url('../images/hero_modern_nursing_home.png') no-repeat right center/cover;
}

.hero-content {
  max-width: 50%;
  padding-right: 4rem;
}

.trust-badges {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  opacity: 0.7;
}

/* --- Features & Grid --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2.5rem;
  background: var(--surface-color);
  border-radius: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-color);
}

.icon-box {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
  padding-left: 60px;
}

.timeline-dot {
  position: absolute;
  left: 11px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 4px solid var(--surface-color);
  box-shadow: 0 0 0 2px var(--primary-color);
}

/* --- Chat Widget --- */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 100px);
  background: var(--surface-color);
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transform: translateY(120%);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.chat-widget.open {
  transform: translateY(0);
}

.chat-header {
  background: var(--gradient-primary);
  color: white;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8f9fa;
}

[data-theme="dark"] .chat-body {
  background: #121418;
}

.chat-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--surface-color);
}

.chat-bubble {
  padding: 1rem;
  border-radius: 1rem;
  max-width: 80%;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.chat-bubble.bot {
  background: var(--surface-color);
  border-bottom-left-radius: 0.2rem;
  border: 1px solid var(--border-color);
  align-self: flex-start;
}

.chat-bubble.user {
  background: var(--primary-color);
  color: white;
  border-bottom-right-radius: 0.2rem;
  align-self: flex-end;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quick-reply-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-reply-btn:hover {
  background: var(--primary-color);
  color: white;
}

.chat-toggle-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  box-shadow: 0 10px 25px rgba(32, 178, 170, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 10000;
  transition: transform 0.3s;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
}

.chat-widget.open+.chat-toggle-btn {
  display: none;
}

/* Hide toggle when open, or change icon */

/* Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-premium {
    padding: 4rem 0;
    background: var(--bg-color);
  }

  .hero-content {
    max-width: 100%;
    padding-right: 0;
    text-align: center;
  }

  .trust-badges {
    justify-content: center;
  }

  .top-bar-links {
    display: none;
  }

  /* Hide top links on tablet */
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--surface-color);
    flex-direction: column;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .hamburger {
    display: block;
  }

  .chat-widget {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    max-height: 100vh;
  }
}