/* Calendar/Schedule Page Styling */

:root {
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --green-500: #10b981;
  --yellow-500: #eab308;
}

.calendar-page {
  min-height: 100vh;
  background: var(--white);
}

/* Container and Layout */
.calendar-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .calendar-container {
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .calendar-container {
    padding: 2rem;
  }
}

/* Header Banner */
.calendar-header {
  background: linear-gradient(to right, var(--teal-600), var(--blue-600));
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  color: var(--white);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
  .calendar-header {
    padding: 2rem;
  }
}

.calendar-header-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .calendar-header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

@media (min-width: 1024px) {
  .header-text h1 {
    font-size: 1.875rem;
  }
}

.header-text p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin: 0;
}

@media (min-width: 1024px) {
  .header-text p {
    font-size: 1.125rem;
  }
}

.header-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .header-actions {
    flex-direction: row;
  }
}

/* Buttons */
.btn-appointment {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  background: var(--teal-600);
  color: var(--white);
}

.btn-appointment:hover {
  background: var(--teal-700);
}

.btn-bookings {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  backdrop-filter: blur(4px);
}

.btn-bookings:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Session Type Toggle */
.session-toggle {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .session-toggle {
    flex-direction: row;
    gap: 1rem;
    padding: 0.25rem;
    background: var(--gray-100);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
}

.toggle-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
  border: 2px solid transparent;
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.875rem;
}

@media (min-width: 640px) {
  .toggle-button {
    border-radius: 0.5rem;
  }
}

.toggle-button.active {
  background: linear-gradient(to right, var(--teal-500), var(--teal-600));
  color: var(--white);
  border-color: var(--teal-500);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.toggle-button:not(.active):hover {
  border-color: var(--teal-200);
  background: #f0fdfa;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.toggle-button i {
  font-size: 1.5rem;
}

.toggle-button small {
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Filter Controls */
.filter-section {
  margin-bottom: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .filter-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.filter-label i {
  color: var(--teal-500);
  width: 1rem;
  height: 1rem;
}

.filter-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-900);
  background: var(--white);
  transition: all 0.2s ease;
}

.filter-select:focus {
  outline: none;
  ring: 2px;
  ring-color: var(--teal-500);
  border-color: var(--teal-500);
}

/* Calendar Section */
.calendar-section {
  margin-bottom: 1.5rem;
}

.calendar-wrapper {
  background: var(--white);
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-height: 600px;
}

#calendar {
  min-height: 600px;
  height: 800px;
}

@media (min-width: 1024px) {
  .calendar-wrapper {
    padding: 1.5rem;
  }

  #calendar {
    height: 900px;
  }
}

/* Legend */
.legend {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.legend-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
}

.legend-color.available {
  background: var(--teal-600);
}

.legend-color.booked {
  background: #1e40af;
}

.legend-color.full {
  background: #ef4444;
}

.legend-color.pending {
  background: var(--yellow-500);
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 32rem;
  margin: 0 1rem;
  background: var(--white);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  z-index: 50;
  scale: 0.9;
  transition: scale 0.3s ease;
}

.modal-overlay.active .modal-dialog {
  scale: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--gray-400);
  transition: all 0.2s ease;
  font-size: 1.25rem;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

@media (min-width: 640px) {
  .modal-footer {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-label i {
  color: var(--teal-500);
  width: 1rem;
  height: 1rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--gray-900);
  background: var(--white);
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.form-textarea {
  resize: none;
}

/* Grid for two columns */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Cost Summary */
.cost-summary {
  padding: 1rem;
  background: rgba(13, 148, 136, 0.05);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 0.5rem;
  margin-top: 1rem;
}

.cost-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.cost-summary-row span {
  color: var(--gray-600);
}

.cost-summary-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--teal-600);
}

.cost-note {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

/* Class Details */
.class-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.detail-card {
  text-align: center;
  padding: 0.75rem;
  background: var(--white);
  border-radius: 0.5rem;
  border: 1px solid var(--gray-200);
}

.detail-card i {
  color: var(--teal-500);
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.detail-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal-600);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--teal-700);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-900);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

/* FullCalendar Overrides */
.fc {
  font-family: inherit;
}

.fc-button-primary {
  background-color: var(--teal-600) !important;
  border-color: var(--teal-600) !important;
}

.fc-button-primary:not(:disabled).fc-button-active {
  background-color: var(--teal-700) !important;
  border-color: var(--teal-700) !important;
}

.fc-button-primary:hover {
  background-color: var(--teal-700) !important;
  border-color: var(--teal-700) !important;
}

.fc .fc-col-header-cell {
  background: var(--gray-50);
  border-color: var(--gray-200);
  padding: 1rem 0;
}

.fc .fc-daygrid-day {
  border-color: var(--gray-200);
}

.fc .fc-daygrid-day-frame {
  min-height: 6rem;
}

/* Calendar Event Styling */
.fc-event {
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  border-radius: 0.375rem !important;
}

/* Event Dot Colors (used in Month and List views) */
.fc-daygrid-event-dot,
.fc-list-event-dot {
  border-width: 5px !important;
}

.fc-event-available .fc-daygrid-event-dot,
.fc-event-available .fc-list-event-dot,
.available.fc-list-event-dot {
  border-color: var(--teal-600) !important;
  background-color: var(--teal-600) !important;
}

.fc-event-booked .fc-daygrid-event-dot,
.fc-event-booked .fc-list-event-dot,
.booked.fc-list-event-dot {
  border-color: #1e40af !important;
  background-color: #1e40af !important;
}

.fc-event-full .fc-daygrid-event-dot,
.fc-event-full .fc-list-event-dot,
.full.fc-list-event-dot {
  border-color: #ef4444 !important;
  background-color: #ef4444 !important;
}

.fc-event-pending .fc-daygrid-event-dot,
.fc-event-pending .fc-list-event-dot {
  border-color: var(--yellow-500) !important;
  background-color: var(--yellow-500) !important;
}

/* Background colors for block-style events */
.fc-v-event.fc-event-available,
.fc-h-event.fc-event-available {
  background-color: var(--teal-600) !important;
  border-color: var(--teal-700) !important;
}

/* .fc-v-event.fc-event-booked,
.fc-h-event.fc-event-booked,
.fc-event.booked {
  background-color: #1e40af !important;
  border-color: #1e3a8a !important;
}

/* .fc-v-event.fc-event-full,
.fc-h-event.fc-event-full {
  background-color: #ef4444 !important;
  border-color: #dc2626 !important;
} */

.fc .fc-daygrid-day.fc-day-other {
  background-color: var(--gray-50);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .calendar-container {
    padding: 1rem;
  }

  .modal-dialog {
    max-width: calc(100% - 2rem);
  }

  .calendar-header h1 {
    font-size: 1.25rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }
}