/* Reserve Now & Pay Later Button Styles */
.submit-group #rnpl.btn-outline {
    background-color: transparent;
    color: #ff5b00;
    border: 1px solid #ff5b00;
    margin-bottom: 10px;
    display: block;
    width: 100%;
    padding: 15px 20px;
    border-radius: 5px;
    font-weight: 500;
    text-transform: capitalize;
    font-style: normal;
    font-size: 16px;
    line-height: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.submit-group #rnpl.btn-outline:hover {
    background-color: #f7f7f7;
}

.submit-group .btn-primary {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Make sure buttons are stacked properly */
.submit-group {
    display: flex;
    flex-direction: column;
}

/* Button text container */
.btn-book-ajax .btn-text {
    position: relative;
    display: inline-block;
    transition: opacity 0.3s ease;
}

/* Modern loading animation */
.btn-book-ajax .loading-state {
    display: none;
    opacity: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: inherit;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Prevent clicks on loading state */
}

/* Complete hide of both normal state and loading state by default */
.btn-book-ajax .fa-spinner {
    display: none !important; /* Hide the original spinner completely */
}

/* Loading state styles for buttons */
.btn-book-ajax.is-loading .btn-text {
    opacity: 0;
}

.btn-book-ajax.is-loading .loading-state {
    display: flex;
    opacity: 1;
}

/* Add JavaScript-independent trigger for development testing */
/* .btn-book-ajax:active .btn-text { opacity: 0; }
.btn-book-ajax:active .loading-state { display: flex; opacity: 1; } */

/* Loading spinner styling */
.loading-spinner {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    animation: spin 1s linear infinite;
    min-width: 20px; /* Ensure spinner maintains size on small screens */
    flex-shrink: 0;
}

.spinner-circle {
    stroke: currentColor;
    stroke-linecap: round;
    stroke-dasharray: 60, 200;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
}

/* Loading text styling */
.loading-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 35px); /* Ensure text doesn't overflow button */
    text-transform: capitalize; /* Match button text transform */
    font-style: normal; /* Match button font style */
}

/* Primary button styling */
.btn-book-ajax.btn-primary .loading-spinner .spinner-circle {
    stroke: #fff;
}

.btn-book-ajax.btn-primary .loading-text {
    color: #fff;
}

/* RNPL button styling */
#rnpl.btn-book-ajax .loading-spinner .spinner-circle {
    stroke: #ff5b00;
}

#rnpl.btn-book-ajax .loading-text {
    color: #ff5b00;
}

/* Animation keyframes */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -125;
    }
}

/* Mobile responsiveness adjustments */
@media (max-width: 480px) {
    .loading-text {
        font-size: 12px; /* Smaller font on mobile */
    }
    
    .loading-spinner {
        width: 16px;
        height: 16px;
        min-width: 16px;
        margin-right: 6px;
    }
    
    /* For extremely small screens */
    @media (max-width: 320px) {
        .loading-text {
            max-width: calc(100% - 25px);
        }
    }
} 