/**
 * UTO Start Popup Styles
 * Extracted from inline styles for performance
 * Uses CSS custom properties for dynamic theming
 * 
 * @since 4.5.0
 */

/* ===== Start Popup — self-contained ===== */
@import url('https://fonts.googleapis.com/css2?family=Saira:wght@400;500;600;700;800&display=swap');

.uto-sp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0,0,0,.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease-out, visibility 0s .3s;
    font-family: "Saira", system-ui, -apple-system, sans-serif;
}
.uto-sp-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .3s ease-out, visibility 0s 0s;
}
.uto-sp-overlay * {
    box-sizing: border-box;
}

/* ===== Background blur effect when popup is open ===== */
body.uto-popup-blur-active {
    overflow: hidden;
}

/* Blur common WordPress theme containers */
body.uto-popup-blur-active > *:not(.uto-sp-overlay):not(.uto-nested-overlay):not(script):not(style):not(link):not(#wpadminbar) {
    filter: blur(6px);
    transition: filter 0.25s ease;
    pointer-events: none;
}

/* Common theme wrapper selectors */
body.uto-popup-blur-active .site,
body.uto-popup-blur-active .site-content,
body.uto-popup-blur-active #page,
body.uto-popup-blur-active #wrapper,
body.uto-popup-blur-active .wrapper,
body.uto-popup-blur-active main,
body.uto-popup-blur-active header:not(.uto-sp-header):not(.uto-nested-header),
body.uto-popup-blur-active footer,
body.uto-popup-blur-active .elementor,
body.uto-popup-blur-active .fl-builder,
body.uto-popup-blur-active #content {
    filter: blur(6px);
    transition: filter 0.25s ease;
}

/* Ensure popup overlays are never blurred */
body.uto-popup-blur-active .uto-sp-overlay,
body.uto-popup-blur-active .uto-nested-overlay,
body.uto-popup-blur-active #uto-start-popup-overlay,
body.uto-popup-blur-active #uto-nested-popup-portal {
    filter: none !important;
    pointer-events: auto !important;
}

/* Enhanced overlay with backdrop blur for modern browsers */
.uto-sp-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Desktop: centered modal with same width as booking container */
.uto-sp-sheet {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) scale(.92);
    max-width: 520px;
    width: calc(100% - 32px);
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 16px 56px rgba(0,0,0,.18);
    overflow: hidden;
    opacity: 0;
    transition: transform .3s ease-out, opacity .3s ease-out;
}
.uto-sp-overlay.active .uto-sp-sheet {
    transform: translate(-50%,-50%) scale(1);
    opacity: 1;
}

/* Mobile: centered modal (same as desktop, 15px all corners) */
@media (max-width: 600px) {
    .uto-sp-sheet {
        top: 50%;
        bottom: auto;
        left: 50%;
        right: auto;
        max-width: calc(100% - 24px);
        width: calc(100% - 24px);
        height: auto;
        max-height: 90vh;
        border-radius: 15px;
        transform: translate(-50%,-50%) scale(.92);
        box-shadow: 0 16px 56px rgba(0,0,0,.18);
        overflow-y: auto;
    }
    .uto-sp-overlay.active .uto-sp-sheet {
        transform: translate(-50%,-50%) scale(1);
    }
}

.uto-sp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 22px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
}
.uto-sp-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--uto-text-color, #0f172a);
    letter-spacing: .8px;
}
.uto-sp-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all .2s;
}
.uto-sp-close:hover {
    background: #e5e7eb;
    color: #111;
}

.uto-sp-body {
    padding: 20px 22px 24px;
}

.uto-sp-field {
    margin-bottom: 14px;
}

.uto-sp-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.uto-sp-input-wrap {
    position: relative;
}

.uto-sp-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uto-sp-ico svg {
    width: 18px;
    height: 18px;
}

.uto-sp-select,
.uto-sp-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    background: #F3F4F6;
    color: #1f2937;
    font-family: "Saira", sans-serif;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.uto-sp-input::placeholder {
    color: #6b7280;
    opacity: 1;
}

.uto-sp-picker-trigger {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 15px;
    padding-right: 40px;
}

.uto-sp-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 15px;
    padding-right: 40px;
}

.uto-sp-select:focus,
.uto-sp-input:focus {
    border-color: var(--uto-primary, #FACB05);
    box-shadow: 0 0 0 3px rgba(250,203,5,.13);
    background: #FFFDF5;
}

.uto-sp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 400px) {
    .uto-sp-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.uto-sp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 8px;
    background: var(--uto-primary, #FACB05);
    color: #1a1a00;
    font-size: 16px;
    font-weight: 700;
    font-family: "Saira", sans-serif;
    cursor: pointer;
    transition: all .2s;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(250,203,5,.18);
}
.uto-sp-btn:hover:not(:disabled) {
    filter: brightness(.90);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(250,203,5,.25);
}
.uto-sp-btn:disabled {
    opacity: .42;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.uto-sp-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* Mobile: Remove drag handle since we're using centered modal now */
@media (max-width: 600px) {
    .uto-sp-header {
        position: relative;
    }
}

/* ===== PART C: Mobile popup corner radius 20px ===== */
@media (max-width: 767px) {
    .uto-sp-sheet {
        border-top-left-radius: 20px !important;
        border-top-right-radius: 20px !important;
        border-bottom-left-radius: 20px !important;
        border-bottom-right-radius: 20px !important;
        overflow: hidden;
    }
}

/* ===== PART A (Start Popup): Readability — Darker text + bolder ===== */
.uto-sp-input,
.uto-sp-select {
    color: #1f2937 !important;
    font-weight: 500 !important;
}
.uto-sp-input::placeholder {
    color: #6b7280 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}
