/**
 * WPForms Geolocation Frontend Styles
 */

/* Field Wrapper */
.wpforms-geolocation-field-wrapper {
	position: relative !important;
	display: inline;
}

.wpforms-geolocation-field-wrapper input[type="text"] {
    flex: 1;
    padding-right: 45px;
}

.wpforms-container .uawpf-geolocation-map.wpforms-field-small{
	max-width: 25%;
}
.wpforms-container .uawpf-geolocation-map.wpforms-field-medium{
	max-width: 60%;
}
.wpforms-container .uawpf-geolocation-map.wpforms-field-large{
	max-width: 100%;
}

/* Current Location Button */
.wpforms-geolocation-current-btn {
    position: absolute !important;
    right: 8px;
    top: 50%;
    /* transform: translateY(-50%); */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
    border-radius: 4px;
}

.wpforms-geolocation-current-btn:hover {
    color: #0073aa;
    background: rgba(0, 115, 170, 0.1);
}

.wpforms-geolocation-current-btn:focus {
    color: #0073aa;
    outline-offset: 2px;
}

.wpforms-geolocation-current-btn svg {
    width: 18px;
    height: 18px;
}

/* Loading State */
.wpforms-geolocation-current-btn.loading {
    pointer-events: none;
}

.wpforms-geolocation-current-btn.loading svg {
    animation: wpforms-geo-spin 1s linear infinite;
}

@keyframes wpforms-geo-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.wpforms-geolocation-error {
    margin-top: 8px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #dc2626;
    font-size: 14px;
    line-height: 1.5;
}

/* Google Places Autocomplete Dropdown Styling */
.pac-container {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    margin-top: 4px;
    font-family: inherit;
    z-index: 100000 !important;
}

.pac-container {
    z-index: 999999 !important;
}
.wpforms-geolocation-field-wrapper {
    position: relative;
    overflow: visible;
}

.pac-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    border-top: 1px solid #f3f4f6;
}

.pac-item:first-child {
    border-top: none;
    border-radius: 8px 8px 0 0;
}

.pac-item:last-child {
    border-radius: 0 0 8px 8px;
}

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

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

.pac-item-query {
    font-weight: 600;
    color: #1f2937;
}

.pac-matched {
    font-weight: 700;
}

/* RTL Support */
[dir="rtl"] .wpforms-geolocation-field-wrapper input[type="text"] {
    padding-right: 12px;
    padding-left: 45px;
}

[dir="rtl"] .wpforms-geolocation-current-btn {
    right: auto;
    left: 8px;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .wpforms-geolocation-current-btn {
        padding: 10px;
    }
    
    .wpforms-geolocation-current-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Hide hidden fields */
.wpforms-geolocation-lat,
.wpforms-geolocation-lng,
.wpforms-geolocation-place-id,
.wpforms-geolocation-street_number,
.wpforms-geolocation-route,
.wpforms-geolocation-locality,
.wpforms-geolocation-administrative_area_level_1,
.wpforms-geolocation-postal_code,
.wpforms-geolocation-country {
    display: none !important;
}

/* Accessibility - Focus States */
.wpforms-geolocation-field-wrapper input[type="text"]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
    border-color: #0073aa;
}

/* Disabled State */
.wpforms-geolocation-field-wrapper input[type="text"]:disabled {
    background-color: #f5f5f5;
    cursor: wait;
}
