/* General styles */
.container {
  padding-bottom: 2rem;
}

/* Modal scrolling styles */
.modal {
  overflow-y: hidden !important;
}

.modal-dialog {
  display: flex;
  flex-direction: column;
  height: 90vh; /* Limit height to 90% of viewport height */
  margin-top: 5vh;  /* Center vertically */
}

.modal-content {
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.modal-body {
  overflow-y: auto;  /* Make only the body scrollable */
  max-height: calc(90vh - 120px); /* Subtract header and footer height */
  padding-right: 15px; /* Prevent content shift when scrollbar appears */
}

.modal-header, 
.modal-footer {
  flex-shrink: 0;  /* Prevent header/footer from shrinking */
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Period card styling */
.period-card {
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.period-card:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.period-card.break {
  border-left-color: #ffc107;  /* Yellow for breaks */
  background-color: #fff3cd;
}

.period-card.morning {
  border-left-color: #28a745;  /* Green for morning periods */
}

.period-card.afternoon {
  border-left-color: #17a2b8;  /* Blue for afternoon periods */
}

.period-card.dragging {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form styling */
.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
  border-color: #007bff;
  background-color: #007bff;
}

/* Schedule display styles */
.schedule-day {
  margin-bottom: 1.5rem;
}

.period-time {
  font-size: 0.875rem;
  color: #666;
}

/* Schedule card styling */
.card {
  margin-bottom: 1rem;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
  padding: 1rem;
}

.card-body {
  padding: 1.25rem;
}

/* Break period styling */
.break-period {
  background-color: #fff3cd;
  border-left: 3px solid #ffc107;
}

/* Regular period styling */
.regular-period {
  background-color: #ffffff;
  border-left: 3px solid #007bff;
}

/* Form controls */
.form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Better visibility for validation errors */
.validation-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Button styling */
.btn-group-sm > .btn {
  padding: 0.25rem 0.5rem;
}

/* Print styles */
@media print {
  .modal,
  .btn,
  .form-group,
  #clear-data {
      display: none !important;
  }

  .card {
      border: none !important;
      box-shadow: none !important;
  }

  .card-header {
      background-color: transparent !important;
      border-bottom: 1px solid #dee2e6 !important;
  }

  .break-period,
  .regular-period {
      border-left-width: 2px !important;
  }
}

/* Drag and drop styles */
.draggable-period {
  cursor: grab;
}

.draggable-period:active {
  cursor: grabbing;
}

.drag-handle {
  cursor: grab;
  padding: 0.5rem;
  margin-right: 0.5rem;
  color: #6c757d;
}

.drag-handle:hover {
  color: #343a40;
}

/* Duration input styling */
.duration-input {
  max-width: 120px;
}

.duration-input .input-group-text {
  background-color: #f8f9fa;
}

/* Day selection styling */
.day-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.day-checkbox {
  margin-right: 1rem;
}

/* Modal backdrop */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Schedule group styling */
.schedule-group {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
}

.schedule-group-header {
  font-weight: 500;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dee2e6;
}

/* Hover effects */
.period-card:hover .period-actions {
  opacity: 1;
}

.period-actions {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-dialog {
      margin: 0;
      height: 100vh;
  }

  .modal-content {
      border-radius: 0;
  }

  .period-actions {
      opacity: 1;
  }
}