/**
 * Multi-Unit Booking Styles
 * Stílusok a több egységes foglalási rendszerhez
 */

/* ========================================
   Multi-Unit Gallery - Full Width Slider
   ======================================== */

.gallery-full-width-container {
    width: 100% !important;
    margin: 0 !important; /* No margin - removes gap */
    padding: 0 !important;
    max-width: none !important;
    position: relative;
    min-height: 300px !important; /* Ensure minimum height */
    display: block !important; /* Force display */
    visibility: visible !important; /* Force visibility */
}

.gallery-full-width-container .imagebody_wrapper {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.gallery-full-width-container .imagebody {
    border-radius: 0 !important;
}

.gallery-full-width-container .panel-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* Ensure carousel takes full width */
.gallery-full-width-container #carousel-listing {
    width: 100% !important;
    border-radius: 0 !important;
    min-height: 300px !important;
}

/* Ensure images are visible and properly sized */
.gallery-full-width-container .carousel-inner .item img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Video container */
.gallery-full-width-container .carousel-inner .item.videoitem_full iframe {
    width: 100% !important;
    min-height: 400px !important;
}

.gallery-full-width-container .carousel-inner,
.gallery-full-width-container .item {
    border-radius: 0 !important;
}

/* Prevent horizontal scroll */
body.single-estate_property {
    overflow-x: hidden;
}

/* Remove gap between gallery and content */
.gallery-full-width-container + .container.main_wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ========================================
   Multi-Unit Section
   ======================================== */

/* Remove top spacing after gallery */
.listing_type_multiunit {
    margin-top: 0 !important;
    padding-top: 20px !important; /* Small top padding for breathing room */
}

/* Property Title in Multi-Unit Listing */
.listing_type_multiunit .listing_type_title_wrapper {
    margin: 30px 0 20px 0;
    padding: 0 15px;
}

.listing_type_multiunit .entry-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.listing_type_multiunit .listing_main_image_location {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.multi-unit-section {
    margin: 0 0 30px 0; /* No top margin, only bottom */
}

.property_unit_title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e1e1;
}

/* ========================================
   Multi-Unit Date Selector
   ======================================== */

.multi-unit-date-selector {
    background: #667eea; /* Single color - will be overridden by header color via dynamic CSS */
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.date-selector-title {
    text-align: center;
    margin-bottom: 25px;
}

.date-selector-title h3 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.date-selector-title p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
}

.date-selector-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.date-field-group {
    display: flex;
    flex-direction: column;
}

.date-field-group label {
    color: #fff;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-field-group label i {
    font-size: 16px;
}

.date-field-group .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.date-field-group .form-control:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: #fff;
}

.date-field-group .form-control:focus {
    outline: none;
    border-color: #fff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.date-field-group select.form-control {
    cursor: pointer;
}

.date-field-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.search-dates-btn,
.clear-dates-btn {
    padding: 12px 24px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    border: 2px solid transparent !important;
}

.search-dates-btn {
    background: #fff !important;
    color: #667eea !important;
}

.search-dates-btn:hover {
    background: #f0f0f0 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.clear-dates-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.clear-dates-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

/* jQuery UI Datepicker kiemelés */
.ui-datepicker .date-in-range {
    background: #e3f2fd !important;
}

/* ========================================
   Search Results Info
   ======================================== */

.search-results-info {
    background: #e7f3ff;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.search-results-display {
    margin: 0;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-results-display i.fas {
    color: #0073aa;
}

.date-range {
    font-weight: 600;
    color: #0073aa;
}

.guest-filter {
    color: #666;
}

/* ========================================
   No Units Available Message
   ======================================== */

.no-units-available {
    background: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 4px;
    padding: 30px;
    text-align: center;
}

.no-units-message {
    margin: 0;
    font-size: 16px;
    color: #856404;
}

/* ========================================
   Multi-Unit Table
   ======================================== */

.multi-unit-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.multi-unit-table thead th {
    background: #f1f1f1;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.multi-unit-table .check-column {
    width: 50px !important;
    min-width: 50px !important;
    text-align: center !important;
    padding: 12px !important;
    display: table-cell !important; /* Force display */
    visibility: visible !important; /* Force visibility */
}

.multi-unit-table thead .check-column {
    vertical-align: middle !important;
}

.multi-unit-table tbody .check-column {
    vertical-align: middle !important;
}

.multi-unit-table .column-type {
    width: 15%;
}

.multi-unit-table .column-name {
    width: 25%;
}

.multi-unit-table .column-guests {
    width: 12%;
}

.multi-unit-table .column-price {
    width: 15%;
}

.multi-unit-table .column-availability {
    width: 150px;
}

.multi-unit-table tbody td {
    padding: 15px 12px;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: middle;
}

.multi-unit-table .unit-row:hover {
    background: #f9f9f9;
}

.multi-unit-table .unit-row.selected {
    background: #e7f3ff;
}

.multi-unit-table .unit-checkbox,
.multi-unit-table #select-all-units {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    display: inline-block !important; /* Force display */
    visibility: visible !important; /* Force visibility */
    opacity: 1 !important; /* Ensure not transparent */
    position: relative !important; /* Prevent absolute positioning */
    margin: 0 auto !important;
    -webkit-appearance: checkbox !important; /* iOS Safari */
    -moz-appearance: checkbox !important; /* Firefox */
    appearance: checkbox !important; /* Standard */
}

.multi-unit-table .room-name strong {
    color: #333;
    font-size: 15px;
}

.multi-unit-table .guest-capacity {
    color: #666;
}

.multi-unit-table .unit-price {
    font-weight: 600;
    color: #0073aa;
    font-size: 16px;
}

/* ========================================
   Mini Calendar Button
   ======================================== */

.show-mini-calendar-btn {
    padding: 6px 12px;
    font-size: 13px;
}

.mini-calendar-container {
    margin-top: 10px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mini-calendar-loading,
.mini-calendar-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.mini-calendar-error {
    color: #d63638;
}

/* ========================================
   Mini Calendar
   ======================================== */

.mini-calendar {
    font-size: 12px;
}

.mini-calendar-month {
    margin-bottom: 15px;
}

.mini-calendar-month:last-child {
    margin-bottom: 0;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    padding: 8px;
    background: #f1f1f1;
    border-radius: 4px 4px 0 0;
    margin-bottom: 5px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    padding: 5px;
    color: #666;
    font-size: 11px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
    font-size: 11px;
    cursor: default;
}

.calendar-day.empty {
    border: none;
    background: transparent;
}

.calendar-day.past {
    background: #f5f5f5;
    color: #aaa;
}

.calendar-day.available {
    background: #e7f5e7;
    color: #2e7d32;
    cursor: pointer;
}

.calendar-day.available:hover {
    background: #c8e6c9;
    box-shadow: 0 0 0 2px #4caf50;
}

.calendar-day.booked {
    background: #ffebee;
    color: #c62828;
}

.calendar-day.today {
    font-weight: 700;
    box-shadow: 0 0 0 2px #0073aa;
}

/* ========================================
   Multi-Unit Summary
   ======================================== */

.multi-unit-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 4px;
    margin-top: 20px;
}

.summary-info {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.summary-info span {
    font-size: 15px;
    color: #666;
}

.summary-info strong {
    color: #333;
    font-weight: 600;
}

.book-selected-units-btn {
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.book-selected-units-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Booking Modal
   ======================================== */

.multi-unit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.multi-unit-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.multi-unit-modal .modal-content {
    position: relative;
    max-width: 600px;
    margin: 50px auto;
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
}

.multi-unit-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 700;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.multi-unit-modal .close-modal:hover {
    color: #333;
}

.multi-unit-modal .modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.multi-unit-modal .modal-content h3 {
    margin: 20px 0 10px 0;
    font-size: 18px;
    color: #555;
}

/* Selected Units List */
.multi-unit-modal .selected-units-list {
    background: #f7f7f7;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.multi-unit-modal .selected-units-list ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.multi-unit-modal .selected-units-list li {
    padding: 10px;
    background: #fff;
    margin-bottom: 8px;
    border-radius: 3px;
}

.multi-unit-modal .selected-units-list li:last-child {
    margin-bottom: 0;
}

/* Booking Details */
.multi-unit-modal .booking-details {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.multi-unit-modal .booking-dates {
    margin-bottom: 10px;
}

.multi-unit-modal .booking-totals > div {
    margin: 5px 0;
}

.multi-unit-modal .total-price-display {
    font-size: 18px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
}

/* Guest Details Form */
.multi-unit-modal .guest-details {
    margin-bottom: 20px;
}

.multi-unit-modal .form-group {
    margin-bottom: 15px;
}

.multi-unit-modal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.multi-unit-modal .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.multi-unit-modal .form-group input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Modal Actions */
.multi-unit-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.multi-unit-modal .modal-actions button {
    padding: 12px 24px !important;
    font-size: 15px !important;
}

body.modal-open {
    overflow: hidden;
}

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

@media (max-width: 768px) {
    /* Date Selector mobilon */
    .multi-unit-date-selector {
        padding: 20px;
    }

    .date-selector-title h3 {
        font-size: 20px;
    }

    .date-selector-fields {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .date-field-actions {
        flex-direction: column;
        width: 100%;
    }

    .search-dates-btn,
    .clear-dates-btn {
        width: 100%;
        justify-content: center;
    }

    /* Táblázat mobilon */
    .multi-unit-table,
    .multi-unit-table thead,
    .multi-unit-table tbody,
    .multi-unit-table th,
    .multi-unit-table td,
    .multi-unit-table tr {
        display: block;
    }

    .multi-unit-table thead {
        display: none;
    }

    .multi-unit-table tbody tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px;
    }

    .multi-unit-table tbody tr.selected {
        border-color: #0073aa;
        border-width: 2px;
    }

    .multi-unit-table tbody td {
        border: none;
        padding: 8px 10px;
        position: relative;
        padding-left: 40%;
    }

    .multi-unit-table tbody td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: 600;
        color: #666;
    }

    .multi-unit-table .check-column {
        padding-left: 10px !important;
        text-align: left !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .multi-unit-table .check-column:before {
        content: attr(data-label);
        position: relative !important;
        left: auto !important;
        font-weight: 600;
        color: #666;
        flex-shrink: 0;
    }

    .multi-unit-table .check-column input[type="checkbox"] {
        flex-shrink: 0;
        margin: 0 !important;
    }

    /* Summary */
    .multi-unit-summary {
        flex-direction: column;
        gap: 15px;
    }

    .summary-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .book-selected-units-btn {
        width: 100%;
    }

    /* Modal */
    .multi-unit-modal .modal-content {
        margin: 20px;
        padding: 20px;
        max-height: calc(100vh - 40px);
    }

    .multi-unit-modal .modal-actions {
        flex-direction: column;
    }

    .multi-unit-modal .modal-actions button {
        width: 100%;
    }

    /* Calendar */
    .calendar-grid {
        gap: 1px;
    }

    .calendar-day {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .property_unit_title {
        font-size: 20px;
    }

    .multi-unit-date-selector {
        padding: 15px;
        border-radius: 6px;
    }

    .date-selector-title h3 {
        font-size: 18px;
    }

    .date-selector-title p {
        font-size: 13px;
    }

    .date-field-group label {
        font-size: 13px;
    }

    .date-field-group .form-control {
        padding: 10px 12px;
        font-size: 13px;
    }

    .search-dates-btn,
    .clear-dates-btn {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }

    .search-results-info {
        padding: 12px 15px;
    }

    .search-results-display {
        font-size: 13px;
    }
}
