/* Stili per la pagina di ricerca con mappa OpenStreetMap */

.gradient-text {
    background: linear-gradient(90deg, #F03E62, #F7941D, #9752A2, #2384C8, #12A89D);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: gradient 8s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Mappa */
#map {
    border-radius: 0 0 1rem 1rem;
}

/* Marker personalizzati */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 40px;
    height: 40px;
    border-radius: 50% 50% 50% 0;
    background: #F03E62;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -20px 0 0 -20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.marker-pin:hover {
    transform: rotate(-45deg) scale(1.2);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.marker-icon {
    font-size: 16px;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Marker posizione utente */
.user-location-marker {
    background: transparent;
    border: none;
}

.user-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #12A89D, #2384C8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(18, 168, 157, 0.5);
    animation: pulse-user 2s infinite;
}

@keyframes pulse-user {
    0%, 100% {
        box-shadow: 0 3px 10px rgba(18, 168, 157, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 3px 20px rgba(18, 168, 157, 0.8);
        transform: scale(1.1);
    }
}

/* Popup personalizzati */
.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.popup-content {
    font-family: inherit;
}

.popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.popup-title {
    font-size: 17px;
    font-weight: bold;
    margin: 14px 20px 10px 20px;
    color: #1F2937;
}

.popup-category {
    font-size: 13px;
    color: #1F2937;
    margin: 0 20px 10px 20px;
    margin-left: 20px !important;
    font-weight: 500;
}

.popup-category i {
    margin-right: 8px;
}

.popup-address,
.popup-price,
.popup-rating {
    font-size: 13px;
    color: #1F2937;
    margin: 6px 20px;
    margin-left: 20px !important;
}

.popup-address i,
.popup-price i {
    color: #1F2937;
    margin-right: 8px;
}

.popup-rating i {
    color: #F7941D;
}

.popup-link {
    display: block;
    margin: 14px 20px 16px 20px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #F03E62, #F7941D) !important;
    color: #FFFFFF !important;
    text-align: center;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.popup-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 62, 98, 0.4);
    color: #FFFFFF !important;
    text-decoration: none !important;
}

.popup-link i {
    color: #FFFFFF !important;
}

/* Allineamento icone nelle card */
.company-card p i {
    font-size: 14px;
}

/* Suggerimenti località */
#location-suggestions {
    z-index: 1000;
}

.suggestion-item {
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #F3F4F6;
}

/* Card aziende */
.company-card {
    transition: all 0.3s ease;
}

.company-card:hover {
    transform: translateY(-4px);
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scrollbar personalizzata */
.max-h-screen::-webkit-scrollbar {
    width: 8px;
}

.max-h-screen::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 10px;
}

.max-h-screen::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #F03E62, #F7941D);
    border-radius: 10px;
}

.max-h-screen::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d63555, #e08419);
}

/* Responsive */
@media (max-width: 1024px) {
    #map {
        height: 400px !important;
    }

    .lg\:col-span-2,
    .lg\:col-span-1 {
        grid-column: span 1 / span 1;
    }

    .max-h-screen {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .marker-pin {
        width: 30px;
        height: 30px;
        margin: -15px 0 0 -15px;
    }

    .marker-icon {
        font-size: 14px;
    }

    #map {
        height: 350px !important;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.company-card {
    animation: fadeIn 0.3s ease forwards;
}

/* Stile per i controlli della mappa */
.leaflet-control-zoom a {
    color: #1F2937 !important;
}

.leaflet-control-zoom a:hover {
    background-color: #F03E62 !important;
    color: white !important;
}

/* Breadcrumb */
nav a {
    transition: color 0.2s ease;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #F03E62, #F7941D, #9752A2, #2384C8, #12A89D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Utility classes */
.sticky {
    position: sticky;
}

.gradient-text {
    background: linear-gradient(90deg, #F03E62, #F7941D, #9752A2, #2384C8, #12A89D);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 300% 300%;
    animation: gradient 8s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.top-4 {
    top: 1rem;
}

/* Pulsanti filtro hover effects */
#apply-filters-btn {
    transition: all 0.3s ease;
}

#apply-filters-btn:hover {
    transform: translateY(-2px);
}

#reset-filters-btn,
#my-location-btn {
    transition: all 0.3s ease;
}

#reset-filters-btn:hover,
#my-location-btn:hover {
    transform: translateY(-2px);
}

/* Stile per input focus */
input:focus,
select:focus {
    outline: none;
}

/* Badge categoria */
.company-card .px-3.py-1 {
    backdrop-filter: blur(10px);
}

/* Link esterni nelle card */
.company-card a {
    transition: all 0.3s ease;
}

.company-card a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 62, 98, 0.3);
}
