/**
 * Copyright © Catrion. All rights reserved.
 */

/* Image Upload Styles - Working Example Implementation */
.image-upload-area {
    position: relative;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: #ebeef070;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-area.drag-over {
    border-color: #1979c3;
    background: #eaf4ff;
}

.upload-placeholder {
    color: #777;
    pointer-events: none; /* allow clicks to pass through to input */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-placeholder i {
    font-size: 34px;
    width: 54px;
    text-align: center;
    margin: 0 auto;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00426d;
}

.upload-placeholder strong {
    font-size: 14px;
    display: block;
    color: #616161;
}

.upload-placeholder span {
    font-size: 16px;
    color: #868686;
}

/* The actual file input */
.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
    border: none;
    background: transparent;
}

/* Image preview container */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.image-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Remove button */
.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 16px;
    line-height: 20px;
    text-align: center;
    padding: 0;
}

.remove-image:hover {
    background: rgba(255, 0, 0, 0.8);
}

.input-field-wrapper #description {
    min-height: 300px;
    max-height: 300px;
    border-color: #b1a38b;
    resize: vertical;
    padding: 12px 16px;
}

#service_hours_availability {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 47px;
}

.input-field-wrapper.terms_conditions {
    width: 100%;
}

.input-field-wrapper.terms_conditions #terms_and_conditions {
    min-height: 230px;
    max-height: 230px;
    border-color: #b1a38b;
    resize: vertical;
    padding: 12px 16px;
    border-radius: 8px;
}

/* Price Input with Currency Symbol */
.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 15px;
    font-weight: 600;
    color: #333;
    z-index: 1;
}

.price-input-wrapper input {
    padding-left: 50px;
}

/* Checkbox Wrapper for Booking Options */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

/* New Slot Management Styles */
.slot-rows-container {
    display: flex;
    flex-direction: column;
    gap: 17px;
    margin-bottom: 15px;
}

.slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    justify-content: space-between;
}

.slot-row .input-field-wrapper {
    margin-bottom: 0;
}

.slot-row .edit-availability-btn {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #b1a38b;
    box-shadow: 0px 1px 2px 0px #1018280d;
    background: transparent;
    color: #b1a38b;
    font-size: 20px;
    border-radius: 8px;
}

.slot-row .edit-availability-btn:hover {
    border-color: #b1a38b;
    background-color: #b1a38b;
    color: #fff;
}

.slot-row .remove-slot-row {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #b1a38b;
    box-shadow: 0px 1px 2px 0px #1018280d;
    background: transparent;
    color: #852221;
    font-size: 20px;
    border-radius: 8px;
}

.slot-row .remove-slot-row:hover {
    border-color: #852221;
    background-color: #852221;
    color: #fff;
}

/* Time Slots Popup Styles */
.time-slots-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.time-slot-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.time-slot-row {
    display: flex;
    gap: 10px;
}

.time-slot-row .time-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.time-slot-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    background: white;
}

.time-slot-input:hover {
    border-color: #1979c3;
}

.remove-time-slot {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-time-slot:hover {
    background: #c82333;
}

.add-time-slot-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px dashed #1979c3;
    color: #1979c3;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.add-time-slot-btn:hover {
    background: #f0f8ff;
    border-style: solid;
}

/* Time Picker Popup */
.time-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.time-picker-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    width: 90%;
}

.time-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.time-picker-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.close-time-picker {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-time-picker:hover {
    color: #333;
}

.time-picker-content {
    padding: 20px;
}

.time-input-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.time-input-section .time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.time-input-section .time-input-group label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.time-picker-input {
    width: 60px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.time-picker-input:focus {
    border-color: #1979c3;
    outline: none;
}

.time-input-section .time-separator {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-top: 15px;
}

.time-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
}

/* Slot Management Styles */
.slot-management-section {
    display: none;
}

.slot-management-section .content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.slot-management-section.active {
    display: block;
}
.add-slots-btn , .update-slots-btn{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b1a38b;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    transition: all 0.3s ease;
    align-self: flex-start;
    margin-left: auto;
    padding: 0;
    border: 0;
    background-color: transparent;
}

.add-icon {
    font-size: 16px;
    font-weight: bold;
}

.slots-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.slot-item:hover {
    background: #e9ecef;
    border-color: #1979c3;
}

.slot-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slot-day {
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
}

.slot-details {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.slot-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.slot-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.active {
    background: #28a745;
}

.status-badge.inactive {
    background: #dc3545;
}

.slot-actions {
    display: flex;
    gap: 8px;
}

.btn-edit,
.btn-delete {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-edit {
    color: #007bff;
    border-color: #007bff;
}

.btn-edit:hover {
    background: #007bff;
    color: white;
}

.btn-delete {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-delete:hover {
    background: #dc3545;
    color: white;
}

/* Slot Popup Styles */
.slot-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.slot-popup-overlay[style*="block"] {
    display: block !important;
    align-items: center;
    justify-content: center;
}

.slot-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.slot-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.slot-popup-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-popup {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    color: #333;
}

.slot-popup-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.popup-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-field-wrapper label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.popup-field-wrapper select,
.popup-field-wrapper input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.time-range-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.time-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.time-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.time-input-group input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.time-separator {
    font-weight: bold;
    color: #666;
}

.slot-options-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.slot-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
}

.btn-cancel,
.btn-save {
    padding: 10px 20px;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: white;
    color: #666;
    border-color: #ddd;
}

.btn-cancel:hover {
    background: #f8f9fa;
    border-color: #aaa;
}

.btn-save {
    background: #1979c3;
    color: white;
    border-color: #1979c3;
}

.btn-save:hover {
    background: #1465a0;
    border-color: #1465a0;
}

.popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}
.popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
}
.popup-slot-item {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    padding-bottom: 15px;
}

.popup-slot-item .switch-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

span.slot-label {
    border: 1px solid #b1a38b;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    color: #565d6d;
    font-weight: 700;
    line-height: 1;
}

.slot-label.not-bookable {
    text-decoration: line-through;
    color: #b9b9b9;
    border-color: #b9b9b9;
}

.popup-slot-item .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    margin-bottom: 0;
}

.popup-slot-item .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.popup-slot-item .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #868686;
    transition: 0.3s;
    border-radius: 34px;
}

.popup-slot-item .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

#popup-slot-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 10px;
}
.popup-slot-item input:checked + .slider {
    background-color: #20c997; /* green when active */
}

.popup-slot-item input:focus + .slider {
    box-shadow: 0 0 1px #20c997;
}

.popup-slot-item input:checked + .slider:before {
    transform: translateX(22px);
}

.popup-slot-item .slider.round {
    border-radius: 34px;
}

.popup-slot-item .slider.round:before {
    border-radius: 50%;
}

.input-field-wrapper.slots-management-wrapper {
    gap: 0;

    > label {
        margin-bottom: 10px;
    }
}

.generated-hour-slots.empty {
    display: none;
}

.generated-hour-slots {
    margin-top: 0;
    padding: 10px;
    border: 1px solid #00426d;
    border-radius: 0 0 8px 8px;
    background: #fafafa;
}
.generated-hour-slots .hour-slot {
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
}
.generated-hour-slots .hour-slot h4 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #333;
}
.generated-hour-slots .slot-input {
    width: 100%;
    padding: 6px;
    margin-top: 5px;
}
.slot-wapper-input {
    flex-direction: row;
}
.generated-hour-slots-tabs {
    display: flex;
    gap: 10px;
}
.generated-hour-slots-tabs .hour-slot {
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
    background: #f0f0f0;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid #ddd;
    border-bottom-width: 3px;
    border-bottom-color: transparent;
}

.generated-hour-slots-tabs .hour-slot.active {
    background: #fafafa;
    color: #00426d;
    border-color: #00426d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .time-range-section,
    .slot-options-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .slot-popup {
        width: 95%;
    }

    .slot-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .slot-details {
        flex-wrap: wrap;
    }
}

/* Responsive Design for Slot Management */
@media (max-width: 768px) {
    .slot-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .slot-row .day-input,
    .slot-row .slots-input {
        width: 100%;
        min-width: auto;
    }

    .time-picker-popup {
        width: 95%;
    }

    .time-input-section {
        flex-direction: column;
        gap: 15px;
    }
}
