/* Time block component styles */
.time-block {
  aspect-ratio: 1;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 80px;
  touch-action: pan-y; /* Allow vertical scrolling, prevent horizontal pan */
}

.time-block:not(.occupied) {
  background: white;
}

.time-block:hover:not(.occupied) {
  border-color: #3b82f6;
  transform: scale(1.05);
}

.time-block.occupied {
  border-color: transparent !important;
  color: white !important;
}

.time-block.occupied:hover {
  transform: scale(1.02);
}

.time-block.selected {
  border: 3px solid #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.time-block.selected:not(.occupied) {
  background-color: rgba(59, 130, 246, 0.1);
}

.time-block.occupied.selected {
  border: 3px solid #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
}

.time-block.is-future {
  background-color: #f5f5f5 !important;
  color: #a0a0a0 !important;
  border-color: #e0e0e0 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

.time-block.is-future:hover {
  transform: none !important;
  border-color: #e0e0e0 !important;
}

.time-block.is-future .time-label,
.time-block.is-future .category-label {
  color: #a0a0a0 !important;
}

.time-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.category-label {
  font-size: 0.65rem;
  text-align: center;
  font-weight: 500;
}


.am-pm-separator {
  grid-column: 1 / -1;
  position: relative;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.separator-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, #d1d5db 20%, #d1d5db 80%, transparent);
  border: none;
  margin: 0;
}

.separator-labels {
  position: absolute;
  background: white;
  padding: 0 1rem;
  display: flex;
  gap: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.am-label, .pm-label {
  background: white;
  padding: 0 0.5rem;
}

/* Mobile Action Bar */
.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  padding: 1rem;
  safe-area-inset-bottom: env(safe-area-inset-bottom);
}

.mobile-action-bar.visible {
  transform: translateY(0);
}

.mobile-action-content {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

.action-buttons .button {
  white-space: nowrap;
  padding: 0.75rem 1.5rem;
}

/* Mobile Sliding Panel */
.sliding-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.sliding-panel.visible {
  transform: translateY(0);
}

.sliding-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.sliding-panel-content {
  background: white;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.panel-header .title {
  margin: 0;
}

.panel-body {
  padding: 1.5rem;
}

/* Hide mobile components on desktop */
@media screen and (min-width: 769px) {
  .mobile-action-bar,
  .sliding-panel {
    display: none !important;
  }
}

/* Mobile responsive styles for time blocks */
@media screen and (max-width: 768px) {
  .time-block {
    min-height: 60px;
  }
  
  .time-label {
    font-size: 0.65rem;
  }
  
  .category-label {
    font-size: 0.55rem;
  }
  
  .separator-labels {
    font-size: 0.65rem;
    gap: 1rem;
  }
  
  /* Add bottom padding to prevent content from being hidden behind action bar */
  .days-show {
    padding-bottom: 100px;
  }
  
  /* Hide desktop modal on mobile */
  .modal {
    display: none !important;
  }
}