/* ==========================================================================
   Caio Campos Nutricionista - Custom Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --primary: #5c6b54;
  --primary-light: #7a8a71;
  --primary-dark: #4a5744;
  --secondary: #9fa69e;
  --secondary-light: #c1c7c1;
  --accent: #8b9a7d;
  --neutral: #e8eaed;
  --neutral-light: #f5f6f7;
}

/* --------------------------------------------------------------------------
   2. Base Styles
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--primary);
  color: white;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
.font-display {
  font-family: 'Playfair Display', serif;
}

.font-body {
  font-family: 'Inter', sans-serif;
}

/* --------------------------------------------------------------------------
   4. Animations
   -------------------------------------------------------------------------- */

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Float animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

/* Scroll reveal animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. Header Styles
   -------------------------------------------------------------------------- */
#header {
  transition: all 0.3s ease;
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Mobile menu animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#mobile-menu.open {
  max-height: 500px;
}

/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */
#hero {
  min-height: 100vh;
  min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   7. Form Styles
   -------------------------------------------------------------------------- */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(92, 107, 84, 0.15);
}

/* Phone input mask */
input[type="tel"] {
  font-variant-numeric: tabular-nums;
}

/* Form validation styles */
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
  border-color: var(--primary);
}

/* Form success message */
.form-success {
  display: none;
  background: #ecfdf5;
  border: 1px solid #10b981;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.form-success.show {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   8. Cards & Components
   -------------------------------------------------------------------------- */

/* Service cards hover effect */
.service-card {
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px);
}

/* Testimonial cards */
.testimonial-card {
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 80px;
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  opacity: 0.1;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   9. Buttons
   -------------------------------------------------------------------------- */
.btn-primary {
  background-color: var(--primary);
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(92, 107, 84, 0.3);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  transition: all 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   10. WhatsApp Button
   -------------------------------------------------------------------------- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
}

/* --------------------------------------------------------------------------
   11. Scroll to Top Button
   -------------------------------------------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   12. Map Styles
   -------------------------------------------------------------------------- */
.map-container iframe {
  filter: grayscale(20%);
  transition: filter 0.3s ease;
}

.map-container:hover iframe {
  filter: grayscale(0%);
}

/* --------------------------------------------------------------------------
   13. Loading States
   -------------------------------------------------------------------------- */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--neutral);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   14. Responsive Adjustments
   -------------------------------------------------------------------------- */

/* Mobile: <= 640px */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 70px;
  }

  #hero h1 {
    font-size: 2.25rem;
  }

  .whatsapp-float {
    bottom: 16px;
    right: 16px;
  }
}

/* Tablet: 641px - 1024px */
@media (min-width: 641px) and (max-width: 1024px) {
  #hero h1 {
    font-size: 2.75rem;
  }
}

/* Desktop: >= 1025px */
@media (min-width: 1025px) {
  .container {
    max-width: 1280px;
  }
}

/* --------------------------------------------------------------------------
   15. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  header,
  footer,
  .whatsapp-float,
  .scroll-top {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  section {
    page-break-inside: avoid;
  }
}

/* --------------------------------------------------------------------------
   16. Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   17. Dark Mode Support (optional future enhancement)
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed in the future */
}
