/* Custom Tailwind Configuration */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700;800;900&display=swap");

:root {
  /* Nature-inspired color palette */
  --sage-50: #f6f7f4;
  --sage-100: #e8ebe3;
  --sage-200: #d4d9ca;
  --sage-400: #a3b18a;
  --sage-500: #88a070;
  --sage-600: #6d8257;

  --forest-600: #3a4f39;
  --forest-700: #2d3e2c;
  --forest-900: #1a2419;
}

/* Apply custom color palette via Tailwind */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.font-serif {
  font-family: "Cormorant Garamond", Georgia, serif;
}

/* Custom color classes */
.bg-sage-50 {
  background-color: var(--sage-50);
}
.bg-sage-100 {
  background-color: var(--sage-100);
}
.bg-sage-200 {
  background-color: var(--sage-200);
}
.bg-sage-400 {
  background-color: var(--sage-400);
}
.bg-sage-500 {
  background-color: var(--sage-500);
}
.bg-sage-600 {
  background-color: var(--sage-600);
}

.bg-forest-600 {
  background-color: var(--forest-600);
}
.bg-forest-700 {
  background-color: var(--forest-700);
}
.bg-forest-900 {
  background-color: var(--forest-900);
}

.text-sage-400 {
  color: var(--sage-400);
}
.text-sage-500 {
  color: var(--sage-500);
}
.text-sage-600 {
  color: var(--sage-600);
}

.text-forest-600 {
  color: var(--forest-600);
}
.text-forest-700 {
  color: var(--forest-700);
}
.text-forest-900 {
  color: var(--forest-900);
}

.border-sage-200 {
  border-color: var(--sage-200);
}
.border-sage-500 {
  border-color: var(--sage-500);
}

.hover\:text-sage-600:hover {
  color: var(--sage-600);
}
.hover\:text-sage-700:hover {
  color: #5a6e48;
}
.hover\:bg-sage-600:hover {
  background-color: var(--sage-600);
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar with nature theme */
::-webkit-scrollbar {
  width: 14px;
}

::-webkit-scrollbar-track {
  background: var(--sage-50);
}

::-webkit-scrollbar-thumb {
  background: var(--sage-500);
  border-radius: 7px;
  border: 3px solid var(--sage-50);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sage-600);
}

/* Focus states */
input:focus,
textarea:focus,
button:focus,
select:focus,
a:focus {
  outline: 2px solid var(--sage-500);
  outline-offset: 2px;
}

/* Date input styling */
input[type="date"].date-input {
  color-scheme: dark;
}

input[type="date"].date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Flip card effect */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 1.5rem;
}

.flip-card-front {
  background-color: white;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Slide up animation for cookie popup */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

/* Bounce animation */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-bounce {
  animation: bounce 2s infinite;
}

/* Spin animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Image hover effects */
.image-zoom-container {
  overflow: hidden;
  border-radius: 1.5rem;
}

.image-zoom-container img {
  transition: transform 0.6s ease;
}

.image-zoom-container:hover img {
  transform: scale(1.08);
}

/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .backdrop-blur-sm {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* Form validation states */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #dc2626;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
  border-color: var(--sage-500);
}

/* Button hover effects */
button,
a[class*="bg-"] {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Responsive typography */
@media (max-width: 640px) {
  h1 {
    font-size: 2.5rem;
    line-height: 1.1;
  }

  h2 {
    font-size: 2rem;
    line-height: 1.2;
  }

  h3 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
}

/* Print styles */
@media print {
  header,
  footer,
  #cookiePopup,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  * {
    box-shadow: none !important;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Selection styling */
::selection {
  background-color: var(--sage-400);
  color: white;
}

::-moz-selection {
  background-color: var(--sage-400);
  color: white;
}

/* Performance optimizations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--sage-500);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Organic shapes and shadows */
.organic-shadow {
  box-shadow: 0 10px 40px -10px rgba(42, 63, 41, 0.15);
}

.organic-shadow-lg {
  box-shadow: 0 20px 60px -15px rgba(42, 63, 41, 0.2);
}

/* Text balance for better typography */
.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

/* Mobile menu animation */
@media (max-width: 1023px) {
  #mobileMenu {
    animation: slideDown 0.3s ease-out;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, var(--sage-600) 0%, var(--forest-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card hover lift effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
}

/* Nature-inspired decorative elements */
.leaf-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C15 6.716 21.716 0 30 0z' fill='%23a3b18a' fill-opacity='0.05'/%3E%3C/svg%3E");
}

/* Smooth transitions for all interactive elements */
a,
button,
input,
textarea,
select {
  transition: all 0.25s ease;
}

/* Enhanced focus visible for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--sage-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Refined border radius scale */
.rounded-3xl {
  border-radius: 1.75rem;
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
