/**
 * Mawidi Demo Scheduler - CSS Module
 * Additional styles and animations for the scheduler
 */

/* Success checkmark animation */
@keyframes scale-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.animate-scale-in {
  animation: scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-checkmark {
  stroke-dasharray: 100;
  animation: checkmark 0.5s 0.3s ease-in-out forwards;
}

.animate-pulse-ring {
  animation: pulse-ring 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Calendar hover effects */
.calendar-day {
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-day:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Time slot grid animations */
.time-slot {
  transition: all 0.2s ease;
}

.time-slot:hover:not(:disabled) {
  transform: scale(1.05);
}

.time-slot:disabled {
  cursor: not-allowed;
}

/* Form input focus states */
.form-input:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 4px rgba(var(--brand-green-rgb), 0.1);
}

.form-input.error {
  border-color: #ef4444;
}

.form-input.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

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

.spinner {
  animation: spin 1s linear infinite;
}

/* Step indicator progress bar */
.step-progress {
  transition: width 0.3s ease;
}

/* Duration selector card hover */
.duration-card {
  transition: all 0.2s ease;
}

.duration-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.duration-card.selected {
  box-shadow: 0 0 0 2px var(--brand-green);
}

/* Confirmation card fade-in */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirmation-card {
  animation: fade-in-up 0.4s ease-out;
}

/* RTL support utilities */
[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

/* Dark mode transitions */
@media (prefers-color-scheme: dark) {
  .dark-transition {
    transition:
      background-color 0.3s ease,
      color 0.3s ease,
      border-color 0.3s ease;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .mobile-compact {
    padding: 1rem;
  }

  .mobile-hide {
    display: none;
  }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Custom scrollbar for time slot picker */
.time-slots-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.time-slots-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.time-slots-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.time-slots-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Focus visible for keyboard navigation */
.focus-ring:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

/* Success message celebration effect */
@keyframes celebrate {
  0%,
  100% {
    transform: rotate(0deg);
  }
  10%,
  30% {
    transform: rotate(-3deg);
  }
  20%,
  40% {
    transform: rotate(3deg);
  }
}

.celebrate-icon {
  animation: celebrate 0.5s ease-in-out;
}

/* Gradient backgrounds */
.gradient-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-overlay {
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 100%
  );
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Pulse animation for new availability */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse-dot {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth reveal for calendar */
@keyframes reveal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reveal-animation {
  animation: reveal 0.3s ease-out;
}

/* Button press effect */
.button-press:active {
  transform: scale(0.98);
}

/* Tooltip styles */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }

  .confirmation-card,
  .success-message {
    break-inside: avoid;
  }
}
