/**
 * Schedule step layout improvements
 */

/* Reduce overall rate limiting section height */
.rate-limiting-section {
  margin-top: 5px;
  margin-bottom: 5px;
}

/* Layout for single-row controls */
.rate-limiting-single-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  width: 100%;
}

/* Each third-width control */
.rate-limit-third {
  flex: 1;
  min-width: 0; /* Prevents flex items from overflowing */
  padding: 8px 12px;
  background-color: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* Make the third card (quiet hours) shorter */
.rate-limit-third:nth-child(3) {
  padding-top: 6px;
  padding-bottom: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Compact spacing for delay inputs */
.delay-inputs {
  display: flex;
  align-items: center;
  margin-top: 8px;
  flex-wrap: nowrap;
}

.delay-inputs.compact {
  gap: 5px;
}

.delay-inputs.compact .delay-input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.delay-inputs.compact input.delay-input {
  width: 50px;
  min-width: 50px;
  text-align: center;
}

/* Compact toggle control */
.toggle-control.compact {
  margin-top: 4px;
  margin-bottom: 2px;
}

.toggle-text.compact {
  padding-left: 5px;
}

/* Container for quiet hours toggle */
.quiet-hours-container {
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  max-height: 65px;
}

/* Compact hints */
.form-hint.compact {
  font-size: 11px;
  margin-top: 2px;
  margin-bottom: 0;
  line-height: 1.3;
}

/* Compact slider labels */
.slider-labels.compact {
  margin-top: 5px;
  font-size: 12px;
}

/* Control label adjustments */
.rate-limit-third .control-label {
  font-size: 14px;
  margin-bottom: 4px;
  margin-top: 0;
  font-weight: 500;
}

/* Ensure all elements take up minimal vertical space */
.rate-limit-third h3,
.rate-limit-third h4,
.rate-limit-third p {
  margin-top: 0;
  margin-bottom: 4px;
}

/* Reduce spacing between slider and its labels */
.rate-limit-third .slider {
  margin-bottom: 2px;
  margin-top: 5px;
}

/* Ultra-compact Quiet Hours card */
.quiet-hours-card {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* Enhanced Campaign Summary */
.enhanced-summary {
  margin-top: 20px;
  padding: 16px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.enhanced-summary h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 16px;
}

.enhanced-summary .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.enhanced-summary .summary-item {
  padding: 10px;
  background-color: white;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.enhanced-summary .summary-label {
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 5px;
  font-size: 14px;
}

.enhanced-summary .summary-value {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.quiet-hours-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.quiet-hours-time {
  font-weight: 500;
  font-size: 13px;
  margin: 2px 0;
  color: #4b5563;
}

/* Inline toggle switch for quiet hours */
.toggle-switch-inline {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.toggle-switch-inline .toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-inline .toggle-track {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .2s;
  border-radius: 34px;
}

.toggle-switch-inline .toggle-track:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

.toggle-switch-inline .toggle-checkbox:checked + .toggle-track {
  background-color: #2563eb;
}

.toggle-switch-inline .toggle-checkbox:checked + .toggle-track:before {
  transform: translateX(14px);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .rate-limiting-single-row {
    flex-direction: column;
  }
  
  .rate-limit-third {
    margin-bottom: 15px;
    padding: 16px;
  }
  
  .delay-inputs.compact {
    gap: 10px;
  }
  
  .delay-inputs.compact input.delay-input {
    width: 80px;
  }
}