/* Calendar UX Improvements for Better User Understanding */

/* Help text at the top of calendar */
.calendar-help-text {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #00cc00;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 12px;
  text-align: center;
  color: #0c7600;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
}

.calendar-help-text i {
  color: #00cc00;
  font-size: 1.2rem;
  animation: pulse 2s ease-in-out infinite;
}

/* Improved availability indicator - circular badge at bottom-left */
.availability-indicator {
  position: absolute;
  bottom: 3px;
  left: 3px; /* Changed to left */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #00cc00;
  min-width: 20px; /* Changed to min-width to allow expansion */
  height: 20px;
  border-radius: 10px; /* Pill shape for longer text */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0 4px; /* Add horizontal padding */
}

/* When showing selected times, allow indicator to expand */
.fc-daygrid-day.has-selected-slots .availability-indicator {
  width: auto;
  max-width: calc(100% - 6px); /* Prevent overflow */
}

/* Show only the number */
.availability-indicator .slot-count {
  display: block; /* Show the number */
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

/* Remove the text */
.availability-indicator::after {
  display: none;
}

/* Pulsing animation for available days */
#clientSchedulingCalendar .fc-daygrid-day.has-availability:not(.has-selected-slots) {
  animation: subtle-pulse 3s ease-in-out infinite;
  background-color: #e6ffe6 !important;
  border: 2px solid #66ff66 !important;
}

@keyframes subtle-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(0, 255, 0, 0.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4);
  }
}

/* Add click cursor icon */
#clientSchedulingCalendar .fc-daygrid-day.has-availability::before {
  content: "👆";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

/* On hover, make the click icon more visible */
#clientSchedulingCalendar .fc-daygrid-day.has-availability:hover::before {
  opacity: 0.6;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-5px);
  }
}

/* Tooltip for available days */
.fc-daygrid-day.has-availability[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.fc-daygrid-day.has-availability:hover[data-tooltip]::after {
  opacity: 1;
}

/* First-time user spotlight */
.calendar-spotlight {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 999;
}

.spotlight-arrow {
  position: absolute;
  background-color: #ff6b00;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: float 2s ease-in-out infinite;
}

.spotlight-arrow::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #ff6b00;
}

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

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
  .availability-indicator::after {
    content: "Tap";
    font-size: 0.6rem;
  }
  
  .fc-daygrid-day.has-availability:hover .availability-indicator::after {
    content: attr(data-slots) " slots";
  }
  
  #clientSchedulingCalendar .fc-daygrid-day.has-availability::before {
    content: "👆";
    font-size: 1rem;
  }
  
  .calendar-help-text {
    font-size: 0.8rem;
    padding: 8px 12px;
  }
}

/* Ultra small screens */
@media (max-width: 400px) {
  .availability-indicator {
    padding: 2px 4px;
  }
  
  .availability-indicator::after {
    font-size: 0.5rem;
  }
}

/* Animation for drawing attention */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Make selected days more obvious */
#clientSchedulingCalendar .fc-daygrid-day.has-selected-slots {
  background-color: #00ff00 !important;
  border: 2px solid #00cc00 !important;
  position: relative;
}

#clientSchedulingCalendar .fc-daygrid-day.has-selected-slots::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: #00cc00;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Improve time slot selection modal appearance */
#timeSlotSelectionModal .time-slot-btn {
  position: relative;
}

#timeSlotSelectionModal .time-slot-btn.btn-warning {
  background-color: rgba(255, 193, 7, 0.2); /* Transparent yellow */
  border-color: #ffc107;
  color: #ffeb3b; /* Bright yellow text */
}

#timeSlotSelectionModal .time-slot-btn.btn-warning:hover {
  background-color: rgba(255, 193, 7, 0.3);
  border-color: #ffeb3b;
  color: #ffffff;
}

/* Add visual feedback for selected slots in modal */
#timeSlotSelectionModal .time-slot-btn.btn-success::after {
  content: "✓";
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #00cc00;
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  border: 2px solid white;
}