/* Reservation Popup Styles */

#crp-reservation-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

.crp-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000000;
    -webkit-backface-visibility: hidden;
    /* Prevent flickering on iOS */
    backface-visibility: hidden;
}

.crp-popup {
    position: relative;
    z-index: 1000001;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    transform: translateZ(0);
    /* Force GPU acceleration */
}

.crp-popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crp-popup-header h3 {
    margin: 0;
    font-size: 18px;
}

.crp-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crp-popup-content {
    padding: 20px;
}

/* Calendar styles */
.crp-calendar {
    width: 100%;
}

.crp-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
}

.crp-calendar-nav {
    background: transparent;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.crp-calendar-table {
    width: 100%;
    border-collapse: collapse;
}

.crp-calendar-table th {
    padding: 10px 0;
    text-align: center;
    font-weight: normal;
    font-size: 14px;
}

.crp-day {
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.crp-day:hover:not(.crp-empty):not(.crp-disabled) {
    background-color: #f5f5f5;
}

.crp-empty {
    pointer-events: none;
}

.crp-disabled {
    color: #ccc;
    pointer-events: none;
}

.crp-selected {
    background-color: #dc144c;
    color: white;
    border-radius: 50%;
}

/* Form styles */
.crp-form {
    width: 100%;
}

.crp-form-field {
    margin-bottom: 15px;
}

.crp-form-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.crp-form-field input,
.crp-form-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    /* Fix for mobile visibility */
    opacity: 1;
    /* Fix for iOS readonly inputs */
    -webkit-text-fill-color: #333;
    /* Fix for Safari */
}

.crp-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 5px;
}

.crp-back-btn,
.crp-reserve-btn {
    cursor: pointer;
    font-weight: bold;
    border: none;
    font-size: 16px;
    font-family: inherit;
    display: inline-block;
    text-decoration: none;
}

.crp-back-btn {
    background-color: #f5f5f5;
    color: #333;
}

.crp-reserve-btn {
    background-color: #dc144c;
    color: white;
}

/* Animation classes */
.crp-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.crp-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.crp-slide-in {
    animation: slideIn 0.3s ease forwards;
}

.crp-slide-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    #crp-reservation-popup-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        z-index: 999999;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .crp-popup {
        width: 95%;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 20px;
    }

    .crp-popup-content {
        padding: 15px;
        max-height: calc(90vh - 100px);
        overflow-y: auto;
    }

    /* Ensure popup is above mobile fixed elements */
    @supports (-webkit-touch-callout: none) {
        #crp-reservation-popup-wrapper {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            z-index: 999999;
        }
    }

    .crp-popup-header h3 {
        font-size: 16px;
    }

    .crp-calendar-table th {
        font-size: 12px;
    }

    .crp-day {
        padding: 5px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .crp-popup {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 0;
    }

    .crp-popup-header h3 {
        font-size: 16px;
    }

    .crp-calendar-table th {
        font-size: 12px;
    }

    .crp-day {
        padding: 5px;
        font-size: 14px;
    }
}