/* Custom DateTime Picker Styles */

:root {
  --dtp-primary: #1a7f37;
  --dtp-primary-hover: #166e30;
  --dtp-primary-light: #f0fff4;
  --dtp-primary-border: #c6f6d5;
  --dtp-text-dark: #1e293b;
  --dtp-text-muted: #64748b;
  --dtp-bg-white: #ffffff;
  --dtp-border-color: #e2e8f0;
  --dtp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --dtp-radius: 16px;
}

/* Modal Content Glassmorphism */
.custom-dtp-content {
  border: none !important;
  border-radius: var(--dtp-radius) !important;
  box-shadow: var(--dtp-shadow) !important;
  overflow: hidden;
  background: var(--dtp-bg-white) !important;
  font-family: inherit;
}

.custom-dtp-header {
  background: var(--dtp-primary) !important;
  color: #fff !important;
  padding: 16px 24px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.custom-dtp-header .modal-title {
  font-weight: 700 !important;
  font-size: 18px !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
}

.custom-dtp-header .btn-close {
  filter: invert(1) grayscale(1) brightness(2);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.custom-dtp-header .btn-close:hover {
  opacity: 1;
}

.custom-dtp-body {
  padding: 0 !important;
  background: #f8fafc;
}

/* Wrapper Layout */
.custom-dtp-wrapper {
  display: flex;
  flex-direction: row;
}

/* Left Panel: Calendar */
.custom-dtp-calendar-panel {
  flex: 0 0 60%;
  width: 60%;
  padding: 24px;
  background: var(--dtp-bg-white);
  border-right: 1px solid var(--dtp-border-color);
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-nav .current-month-year {
  font-weight: 800;
  font-size: 16px;
  color: var(--dtp-text-dark);
  text-transform: capitalize;
}

.calendar-nav .btn-nav {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dtp-text-muted);
  transition: all 0.2s ease;
}

.calendar-nav .btn-nav:hover {
  background: var(--dtp-primary-light);
  color: var(--dtp-primary);
  transform: scale(1.05);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 12px;
}

.calendar-weekdays span {
  font-size: 12px;
  font-weight: 700;
  color: var(--dtp-text-muted);
  text-transform: uppercase;
  padding: 6px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--dtp-text-dark);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.calendar-day-cell:hover:not(.disabled):not(.selected) {
  background-color: var(--dtp-primary-light);
  color: var(--dtp-primary);
}

.calendar-day-cell.selected {
  background-color: var(--dtp-primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(26, 127, 55, 0.3);
}

.calendar-day-cell.disabled {
  color: #cbd5e1;
  cursor: not-allowed;
  font-weight: 400;
}

.calendar-day-cell.today:not(.selected) {
  border: 2px solid var(--dtp-primary);
  color: var(--dtp-primary);
}

/* Right Panel: Time Slots */
.custom-dtp-time-panel {
  flex: 0 0 40%;
  width: 40%;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.time-panel-header {
  font-weight: 800;
  font-size: 15px;
  color: var(--dtp-text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar for Time slots */
.time-slots-grid::-webkit-scrollbar {
  width: 6px;
}
.time-slots-grid::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
.time-slots-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.time-slots-grid::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.time-slot-pill {
  background: #ffffff;
  border: 1px solid var(--dtp-border-color);
  color: var(--dtp-text-dark);
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.time-slot-pill:hover:not(.disabled):not(.selected) {
  border-color: var(--dtp-primary);
  color: var(--dtp-primary);
  background: var(--dtp-primary-light);
}

.time-slot-pill.selected {
  background-color: var(--dtp-primary) !important;
  border-color: var(--dtp-primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(26, 127, 55, 0.2);
}

.time-slot-pill.disabled {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Footer Section */
.custom-dtp-footer {
  background: #ffffff !important;
  padding: 16px 24px !important;
  border-top: 1px solid var(--dtp-border-color) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.selected-datetime-summary {
  text-align: left;
}

.selected-datetime-summary .summary-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--dtp-text-muted);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.selected-datetime-summary .summary-value {
  font-size: 15px;
  color: var(--dtp-primary);
  font-weight: 700;
}

.btn-confirm-datetime {
  background: var(--dtp-primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(26, 127, 55, 0.2);
}

.btn-confirm-datetime:hover:not(:disabled) {
  background: var(--dtp-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(26, 127, 55, 0.3);
}

.btn-confirm-datetime:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Responsive bottom sheet for mobile */
@media (max-width: 767px) {
  .custom-dtp-wrapper {
    flex-direction: column;
  }

  .custom-dtp-calendar-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--dtp-border-color);
    padding: 16px;
  }

  .custom-dtp-time-panel {
    width: 100%;
    padding: 16px;
  }

  .time-slots-grid {
    grid-template-columns: repeat(4, 1fr);
    max-height: 180px;
  }

  /* Bottom sheet behavior on mobile */
  .modal.fade .modal-dialog {
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    margin: 0;
    max-width: 100%;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .modal.show .modal-dialog {
    transform: translateY(0);
  }

  .custom-dtp-content {
    border-radius: var(--dtp-radius) var(--dtp-radius) 0 0 !important;
  }
  
  .custom-dtp-footer {
    padding: 16px !important;
  }
}
