/**
 * WPForms Smart Location Pro Stylesheet
 */

.wpforms-smart-location-wrap {
    width: 100%;
}

/* Autocomplete Search input styling */
.wpforms-smart-location-autocomplete-search input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="%2364748b"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px;
    padding-left: 38px !important;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    transition: all 0.3s ease;
}

.wpforms-smart-location-autocomplete-search input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-position: 12px center;
}

/* Layout wrap for dropdowns */
.wpforms-smart-location-preview,
.wpforms-smart-location-preview-wrap {
    width: 100%;
}

.wpforms-field-row.wpforms-smart-location-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
}

.wpforms-smart-location-wrap select,
.wpforms-smart-location-wrap input[type="text"] {
    width: 100%;
    height: 44px;
    padding: 8px 12px;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpforms-smart-location-wrap select:focus,
.wpforms-smart-location-wrap input[type="text"]:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wpforms-smart-location-wrap select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Flexbox Column Layout rules */
.wpforms-smart-location-country,
.wpforms-smart-location-state,
.wpforms-smart-location-city {
    flex: 1;
    min-width: 200px;
}

/* Custom inputs for other locations */
.wpforms-smart-location-other-input {
    border-color: #e2e8f0;
    margin-top: 8px !important;
}

/* Google Autocomplete styling overlay inside browser */
.pac-container {
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    font-family: inherit;
    z-index: 999999 !important; /* ensure it stays on top of popups/modals */
    padding: 5px 0;
}

.pac-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover, .pac-item-selected {
    background-color: #f8fafc;
}

.pac-icon {
    margin-right: 10px;
}

/* Loading label state styling */
label[for$="-state"]::after,
label[for$="-city"]::after {
    font-size: 11px;
    color: #2563eb;
    margin-left: 5px;
    font-style: italic;
}

@media (max-width: 600px) {
    .wpforms-field-row.wpforms-smart-location-wrap {
        flex-direction: column;
        gap: 12px;
    }
    
    .wpforms-smart-location-country,
    .wpforms-smart-location-state,
    .wpforms-smart-location-city {
        width: 100%;
        flex: none;
    }
}
