/* =========================================================
   SmileCare Amsterdam — Stylesheet
   A fictional demo dental practice website.
   Organised by section so it's easy to find things to edit.
   ========================================================= */

/* -----------------------------
   1. CSS VARIABLES (design tokens)
   ----------------------------- */
:root {
  --color-primary: #0f766e;       /* deep teal - main brand color */
  --color-primary-dark: #0b5952;
  --color-primary-light: #14b8a6;
  --color-accent: #f59e0b;        /* warm amber accent */
  --color-bg: #ffffff;
  --color-bg-soft: #f4faf9;       /* pale mint background */
  --color-text: #1f2937;
  --color-text-muted: #5b6674;
  --color-border: #e2e8e6;
  --color-white: #ffffff;

  --font-heading: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 45px rgba(16, 24, 40, 0.12);

  --max-width: 1160px;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
}

/* Utility class for screen-reader-only text (accessible labels) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus states for keyboard accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* -----------------------------
   3. SHARED LAYOUT HELPERS
   ----------------------------- */
.section {
  padding: 5rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.eyebrow {
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.75rem;
}

.section-intro {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

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

/* -----------------------------
   4. DEMO BANNER
   ----------------------------- */
.demo-banner {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  text-align: center;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
}

/* -----------------------------
   5. NAVIGATION
   ----------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-icon {
  font-size: 1.4rem;
}

.logo-text span {
  color: var(--color-primary);
}

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.4rem;
  z-index: 110;
}

.nav-toggle-bar {
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

/* When menu is open, animate hamburger into an X (class toggled by JS) */
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
  position: fixed;
  top: 0;
  right: -100%;
  height: 100vh;
  width: min(75vw, 320px);
  background-color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 6rem 2rem 2rem;
  box-shadow: var(--shadow-lg);
  transition: right var(--transition);
}

.nav-menu.is-open {
  right: 0;
}

.nav-link {
  font-weight: 500;
  transition: color var(--transition);
}

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

.nav-cta {
  padding: 0.7rem 1.5rem;
}

/* -----------------------------
   6. HERO
   ----------------------------- */
.hero {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.hero-content {
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.4rem);
  margin-bottom: 1.25rem;
}

.highlight {
  color: var(--color-primary);
}

.hero-subtext {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto 2rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  animation: float 5s ease-in-out infinite;
}

.hero-emoji {
  font-size: 5rem;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* -----------------------------
   7. TREATMENTS (cards)
   ----------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.97rem;
}

/* -----------------------------
   8. ABOUT
   ----------------------------- */
.about {
  background-color: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

.about-content p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.about-content h2 {
  margin-bottom: 1rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* -----------------------------
   9. WHY CHOOSE US
   ----------------------------- */
.benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.benefit {
  text-align: center;
}

.benefit-icon {
  font-size: 2rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  background-color: var(--color-bg-soft);
  border-radius: 50%;
}

.benefit h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.benefit p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* -----------------------------
   10. REVIEWS
   ----------------------------- */
.reviews-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.review-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.review-stars {
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  letter-spacing: 2px;
}

.review-card p {
  margin-bottom: 0.75rem;
}

.review-author {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* -----------------------------
   11. FAQ (accordion)
   ----------------------------- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 1.25rem 0.25rem;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.02rem;
}

.faq-icon {
  font-size: 1.3rem;
  color: var(--color-primary);
  transition: transform var(--transition);
}

/* Rotate the + into an x-ish shape when open (class toggled by JS) */
.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition), padding var(--transition);
}

.faq-answer p {
  color: var(--color-text-muted);
  padding-bottom: 1.25rem;
  padding-right: 1.5rem;
}

/* When open, JS sets an inline max-height so the answer can expand smoothly */
.faq-item.is-open .faq-answer {
  padding-bottom: 0;
}

/* -----------------------------
   12. CONTACT
   ----------------------------- */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.info-icon {
  font-size: 1.4rem;
}

.info-item h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.info-item p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.contact-form {
  background-color: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-demo-notice {
  font-size: 0.85rem;
  color: var(--color-primary-dark);
  background-color: #e6f6f4;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
}

.contact-form label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.6rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-white);
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--color-primary);
}

.contact-form button {
  margin-top: 1rem;
}

.form-success {
  margin-top: 0.75rem;
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

/* -----------------------------
   13. FOOTER
   ----------------------------- */
.site-footer {
  background-color: #0b2c29;
  color: #cfe3e0;
  padding: 3.5rem 1.5rem 1.5rem;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo-text {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-brand .logo-text span {
  color: var(--color-primary-light);
}

.footer-brand p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #9fc0bc;
}

.footer-links h3,
.footer-contact h3 {
  color: var(--color-white);
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--color-white);
}

.footer-contact p {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: #9fc0bc;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: #9fc0bc;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-demo-notice {
  color: #f4c778;
}

/* -----------------------------
   14. CHATBOT WIDGET
   ----------------------------- */
.chatbot-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), background-color var(--transition);
  position: relative;
}

.chatbot-toggle:hover {
  transform: scale(1.06);
  background-color: var(--color-primary-dark);
}

/* Swap between the chat bubble icon and the close (X) icon */
.chatbot-toggle-icon-close {
  display: none;
}

.chatbot-toggle.is-open .chatbot-toggle-icon-open {
  display: none;
}

.chatbot-toggle.is-open .chatbot-toggle-icon-close {
  display: inline;
}

.chatbot-window {
  position: absolute;
  bottom: 78px;
  right: 0;
  width: min(340px, 90vw);
  max-height: 70vh;
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Hidden state by default */
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.chatbot-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

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

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chatbot-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.chatbot-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
}

.chatbot-close {
  color: var(--color-white);
  font-size: 1.1rem;
  padding: 0.25rem;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 260px;
  max-height: 360px;
  background-color: var(--color-bg-soft);
}

/* Individual chat bubbles — these classes are added by JavaScript */
.chat-message {
  max-width: 80%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
  align-self: flex-start;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  align-self: flex-end;
  background-color: var(--color-primary);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
}

/* Typing indicator (three bouncing dots) */
.chatbot-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 0 1rem 0.5rem;
  background-color: var(--color-bg-soft);
}

.chatbot-typing.is-visible {
  display: flex;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-text-muted);
  animation: typingBounce 1.2s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.chatbot-input-area input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.chatbot-input-area input:focus {
  border-color: var(--color-primary);
}

.chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition);
}

.chatbot-send:hover {
  background-color: var(--color-primary-dark);
}

/* On very small screens, let the chat window use most of the viewport */
@media (max-width: 420px) {
  .chatbot-window {
    width: 92vw;
    right: -0.75rem;
  }
}

/* -----------------------------
   15. RESPONSIVE BREAKPOINTS
   ----------------------------- */

/* Tablet and up */
@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .reviews-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero {
    flex-direction: row;
    text-align: left;
    padding-top: 4rem;
  }

  .hero-content {
    text-align: left;
    flex: 1;
  }

  .hero-subtext {
    margin-left: 0;
  }

  .hero-buttons {
    justify-content: flex-start;
  }

  .hero-image {
    flex: 1;
  }

  .about {
    grid-template-columns: 1.2fr 1fr;
    padding: 3.5rem;
  }

  .contact-wrapper {
    grid-template-columns: 1fr 1.3fr;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

/* Desktop and up */
@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    height: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    box-shadow: none;
    gap: 2rem;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-image-circle {
    width: 300px;
    height: 300px;
  }

  .hero-emoji {
    font-size: 6.5rem;
  }
}
