/**
 * OpenTime Public Styles
 *
 * @package OpenTime
 */

.ot-booking-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Service Header */
.ot-service-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.ot-service-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #23282d;
}

.ot-service-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #50575e;
}

.ot-service-location {
    color: #50575e;
    font-size: 14px;
}

/* Form Sections */
.ot-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ot-form-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #23282d;
}

/* Form Fields */
.ot-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.ot-form-field {
    margin-bottom: 15px;
}

.ot-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #23282d;
}

.ot-required {
    color: #dc3232;
}

.ot-input,
.ot-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.ot-input:focus,
.ot-textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.ot-textarea {
    min-height: 100px;
    resize: vertical;
}

.ot-field-description {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #646970;
    font-style: italic;
}

/* Time Slots */
.ot-no-slots {
    padding: 20px;
    text-align: center;
    color: #646970;
    font-style: italic;
}

.ot-slots-list {
    margin-top: 20px;
}

.ot-date-group {
    margin-bottom: 25px;
}

.ot-date-header {
    margin: 0 0 15px 0;
    padding: 10px 15px;
    background: #0073aa;
    color: #fff;
    font-size: 16px;
    border-radius: 4px;
}

.ot-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.ot-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.ot-slot:hover {
    border-color: #0073aa;
    background: #f0f6fc;
}

.ot-slot input[type="radio"] {
    margin-bottom: 8px;
}

.ot-slot input[type="radio"]:checked ~ .ot-slot-time,
.ot-slot input[type="radio"]:checked ~ .ot-slot-available {
    color: #0073aa;
}

.ot-slot:has(input[type="radio"]:checked) {
    border-color: #0073aa;
    background: #f0f6fc;
    box-shadow: 0 0 0 1px #0073aa;
}

.ot-slot-time {
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    margin-bottom: 5px;
}

.ot-slot-available {
    font-size: 12px;
    color: #646970;
}

/* Form Actions */
.ot-form-actions {
    margin-top: 20px;
    text-align: center;
}

.ot-submit-button {
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ot-submit-button:hover {
    background: #005a87;
}

.ot-submit-button:active {
    background: #004a6f;
}

/* Confirmation */
.ot-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.ot-confirmation-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    line-height: 80px;
    background: #00a32a;
    color: #fff;
    font-size: 48px;
    border-radius: 50%;
}

.ot-confirmation-title {
    margin: 0 0 20px 0;
    font-size: 28px;
    color: #23282d;
}

.ot-confirmation-details {
    margin-top: 20px;
}

.ot-booking-summary {
    margin: 30px auto;
    max-width: 500px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
}

.ot-booking-summary h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #23282d;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.ot-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.ot-summary-row:last-child {
    border-bottom: none;
}

.ot-summary-row strong {
    color: #23282d;
}

.ot-summary-row span {
    color: #50575e;
    text-align: right;
}

.ot-confirmation-note {
    margin-top: 20px;
    padding: 15px;
    background: #f0f6fc;
    border-left: 4px solid #0073aa;
    font-size: 14px;
    color: #50575e;
}

/* Errors */
.ot-error,
.ot-errors {
    padding: 15px;
    margin-bottom: 20px;
    background: #fef7f7;
    border-left: 4px solid #dc3232;
    color: #dc3232;
}

.ot-errors ul {
    margin: 0;
    padding-left: 20px;
}

.ot-errors li {
    margin-bottom: 5px;
}

.ot-errors li:last-child {
    margin-bottom: 0;
}

/* Input error state */
.ot-input-error {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 1px #dc3232 !important;
}

.ot-input-error:focus {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 1px #dc3232 !important;
}

/* ============================================
   Calendar UI Styles (v0.2)
   ============================================ */

.ot-calendar-container {
    margin-bottom: 20px;
}

.ot-calendar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.ot-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #0073aa;
    color: #fff;
}

.ot-calendar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ot-calendar-nav {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.ot-calendar-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ot-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.ot-calendar-weekday {
    padding: 10px 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.ot-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 10px;
    background: #f5f5f5;
    transition: opacity 0.2s;
}

.ot-calendar-day {
    position: relative;
    min-height: 50px;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    cursor: default;
    transition: all 0.2s;
}

.ot-calendar-day-empty {
    background: transparent;
}

.ot-calendar-day-past {
    background: #f9f9f9;
    color: #ccc;
}

.ot-calendar-day-available {
    cursor: pointer;
    background: #e8f5e9;
    border: 2px solid transparent;
}

.ot-calendar-day-available:hover {
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ot-calendar-day-selected {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

.ot-calendar-day-selected .ot-day-indicator {
    background: #fff;
    color: #0073aa;
}

.ot-calendar-day-today {
    font-weight: bold;
}

.ot-calendar-day-today::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #0073aa;
    border-radius: 50%;
}

.ot-calendar-day-selected.ot-calendar-day-today::before {
    background: #fff;
}

.ot-day-number {
    display: block;
    font-size: 14px;
}

.ot-day-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #4caf50;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

.ot-calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
    gap: 10px;
}

.ot-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: ot-spin 0.8s linear infinite;
}

@keyframes ot-spin {
    to { transform: rotate(360deg); }
}

/* Time Slots Panel */
.ot-timeslots-panel {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.ot-timeslots-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #23282d;
    text-transform: capitalize;
}

.ot-timeslots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.ot-timeslot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.ot-timeslot:hover {
    border-color: #0073aa;
    background: #f0f6fc;
}

.ot-timeslot-selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
}

.ot-timeslot-selected .ot-timeslot-time,
.ot-timeslot-selected .ot-timeslot-available {
    color: #fff;
}

.ot-timeslot-time {
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
}

.ot-timeslot-available {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* Service Selector */
.ot-service-selector {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.ot-service-selector h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #23282d;
}

.ot-service-select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.ot-service-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Responsive */
@media (max-width: 600px) {
    .ot-form-row {
        grid-template-columns: 1fr;
    }
    
    .ot-slots-grid {
        grid-template-columns: 1fr;
    }
    
    .ot-booking-wrapper {
        padding: 10px;
    }

    .ot-calendar-day {
        min-height: 40px;
        padding: 5px;
    }

    .ot-day-number {
        font-size: 12px;
    }

    .ot-day-indicator {
        min-width: 14px;
        height: 14px;
        font-size: 9px;
        line-height: 14px;
    }

    .ot-calendar-nav {
        padding: 6px 10px;
        font-size: 12px;
    }

    .ot-calendar-title {
        font-size: 14px;
    }

    .ot-timeslots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .ot-timeslots-grid {
        grid-template-columns: 1fr;
    }
}
