/**
 * BookNow Widget Styles
 * Sunshine Scheduling System Integration
 */

/* Base widget styles */
.booknow-widget {
    position: fixed;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.booknow-widget:hover {
    text-decoration: none;
    transform: scale(1.05);
}

.booknow-widget:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

/* Icon styles */
.booknow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.booknow-icon svg {
    width: 20px;
    height: 20px;
}

/* Button style variations */
.booknow-widget-modern {
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.booknow-widget-modern:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.booknow-widget-classic {
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.booknow-widget-classic:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.booknow-widget-minimal {
    padding: 10px 20px;
    border-radius: 4px;
    background: transparent !important;
    border: 2px solid currentColor;
}

.booknow-widget-minimal:hover {
    opacity: 0.8;
}

.booknow-widget-pill {
    padding: 14px 28px;
    border-radius: 100px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.booknow-widget-pill:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}

.booknow-widget-image {
    background: transparent !important;
    padding: 0;
    border: none;
    box-shadow: none;
}

.booknow-widget-image img {
    max-width: 150px;
    max-height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.booknow-widget-image:hover img {
    transform: scale(1.05);
}

/* Position variations */
.booknow-position-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: right center;
    border-radius: 8px 8px 0 0 !important;
}

.booknow-position-right:hover {
    transform: translateY(-50%) rotate(-90deg) scale(1.05);
}

.booknow-position-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: left center;
    border-radius: 8px 8px 0 0 !important;
}

.booknow-position-left:hover {
    transform: translateY(-50%) rotate(90deg) scale(1.05);
}

.booknow-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.booknow-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.booknow-position-top-right {
    top: 20px;
    right: 5px;
}

.booknow-position-top-left {
    top: 20px;
    left: 20px;
}

.booknow-position-top-center {
    top: 1%;
    left: 26%;
}

.booknow-position-custom {
    /* Position set via inline styles from admin config */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .booknow-hide-mobile {
        display: none !important;
    }
    
    .booknow-widget {
        font-size: 13px;
        padding: 10px 18px;
    }
    
    .booknow-widget-image img {
        max-width: 120px;
        max-height: 50px;
    }
    
    .booknow-position-right,
    .booknow-position-left {
        /* On mobile, move to bottom corners instead of sides */
        top: auto;
        bottom: 20px;
        transform: none;
    }
    
    .booknow-position-right {
        right: 20px;
        left: auto;
    }
    
    .booknow-position-left {
        left: 20px;
        right: auto;
    }
    
    .booknow-position-bottom-right,
    .booknow-position-bottom-left {
        bottom: 15px;
    }
    
    .booknow-position-bottom-right {
        right: 15px;
    }
    
    .booknow-position-bottom-left {
        left: 15px;
    }
}

/* Animation on load */
@keyframes booknowSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.booknow-position-bottom-right,
.booknow-position-bottom-left,
.booknow-position-top-right,
.booknow-position-top-left {
    animation: booknowSlideIn 0.5s ease-out;
}

/* Pulse animation for attention */
@keyframes booknowPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(0, 123, 255, 0.4);
    }
}

.booknow-widget-modern:not(:hover),
.booknow-widget-pill:not(:hover) {
    animation: booknowPulse 3s infinite;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .booknow-widget-minimal {
        border-color: currentColor;
    }
}

/* Print - hide widget */
@media print {
    .booknow-widget {
        display: none !important;
    }
}

/* ================================
   POPUP MODAL STYLES
   ================================ */

.booknow-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.booknow-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.booknow-modal-container {
    position: relative;
    width: 95%;
    max-width: 1100px;
    height: 85%;
    max-height: 700px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    margin-top: 30px;
}

.booknow-modal-overlay.active .booknow-modal-container {
    transform: scale(1) translateY(0);
}

.booknow-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    font-size: 32px;
    line-height: 1;
    color: #333;
    font-weight: 300;
}

.booknow-modal-close:hover {
    background: #ff4444;
    color: #fff;
    transform: scale(1.1);
}

.booknow-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.booknow-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.booknow-modal-loading p {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

.booknow-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: booknowSpin 0.8s linear infinite;
}

@keyframes booknowSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .booknow-modal-container {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        margin-top: 0;
    }
    
    .booknow-modal-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}
