/**
 * Booking Logic Visual Styles
 */

/* First Available Date Marker */
.hme-first-available {
    background: #e6fffa !important;
    border-color: #38b2ac !important;
    position: relative;
}

.hme-first-available::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #38b2ac;
    border-radius: 50%;
}

.hme-first-available.selected {
    background: #38b2ac !important;
    color: #fff !important;
}

/* Booking Notice Refinement */
.hme-booking-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff9db !important;
    color: #856404 !important;
    padding: 12px 16px !important;
    margin-bottom: 20px !important;
    border: 1px solid #ffe066 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.hme-booking-notice::before {
    content: 'i';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #fcc419;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    font-style: italic;
    font-size: 12px;
}

/* Flatpickr custom info on first available */

/* Reorder booking form elements - Travellers first, then packages */
.wte-process-tab-content {
    display: flex !important;
    flex-direction: column !important;
}

/* Travellers section first */
.wte-process-tab-content .wte-option-heading,
.wte-process-tab-content .wte-trip-options {
    order: 1 !important;
}

/* HR separator */
.wte-process-tab-content hr {
    order: 2 !important;
}

/* Package buttons last */
.wte-process-tab-content .wte-button-group.wte-package-type {
    order: 3 !important;
}

/* Guest Counter Layout Adjustments */
.wte-trip-guest-wrapper {
    display: flex !important;
    flex-direction: column !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid #eee !important;
    gap: 10px !important;
}

.wte-trip-guest-wrapper.horizontal {
    flex-direction: column !important;
}

.wte-trip-guest-wrapper .check-in-wrapper {
    order: 2;
    /* Label below */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wte-trip-guest-wrapper .select-wrapper {
    order: 1;
    /* Counter + Price above */
    display: flex !important;
    flex-direction: row-reverse !important;
    /* Move counter to the left/start */
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.wte-trip-guest-wrapper .amount-per-person {
    order: 2;
    margin: 0 !important;
}

.wte-trip-guest-wrapper .wte-qty-number {
    order: 1;
    margin: 0 !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    padding: 4px !important;
}

.wte-trip-guest-wrapper .wte-minimum-pax {
    font-size: 11px;
    color: #999;
}

/* Specific styling for the counter buttons */
.wte-qty-number button {
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.wte-qty-number button:hover:not(:disabled) {
    border-color: #007bff !important;
    color: #007bff !important;
}

.wte-qty-number input {
    width: 35px !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Enhanced First Available Date */
.hme-first-available {
    background: #d4af37 !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    position: relative;
}

.hme-first-available:hover {
    background: #a67c00 !important;
}

.hme-first-available::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 10px;
    color: #fff;
}

/* Disabled Today */
.hme-today-disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    text-decoration: line-through;
    background: #f5f5f5 !important;
    color: #999 !important;
}

.hme-today-disabled:hover {
    background: #f5f5f5 !important;
    color: #999 !important;
}

/* Location Selector */
.hme-location-selector {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fff9db 0%, #fff3bf 100%);
    border: 2px solid #fcc419;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hme-location-selector label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 16px;
    color: #856404;
}

.hme-location-selector > div {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.hme-location-selector select {
    flex: 1;
    min-width: 180px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
}

.hme-location-selector select:focus {
    outline: none;
    border-color: #fcc419;
    box-shadow: 0 0 0 3px rgba(252, 196, 25, 0.2);
}

.hme-location-selector button {
    padding: 10px 24px;
    background: linear-gradient(135deg, #d4af37 0%, #a67c00 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.hme-location-selector button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #a67c00 0%, #8b6910 100%);
}

.hme-location-selector button:active {
    transform: translateY(0);
}

/* RTL Support */
[dir="rtl"] .hme-location-selector > div,
body.rtl .hme-location-selector > div {
    flex-direction: row-reverse;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hme-booking-notice {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .hme-location-selector {
        padding: 15px;
    }
    
    .hme-location-selector > div {
        flex-direction: column;
    }
    
    .hme-location-selector select,
    .hme-location-selector button {
        width: 100%;
        min-width: 100%;
    }
}

/* Location Permission Popup */
.hme-location-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: hme-fadeIn 0.3s ease;
}

@keyframes hme-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hme-location-popup-content {
    background: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: hme-slideUp 0.3s ease;
    position: relative;
}

@keyframes hme-slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hme-location-popup-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: hme-bounce 1s ease infinite;
}

@keyframes hme-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hme-location-popup-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.hme-location-popup-message {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.hme-location-popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hme-location-popup-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.hme-location-popup-btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #a67c00 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.hme-location-popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, #a67c00 0%, #8b6910 100%);
}

.hme-location-popup-btn-primary:active {
    transform: translateY(0);
}

.hme-location-popup-btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.hme-location-popup-btn-secondary:hover {
    background: #e9e9e9;
    border-color: #bbb;
    color: #333;
}

/* RTL Support */
[dir="rtl"] .hme-location-popup-content,
body.rtl .hme-location-popup-content {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .hme-location-popup-buttons,
body.rtl .hme-location-popup-buttons {
    flex-direction: row-reverse;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hme-location-popup-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .hme-location-popup-title {
        font-size: 20px;
    }
    
    .hme-location-popup-message {
        font-size: 14px;
    }
    
    .hme-location-popup-buttons {
        flex-direction: column;
    }
    
    .hme-location-popup-btn {
        width: 100%;
        min-width: 100%;
    }
}

/* Hotel variation selector inside booking modal */
.hme-hotel-variation {
    margin-bottom: 20px;
    padding: 16px 18px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #d0d7ff;
}

.hme-hotel-variation-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.hme-hotel-variation-title {
    font-weight: 600;
    font-size: 15px;
    color: #1f2933;
}

.hme-hotel-variation-subtitle {
    font-size: 12px;
    color: #6b7280;
}

.hme-hotel-variation-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hme-hotel-option {
    cursor: pointer;
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    transition: all 0.2s ease;
}

.hme-hotel-option:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

.hme-hotel-option input[type="radio"] {
    accent-color: #6366f1;
}

.hme-hotel-option-main {
    font-size: 14px;
    color: #111827;
}

.hme-hotel-variation-error {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 12px;
}

/* RTL support for hotel selector */
[dir="rtl"] .hme-hotel-variation,
body.rtl .hme-hotel-variation {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .hme-hotel-variation-options,
body.rtl .hme-hotel-variation-options {
    flex-direction: row-reverse;
}