/**
 * RVBT Booking - Restrictions Styles
 * Additional styles for search form with restrictions support
 *
 * @package RVBTBooking
 * @since 1.0.0
 */

/* ============================================================================
   Category Selector
   ============================================================================ */

.rvbtbooking-category-wrap {
    display: inline-block;
    vertical-align: top;
}

.rvbtbooking-category-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rvbtbooking-text, #333);
}

.rvbtbooking-category-select {
    height: 48px;
    padding: 10px 35px 10px 15px;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23333" d="M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.rvbtbooking-category-select:hover {
    border-color: #999;
}

.rvbtbooking-category-select:focus {
    outline: none;
    border-color: var(--rvbtbooking-primary, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.rvbtbooking-category-select option:disabled {
    color: #ccc;
    font-style: italic;
}

/* ============================================================================
   Nights Display
   ============================================================================ */


.rvbtbooking-nights-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
}

.rvbtbooking-nights-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rvbtbooking-primary, #007bff);
    min-width: 30px;
    text-align: center;
}

/* ============================================================================
   Human-Readable Date Display Enhancements
   ============================================================================ */

.rvbtbooking-date-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rvbtbooking-date-placeholder {
    color: #999;
    font-size: 0.938rem;
}

.rvbtbooking-date-mday {
    font-size: 1.4rem;
    font-weight: 700;
    color: #5a5a5a;
    line-height: 0.9;
}

.rvbtbooking-date-details {
    display: none;
    flex-direction: row;
    gap: 0.25rem;
}

.rvbtbooking-date-details.active,
.rvbtbooking-date-display:not(:has(.rvbtbooking-date-placeholder)) .rvbtbooking-date-details {
    display: flex;
}

.rvbtbooking-date-month {
    font-weight: 400;
    font-size: 0.813rem;
    color: #666;
    line-height: 1;
}

.rvbtbooking-date-year,
.rvbtbooking-date-wday {
    font-size: 0.813rem;
    color: #666;
    line-height: 1;
}

/* ============================================================================
   Restriction Errors
   ============================================================================ */

.rvbtbooking-restriction-error {
    display: none;
    padding: 12px 15px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #ef4444;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 0.875rem;
    line-height: 1.5;
}

.rvbtbooking-restriction-error.active {
    display: block;
}

.rvbtbooking-restriction-error::before {
    content: "⚠ ";
    font-weight: bold;
    margin-right: 4px;
}

.rvbtbooking-errors-container {
    margin: 15px 0;
}

/* ============================================================================
   Datepicker Enhancements
   ============================================================================ */

/* Disabled dates in datepicker */
.ui-datepicker .ui-state-disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
    pointer-events: none;
}

.ui-datepicker .ui-state-disabled .ui-state-default {
    background-color: #f5f5f5;
    color: #ccc;
    border-color: #e0e0e0;
}

/* Highlight current selection */
.ui-datepicker .ui-datepicker-current-day .ui-state-active {
    background-color: var(--rvbtbooking-primary, #007bff);
    color: #fff;
    border-color: var(--rvbtbooking-primary, #007bff);
}

/* Closing dates special styling */
.ui-datepicker .ui-state-disabled.closing-date {
    background-color: #ffe0e0;
}

/* ============================================================================
   Form Layout Adjustments
   ============================================================================ */

.rvbtbooking-human-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 20px;
}

.rvbtbooking-form-row-with-category {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
}

/* ============================================================================
   Restriction Info Badges (for search results)
   ============================================================================ */

.rvbtbooking-room-restrictions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.restriction-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.restriction-badge[data-type="minlos"] {
    background-color: #fff3e0;
    color: #e65100;
    border-color: #ffe0b2;
}

.restriction-badge[data-type="maxlos"] {
    background-color: #fce4ec;
    color: #c2185b;
    border-color: #f8bbd0;
}

/* ============================================================================
   Loading States
   ============================================================================ */

.rvbtbooking-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.rvbtbooking-loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--rvbtbooking-primary, #007bff);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: rvbtbooking-spin 1s linear infinite;
}

@keyframes rvbtbooking-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .rvbtbooking-human-row,
    .rvbtbooking-form-row-with-category {
        flex-direction: column;
        align-items: stretch;
    }

    .rvbtbooking-date-card-wrap,
    .rvbtbooking-category-wrap,
    .rvbtbooking-nights-wrap {
        width: 100%;
    }

    .rvbtbooking-category-select {
        width: 100%;
    }

    .rvbtbooking-nights-wrap {
        justify-content: center;
    }

    /* Stack datepicker months vertically on mobile */
    .ui-datepicker {
        width: 100% !important;
    }

    .ui-datepicker-group {
        width: 100% !important;
    }
}

@media (max-width: 580px) {
    .rvbtbooking-date-mday {
        font-size: 1.5rem;
    }

    .rvbtbooking-nights-count {
        font-size: 1.25rem;
    }
}

/* ============================================================================
   Accessibility
   ============================================================================ */

.rvbtbooking-category-select:focus-visible,
.rvbtbooking-date-card:focus-within {
    outline: 2px solid var(--rvbtbooking-primary, #007bff);
    outline-offset: 2px;
}

/* Screen reader only text */
.rvbtbooking-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .rvbtbooking-restriction-error {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }

    .rvbtbooking-loading-overlay {
        display: none;
    }
}

/* ============================================================================
   Frontend Restriction Note (below search form)
   ============================================================================ */

.vbo-horsearch-restrictions-note {
    padding: 10px 15px;
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    margin: 10px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.vbo-horsearch-restrictions-note i.fa-info-circle {
    color: #007bff;
    margin-right: 5px;
}

.vbo-horsearch-restrictions-note .vbo-restr-first {
    color: #333;
}

.vbo-horsearch-restrictions-note .vbo-restr-more {
    display: none;
    color: #555;
}

.vbo-horsearch-restrictions-note .vbo-restr-more.show {
    display: inline;
}

.vbo-horsearch-restrictions-note .vbo-restr-phone {
    color: #555;
    margin-left: 5px;
}

.vbo-horsearch-restrictions-note .vbo-restr-phone a {
    color: #007bff;
    text-decoration: none;
}

.vbo-horsearch-restrictions-note .vbo-restr-phone a:hover {
    text-decoration: underline;
}

.vbo-horsearch-restrictions-note .vbo-restr-toggle {
    cursor: pointer;
    margin-left: 5px;
    color: #007bff;
    transition: transform 0.2s ease;
}

.vbo-horsearch-restrictions-note .vbo-restr-toggle.expanded i {
    transform: rotate(90deg);
}

.vbo-horsearch-restrictions-note .vbo-restr-toggle:hover {
    color: #0056b3;
}
