/**
 * Booking Location Selector Styles
 * Styling til lokationsvalg og booking-container
 */

/* Location Selector Wrapper */



.location-selector-wrapper {
    margin-bottom: 2rem;
    padding: 0 .5rem;
}

.location-selector-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Booking Type Selector - Flex container for dropdown and button */
.booking-type-selector {
    display: flex;
    align-items: stretch;
    gap: .25rem;
    width: 100%;
}

/* Custom Select Box Styling */
.nvi-custom-select-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    z-index: 10;
}

.nvi-custom-select {
    position: relative;
    width: 100%;
   padding: 0.75rem;
    background-color: var(--primary-700);
         border: 3px solid #f8f9fd;
    border-radius: 12px;
    cursor: pointer;
    transition: none;
    user-select: none;

    &:has(.nvi-custom-select-option.selected) {
   border: 3px solid #f8f9fd;
        outline: 1px solid #45abaf;
        
    }
}

.nvi-custom-select:hover {
    transform: translateY(-1px);
}

.nvi-custom-select:focus {
    outline: none;
 
    transform: translateY(-1px);
}

.nvi-custom-select.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.nvi-custom-select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-family: inherit;
    color: #fff;
}

.nvi-custom-select-text {
    flex: 1;
    font-weight: 600;
    white-space: nowrap;
    svg {
        margin-right: 0.5rem;
        width: 20px;
        height: 20px;
        fill: #45abaf;
    }
}

.nvi-custom-select-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    color: #fff;
}

.nvi-custom-select.open .nvi-custom-select-arrow {
    transform: rotate(180deg);
}

.nvi-custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: -4px;
    right: -4px;
    background-color: #fff;
    border: 1px solid #45abaf;
    border-top: none;

    z-index: 1000;
    max-height: 700px;
    overflow-y: auto;
    display: none;
}

.nvi-custom-select.open .nvi-custom-select-dropdown {
    display: block;
}

.nvi-custom-select-option {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    color: #2d3748;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e2e8f0;
}

.nvi-custom-select-option:last-child {
    border-bottom: none;
}

.nvi-custom-select-option:hover {
    background-color: #f7fafc;
}

.nvi-custom-select-option:focus {
    outline: none;
    background-color: #e6fffa;
    color: #45abaf;
}

.nvi-custom-select-option.selected {
    background-color: #e6fffa;
    color: #45abaf;
    font-weight: 600;
}

/* Style for Online booking option - bold */
.nvi-custom-select-option.online-booking-option {
    font-weight: 600    ;
    color: #2d3748;
}

.nvi-custom-select-option.online-booking-option:hover {
    background-color: #f0f8f7;
}

.nvi-custom-select-option.online-booking-option.selected {
    background-color: #e6fffa;
    color: #45abaf;
    font-weight: 600;
}

/* Separator between dropdown and online button */
.booking-type-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    color: #2d3748;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: lowercase;
}

/* Online Booking Button */
.online-booking-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #45abaf 0%, #3a9499 100%);
    color: white;
         border: 3px solid #f8f9fd;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 200px;
}

.online-booking-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    fill: #fff;
}

.online-booking-btn:hover {
    background: linear-gradient(135deg, #3a9499 0%, #2f7b7f 100%);
    transform: translateY(-2px);
}

.online-booking-btn:active {
    transform: translateY(0);
}

.online-booking-btn:focus {
    outline: none;
    border-color: #2c5f63;
}

.online-booking-btn.active {
   /* background: #2f7b7f; */
         outline: 1px solid #45abaf;
}

/* Placeholder styling */
.nvi-custom-select-option[data-value=""] {
    font-weight: 500;
    color: #718096;
    font-style: italic;
}

/* Hidden input for form compatibility */
#location-select-input {
    display: none;
}

/* Iframe Wrapper */
.iframe-wrapper-top {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-color: #f7fafc;
    border-radius: 12px;
    overflow: hidden;
}

/* Initial State */
.initial-state {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    background-color: #45abaf;
    color: white;
    padding: 2rem;
     min-height: 420px;
}

.initial-state-content {
    text-align: center;
    max-width: 450px;
}


.initial-state h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.initial-state p {
    font-size: 1.125rem;
    opacity: 0.9;
    line-height: 1.6;
    margin: 0;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #fff;
    min-height: 420px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.loading-state p {
    color: #718096;
    font-size: 1rem;
    margin: 0;
}

/* Booking Iframe */
.booking-iframe {
    width: 100%;
    min-height: 600px;
    height: 100vh;
    max-height: 900px;
    border: none;
    display: block;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}



/* Responsive Design */
@media (max-width: 768px) {
    .nvi-custom-select {
        padding: 0.3rem 0;
    }
    .location-selector-wrapper {
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
            flex: 1 0 auto;
    }

    .booking-type-selector {
        flex-direction: column;
       gap: 0.35rem;
    }

    .booking-type-separator {
        padding: 0;
        font-size: 0.8125rem;
    }

    .online-booking-btn {
        width: 100%;
        min-width: unset;
        padding: 0.875rem 1.25rem;
        font-size: 1.0625rem;
            flex: 1 0 auto;
    }

    .nvi-custom-select-display {
        padding: 0.625rem 1rem;
        font-size: 1rem;
                text-align: center;
    }

    .nvi-custom-select-arrow svg {
        width: 18px;
        height: 18px;
    }

    .nvi-custom-select-option {
        padding: 0.625rem 1rem;
        font-size: 0.9375rem;
    }

    .iframe-wrapper-top {
        min-height: 500px;
        border-radius: 8px;
    }

    .initial-state {
        height: 500px;
        padding: 1.5rem;
        border-radius: 9px;
    }

    .initial-state h3 {
        font-size: 1.5rem;
    }

    .initial-state p {
        font-size: 1rem;
    }



    .loading-state {
        min-height: 500px;
        border-radius: 9px;
    }

    #overlay-booking-form-container {
        width: 100%;
    }

    .booking-iframe {
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .online-booking-btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        gap: 0.375rem;
    }

    .online-booking-btn svg {
        width: 18px;
        height: 18px;
    }

    .nvi-custom-select-display {
        padding: 0.5rem 0.875rem;
        font-size: 0.9375rem;
    }

    .nvi-custom-select-arrow svg {
        width: 16px;
        height: 16px;
    }

    .nvi-custom-select-option {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .initial-state h3 {
        font-size: 1.25rem;
    }

    .initial-state p {
        font-size: 0.9375rem;
    }


}

/* Dark Mode Support (valgfrit) */
@media (prefers-color-scheme: dark) {
    .nvi-custom-select {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .nvi-custom-select:hover {
        border-color: #45abaf;
    }

    .nvi-custom-select:focus {
        border-color: #45abaf;
    }

    .nvi-custom-select.open {
        border-color: #45abaf;
    }

    .nvi-custom-select-display {
        color: #e2e8f0;
    }

    .nvi-custom-select-arrow {
        color: #e2e8f0;
    }

    .booking-type-separator {
        color: #a0aec0;
    }

    .online-booking-btn {
        background: linear-gradient(135deg, #3a9499 0%, #2f7b7f 100%);
        box-shadow: 0 2px 8px rgba(58, 148, 153, 0.4);
    }

    .online-booking-btn:hover {
        background: linear-gradient(135deg, #2f7b7f 0%, #256669 100%);
        box-shadow: 0 4px 16px rgba(58, 148, 153, 0.5);
    }

    .online-booking-btn.active {
        background: #256669;
        border-color: #1f5558;
    }



    .nvi-custom-select-dropdown {
        background-color: #2d3748;
        border-color: #45abaf;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .nvi-custom-select-option {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }

    .nvi-custom-select-option:hover {
        background-color: #4a5568;
    }

    .nvi-custom-select-option.selected {
        background-color: #0d4a4f;
        color: #45abaf;
    }

    .nvi-custom-select-option.online-booking-option {
        color: #e2e8f0;
    }

    .nvi-custom-select-option.online-booking-option:hover {
        background-color: #4a5568;
    }

    .nvi-custom-select-option.online-booking-option.selected {
        background-color: #0d4a4f;
        color: #45abaf;
    }

    .nvi-custom-select-option[data-value=""] {
        color: #a0aec0;
    }

    .iframe-wrapper-top {
        background-color: #1a202c;
    }

    .loading-state {
        background-color: #2d3748;
    }

    .loading-state p {
        color: #cbd5e0;
    }
}
