/* Skeleton Screens & Loading States */
.skeleton {
  background: linear-gradient(
    90deg,
    #F5EDE0 25%,
    #FDF8F0 50%,
    #F5EDE0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Dark mode skeleton */
.dark .skeleton {
  background: linear-gradient(
    90deg,
    #332F2B 25%,
    #433F39 50%,
    #332F2B 75%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-text {
  height: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  margin-right: 0.5rem;
}

/* Micro-Interactions */

/* Button Press Feedback */
.btn-interactive:active {
  transform: scale(0.98);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Recipe Card Hover - Lift and shadow */
.recipe-card {
  transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dark .recipe-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Checkbox Success Animation */
.checkbox-item {
  transition: opacity 0.2s ease-out;
}

.checkbox-item.checked {
  opacity: 0.6;
}

.checkbox-icon {
  animation: checkmarkScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmarkScale {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Modal Entrance - Fade in with slight scale-up */
.modal-backdrop {
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Toast Notifications - Slide in from top-right */
.toast {
  animation: slideInRight 0.3s ease-out;
}

.toast.dismiss {
  animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Success State Animations */

/* Pulse Animation - for gentle celebration */
.pulse-success {
  animation: pulse 0.5s ease-out;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 118, 70, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(99, 118, 70, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 118, 70, 0);
  }
}

/* Checkmark Animation - celebratory entrance */
.checkmark-animation {
  animation: checkmarkAppear 0.5s ease-out;
}

@keyframes checkmarkAppear {
  0% {
    opacity: 0;
    transform: scale(0) rotateZ(-45deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotateZ(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateZ(0deg);
  }
}

/* Enhanced Focus States */

/* Focus ring for keyboard navigation */
.focus-ring:focus {
  outline: none;
  ring: 2px;
  ring-color: #C97A5A;
  ring-offset: 2px;
  ring-offset-color: #FFFDF8;
}

/* Focus visible only for keyboard (not mouse clicks) */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #FFFDF8, 0 0 0 4px #C97A5A;
}

.dark .focus-ring:focus-visible {
  box-shadow: 0 0 0 2px #1A1917, 0 0 0 4px #C97A5A;
}

/* Interactive Elements - Button, Link, Form */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #FFFDF8, 0 0 0 4px #C97A5A;
  border-radius: 0.375rem;
}

.dark button:focus-visible,
.dark a:focus-visible,
.dark input:focus-visible,
.dark select:focus-visible,
.dark textarea:focus-visible {
  box-shadow: 0 0 0 2px #1A1917, 0 0 0 4px #C97A5A;
}

/* Calendar day cells focus */
.calendar-day:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #FFFDF8, 0 0 0 4px #C97A5A;
}

.dark .calendar-day:focus-visible {
  box-shadow: 0 0 0 2px #1A1917, 0 0 0 4px #C97A5A;
}

/* Smooth Transitions */

/* Link hover transitions */
a {
  transition: color 0.2s ease-out;
}

/* Button transitions */
button {
  transition: all 0.2s ease-out;
}

/* Form input transitions */
input,
select,
textarea {
  transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Spinner Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Modal Animations */
.modal-backdrop {
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode modal shadow */
.dark .modal-content {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
