/**
 * Google Location CF7 - Frontend Styles
 * Stili per l'autocompletamento Google Places
 */

/* Container wrapper per il campo Google Location */
.google-location-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

/* Campo di input principale per l'autocompletamento */
.google-location-autocomplete {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
}

.google-location-autocomplete:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.google-location-autocomplete::placeholder {
    color: #999;
    font-style: italic;
}

/* Stili per lo stato di errore */
.google-location-wrapper.wpcf7-not-valid .google-location-autocomplete {
    border-color: #dc3232;
}

.google-location-wrapper.wpcf7-not-valid .google-location-autocomplete:focus {
    border-color: #dc3232;
    box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.1);
}

/* Messaggio di errore */
.google-location-wrapper .wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #dc3232;
    color: #fff;
    font-size: 0.875rem;
    border-radius: 3px;
    position: relative;
}

.google-location-wrapper .wpcf7-not-valid-tip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 10px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #dc3232;
}

/* Campi nascosti - non devono essere visibili */
.google-location-field {
    display: none !important;
}

/* Compatibilità con temi WordPress comuni */
.wpcf7 .google-location-wrapper,
.wpcf7-form .google-location-wrapper {
    margin-bottom: 1rem;
}

/* Stili responsive */
@media (max-width: 768px) {
    .google-location-autocomplete {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* Fix per temi che potrebbero avere conflitti */
.google-location-autocomplete {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
}

/* Compatibilità con Contact Form 7 */
.wpcf7-form-control-wrap.google-location-wrapper {
    position: relative;
}

/* Loading state - se necessario in futuro */
.google-location-wrapper.loading .google-location-autocomplete {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 11-6.219-8.56"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    animation: spin 1s linear infinite;
}

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