/* Calendar Availability Styles - Apple Calendar Inspired */

:root {
  --primary-color: #00CCB4;
  --primary-dark: #008A72;
  --primary-darker: #005A4A;
  --gray-light: #f3f4f6;
  --gray-lighter: #f9fafb;
  --gray-border: #e5e7eb;
}

/* Timeslot Base Styles */
.timeslot {
  position: relative;
  transition: background-color 150ms ease-in-out,
              color 150ms ease-in-out;
  user-select: none;
  -webkit-user-select: none;
  border-top: 1px solid var(--gray-border);
  border-bottom: 0;
}

.timeslot:first-child {
  border-top: none;
}

.timeslot:last-child {
  border-bottom: 1px solid var(--gray-border);
}

/* Hover State for Empty Slots */
.timeslot:not(.bg-primary):not(.dragging) {
  background-color: #ffffff;
  position: relative;
}

.timeslot:not(.bg-primary):not(.dragging):hover {
  background-color: rgba(0, 204, 180, 0.05);
  box-shadow: inset 0 0 0 1px rgba(0, 204, 180, 0.2);
}

.timeslot:not(.bg-primary):not(.dragging):active {
  background-color: rgba(0, 204, 180, 0.1);
}

/* Active/Selected State */
.timeslot.bg-primary {
  background: var(--primary-color);
  color: white;
  position: relative;
  border-top: none;
  border-bottom: none;
  box-shadow: none;
}

/* Dragging State */
.timeslot.dragging {
  opacity: 0.95;
  transform: scale(0.98);
  box-shadow: 0 12px 24px rgba(0, 204, 180, 0.4),
              0 6px 16px rgba(0, 204, 180, 0.3);
  z-index: 50;
}

.timeslot.dragging.bg-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  opacity: 0.95;
}

/* Block drag styling - entire selection block */
.timeslot.block-dragging {
  opacity: 0.95;
  box-shadow: 0 12px 24px rgba(0, 204, 180, 0.4), 0 6px 16px rgba(0, 204, 180, 0.3);
}

/* Time Range Text */
#time-range {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  opacity: 1;
  text-transform: uppercase;
}

/* Day Column Container */
#monday, #tuesday, #wednesday, #thursday, #friday, #saturday, #sunday {
  touch-action: none;
  user-select: none;
}

/* Range Selection Preview */
.timeslot.range-preview {
  background-color: rgba(0, 204, 180, 0.1) !important;
  border: 1px dashed var(--primary-color);
}

/* Sticky Time Column */
.sticky {
  position: sticky;
  left: 0;
  z-index: 20;
  background-color: var(--gray-lighter);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Day Column Header */
.day-header {
  background: linear-gradient(to bottom, var(--gray-lighter), #ffffff);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1f2937;
  border-bottom: 1px solid var(--gray-border);
}

/* Calendar Grid Container */
.calendar-grid {
  background: #ffffff;
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Help Text */
.calendar-help-text {
  background: rgba(0, 204, 180, 0.05);
  border-top: 1px solid rgba(0, 204, 180, 0.2);
  color: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 12px 20px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .timeslot {
    min-height: 40px;
  }

  #time-range {
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  .timeslot {
    min-height: 32px;
  }

  #time-range {
    font-size: 0.6rem;
    font-weight: 600;
  }

  .day-header {
    font-size: 0.65rem;
  }
}

/* Animation Keyframes */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseSelection {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 204, 180, 0.7);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(0, 204, 180, 0.3);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(0, 204, 180, 0);
  }
}

/* Disable transitions for performance during drag */
.timeslot.dragging,
.timeslot.dragging * {
  transition: none !important;
}

/* Focus State for Accessibility */
.timeslot:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

.timeslot:focus {
  outline: none;
}

/* Print Styles */
@media print {
  .timeslot.bg-primary {
    background: #000 !important;
    color: #fff !important;
  }

  .timeslot:hover {
    background: inherit !important;
  }

  .calendar-help-text {
    display: none;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-light: #1f2937;
    --gray-lighter: #111827;
    --gray-border: #374151;
  }

  .timeslot:not(.bg-primary):not(.dragging) {
    background-color: #1f2937;
  }

  .timeslot:not(.bg-primary):not(.dragging):hover {
    background-color: rgba(0, 204, 180, 0.15);
  }

  .sticky {
    background-color: #111827;
  }

  .day-header {
    background: linear-gradient(to bottom, #1f2937, #111827);
    color: #e5e7eb;
  }
}

/* Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .timeslot,
  #time-range {
    transition: none !important;
    animation: none !important;
  }
}

