/**
 * Timeslot Field Styles
 * Copyright (C) 2025 blaho.hu
 */

/* Fieldset wrapper */
.timeslot-fieldset {
   border: none;
   padding: 0;
   margin: 0;
}

.timeslot-fieldset legend {
   position: absolute;
   width: 1px;
   height: 1px;
   padding: 0;
   margin: -1px;
   overflow: hidden;
   clip: rect(0, 0, 0, 0);
   white-space: nowrap;
   border: 0;
}

/* Radio/Checkbox wrapper */
.timeslot-radio,
.timeslot-checkbox {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 10px 12px;
   margin-bottom: 8px;
   border: 1px solid #ddd;
   border-radius: 4px;
   background-color: #fff;
   transition: all 0.3s ease;
}

.timeslot-radio:hover,
.timeslot-checkbox:hover {
   border-color: #0066cc;
   background-color: #f8f9fa;
}

/* Input elements */
.timeslot-radio input[type="radio"],
.timeslot-checkbox input[type="checkbox"] {
   margin: 0;
   cursor: pointer;
}

/* Label */
.timeslot-label {
   flex: 1;
   margin: 0;
   cursor: pointer;
   font-weight: 500;
   color: #333;
}

/* Availability info */
.timeslot-availability {
   font-size: 14px;
   color: #28a745;
   font-weight: 500;
   padding: 2px 8px;
   background-color: #d4edda;
   border-radius: 3px;
}

/* Full indicator */
.timeslot-full {
   font-size: 14px;
   color: #dc3545;
   font-weight: 500;
   padding: 2px 8px;
   background-color: #f8d7da;
   border-radius: 3px;
}

/* Disabled state */
.timeslot-radio input[type="radio"]:disabled,
.timeslot-checkbox input[type="checkbox"]:disabled {
   cursor: not-allowed;
   opacity: 0.5;
}

.timeslot-radio:has(input:disabled),
.timeslot-checkbox:has(input:disabled) {
   opacity: 0.6;
   background-color: #f5f5f5;
   cursor: not-allowed;
}

.timeslot-radio:has(input:disabled) .timeslot-label,
.timeslot-checkbox:has(input:disabled) .timeslot-label {
   text-decoration: line-through;
   color: #999;
   cursor: not-allowed;
}

.timeslot-radio:has(input:disabled):hover,
.timeslot-checkbox:has(input:disabled):hover {
   border-color: #ddd;
   background-color: #f5f5f5;
}

/* Checked state */
.timeslot-radio:has(input:checked),
.timeslot-checkbox:has(input:checked) {
   border-color: #0066cc;
   background-color: #e7f3ff;
}

.timeslot-radio:has(input:checked) .timeslot-label,
.timeslot-checkbox:has(input:checked) .timeslot-label {
   color: #0066cc;
}

/* Layout variations */

/* Horizontal layout */
.timeslot-horizontal {
   display: inline-flex;
   margin-right: 12px;
   margin-bottom: 8px;
}

/* Vertical layout (default) */
.timeslot-vertical {
   display: flex;
   width: 100%;
}

/* Column layouts */
.timeslot-vertical2columns,
.timeslot-vertical3columns,
.timeslot-vertical4columns,
.timeslot-vertical6columns {
   display: flex;
   width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
   .timeslot-radio,
   .timeslot-checkbox {
      padding: 8px 10px;
      font-size: 14px;
   }
   
   .timeslot-availability,
   .timeslot-full {
      font-size: 12px;
      padding: 2px 6px;
   }
   
   .timeslot-horizontal {
      display: flex;
      width: 100%;
      margin-right: 0;
   }
}

/* Focus state */
.timeslot-radio input[type="radio"]:focus,
.timeslot-checkbox input[type="checkbox"]:focus {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
}

/* Admin preview */
.preview-radio .timeslot-radio,
.preview-radio .timeslot-checkbox {
   pointer-events: none;
}

/* Error state */
.rsform-error .timeslot-radio,
.rsform-error .timeslot-checkbox {
   border-color: #dc3545;
   background-color: #f8d7da;
}

/* Max selection reached state (v2.7.4) */
.timeslot-checkbox.timeslot-max-reached {
   opacity: 0.5;
   cursor: not-allowed;
}

.timeslot-checkbox.timeslot-max-reached input[type="checkbox"]:disabled {
   cursor: not-allowed;
}

.timeslot-checkbox.timeslot-max-reached .timeslot-label {
   color: #999;
   cursor: not-allowed;
}

/* Capacity disabled state (v2.7.4) - full slots */
.timeslot-radio.timeslot-disabled,
.timeslot-checkbox.timeslot-disabled {
   /* Keep normal styling for capacity-disabled - user should see it's full */
}

.timeslot-radio.timeslot-disabled input[type="radio"]:disabled,
.timeslot-checkbox.timeslot-disabled input[type="checkbox"]:disabled {
   cursor: not-allowed;
}

.timeslot-radio.timeslot-disabled .timeslot-label,
.timeslot-checkbox.timeslot-disabled .timeslot-label {
   color: #666;
   cursor: not-allowed;
}

/* Warning banner for impossible MIN (v2.7.4) */
.timeslot-warning {
   background-color: #fff3cd;
   border: 1px solid #ffc107;
   border-radius: 4px;
   padding: 12px 16px;
   margin-bottom: 15px;
   color: #856404;
   font-size: 14px;
   line-height: 1.5;
}

.timeslot-warning strong {
   font-size: 18px;
   margin-right: 8px;
}

.timeslot-warning-impossible-min {
   background-color: #fff3cd;
   border-color: #ffc107;
}

/* Warning banner - strict mode (adjust disabled) */
.timeslot-warning.timeslot-warning-strict {
   background-color: #f8d7da;
   border-color: #dc3545;
   color: #721c24;
}
