/* Google PlaceAutocompleteElement Styling */
/* Style the PlaceAutocompleteElement to match existing form controls */

/* Force light theme on PlaceAutocompleteElement */
/* Target the PlaceAutocompleteElement web component */
gmp-place-autocomplete {
    display: block;
    width: 100%;
    color-scheme: light !important;
}

/* Style the inner input of PlaceAutocompleteElement */
gmp-place-autocomplete input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    font-size: 1.4rem;
    font-family: var(--font-primary);
    line-height: 1.5;
    color: #333333 !important;
    background-color: #FFFFFF !important;
    background-clip: padding-box;
    border: 1px solid #CCCCCC !important;
    border-radius: var(--border-radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    color-scheme: light !important;
}

/* Focus state */
gmp-place-autocomplete input:focus {
    color: #333333 !important;
    background-color: #FFFFFF !important;
    border-color: #007BFF !important;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Placeholder text */
gmp-place-autocomplete input::placeholder {
    color: #999999 !important;
    opacity: 0.7;
}

/* Disabled state */
gmp-place-autocomplete input:disabled {
    background-color: #F5F5F5 !important;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Force light theme on all nested elements */
gmp-place-autocomplete * {
    color-scheme: light !important;
}

/* Error state */
gmp-place-autocomplete.is-invalid input,
gmp-place-autocomplete input.is-invalid {
    border-color: var(--brand-danger);
}

/* Autocomplete dropdown suggestions */
.pac-container {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--brand-grey);
    margin-top: 2px;
}

.pac-item {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pac-item:hover {
    background-color: var(--brand-light-grey);
}

.pac-item-selected {
    background-color: var(--brand-light-blue);
}

.pac-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.pac-item-query {
    font-weight: 600;
    color: var(--brand-dark-grey);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    gmp-place-autocomplete input {
        font-size: 1.6rem;
        padding: 1rem 1.2rem;
    }
    
    .pac-container {
        font-size: 1.6rem;
    }
}