/* PadelMap — Frontend styles */
:root {
    --primary-spi-color: #4ca49a;
    --spi-white: #ffffff;
}
.padelmap-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #000000;
    box-sizing: border-box;
}

/* Barra di ricerca / filtro */
.padelmap-search-section {
    background: #121212;
    border: 0.5px solid #444444;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.padelmap-search-fields {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.padelmap-address-wrapper {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.padelmap-address-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #CCCCCC;
    border-radius: 8px;
    font-size: 15px;
    background: #121212;
    color: var(--spi-white);
    box-sizing: border-box;
}

#padelmap-geolocate {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--primary-spi-color);
    color: var(--spi-white);
    border: 0px solid #CCCCCC;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.leaflet-touch .leaflet-control-attribution {
  display: none !important;
}
#padelmap-geolocate:hover {
    opacity: 0.8;
}
.padelmap-address-wrapper input[type="text"] {
    border-radius: 50px;
  }
#padelmap-geolocate:disabled {
    opacity: 0.5;
    cursor: wait;
}

#padelmap-address-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e1e1e;
    border: 1px solid #555;
    border-radius: 8px;
    margin-top: 4px;
    list-style: none;
    padding: 4px 0;
    margin-left: 0;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    display: none;
}

#padelmap-address-results li {
    padding: 9px 14px;
    font-size: 14px;
    color: var(--spi-white);
    cursor: pointer;
    border-bottom: 1px solid #333;
}

#padelmap-address-results li:last-child {
    border-bottom: none;
}

#padelmap-address-results li:hover {
    background: #2a2a2a;
}

.padelmap-no-results {
    color: #aaa;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.padelmap-search-section select {
    flex: 0 0 220px;
    width: auto;
    max-width: none;
    padding: 10px 14px;
    border: 1px solid #CCCCCC;
    border-radius: 8px;
    font-size: 15px;
    background: #121212 !important;
    color: var(--spi-white) !important;
    cursor: pointer;
    appearance: auto;
}

.padelmap-search-section select option {
    background: var(--spi-white);
    color: #222;
}

/* Layout principale: lista + mappa */
.padelmap-content {
    display: grid;
    grid-template-columns: minmax(300px, 30%) 1fr;
    gap: 30px;
    margin-top: 20px;
    min-height: calc(100vh - 160px);
    position: relative;
}

/* Lista */
.padelmap-list {
    align-self: start; /* solo la lista si ancora in alto, il wrapper si estende */
}

.padelmap-item {
    background: #121212;
    border-radius: 12px;
    border: 0.5px solid #444;
    margin-bottom: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    transition: transform 0.2s, box-shadow 0.2s;
}
.leaflet-bar a {
    background-color: #000000;
    border-bottom: 0.5px solid #444444;
  }
.padelmap-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Immagine + info */
.padelmap-item-thumb {
    flex: 0 0 40%;
    min-height: 150px;
    background: #333 center/cover no-repeat;
}

.padelmap-item-info {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    text-align: center;
    gap: 10px;
}

.padelmap-item-info h3 {
    margin: 0;
    color: var(--spi-white) !important;
    font-size: 18px;
    line-height: 1.3;
}

.padelmap-item-info .indirizzo {
    color: #666;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.padelmap-item-categoria {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-spi-color);;
    margin-bottom: 4px;
}

.padelmap-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.padelmap-item-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    border: none;
    background: transparent;
    padding: 0;
}

.padelmap-item-tag a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    width: 80px;
}

.padelmap-item-tag img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
    margin-bottom: 0 !important;
}
.padelmap-popup-info .padelmap-link {
  border-radius: 50px; background-color: #333333; color: #FFFFFF !important;
}
.padelmap-item-description {
    font-size: 13px;
    line-height: 1.5;
    margin-top: 6px;
    color: #aaa;
}

.padelmap-item-description p {
    margin: 0 0 4px 0;
}

.padelmap-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.padelmap-card-link {
    color: #aaaaaa !important;
    font-size: 13px;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.padelmap-card-link:hover {
    color: var(--spi-white) !important;
    background: none;
    opacity: 1;
}
.leaflet-container {
    background: #000000 !important;
  }
.padelmap-link {
    display: inline-block;
    padding: 6px 14px;
    color: var(--spi-white) !important;
    text-decoration: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1.4;
    background-color: #333;
}
.padelmap-popup-actions .padelmap-link {
  color: #121212 !important;
  background-color: #EAEAEA;
}

.padelmap-link,
.padelmap-link:visited {
    color: #121212 !important;
    opacity: 1;
}
.padelmap-item-info h3 {
    letter-spacing: -0.5px;
}
.padelmap-link:hover {
  color: #121212 !important;
  background-color: var(--primary-spi-color);;
}
.padelmap-link:hover {
    opacity: 0.8;
}

/* Wrapper mappa: resta nella griglia come segnaposto */
.padelmap-map-wrapper {
    position: relative;
}

/* Mappa */
.padelmap-map-container {
    height: calc(100vh - 100px);
    border-radius: 12px;
    border: 0.5px solid #444444;
    min-height: 400px;
    background: #121212;
    overflow: hidden;
}

.padelmap-map {
    height: 100%;
    width: 100%;
    border-radius: 12px;
}

/* Solo mappa */
.padelmap-only-map .padelmap-map-container {
    height: 600px;
}

.padelmap-map-fullwidth {
    width: 100%;
}

/* Mappa — overrides Leaflet */
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
    border: 1px solid #EAEAEA !important;
    border-radius: 10px;
}

.leaflet-touch .leaflet-bar a:first-child {
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
}

.leaflet-touch .leaflet-bar a:last-child {
    border-bottom-left-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #EAEAEA !important;
}

.leaflet-popup-content p {
    margin: 3px 0 !important;
}

.leaflet-container a {
    color: #CCCCCC !important;
}

.leaflet-container .padelmap-link {
    color: #121212 !important;
}

/* Popup mappa */
.padelmap-popup {
    min-width: 220px;
}

.padelmap-popup-main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-bottom: 10px;
}

.padelmap-popup-thumb {
    aspect-ratio: 1;
    border-radius: 6px;
    background: #f0f0f0 center/cover no-repeat;
}

.padelmap-popup-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.padelmap-popup h4 {
    margin: 0 0 4px 0 !important;
    font-size: 14px !important;
    color: #222 !important;
    line-height: 1.3;
    text-align: center;
}

.padelmap-popup .padelmap-item-tag  {
    height: 40px;
}

.padelmap-popup .padelmap-item-tag img {
    height: 80px !important;
    width: auto;
    filter: brightness(0) invert(1);
}


.padelmap-popup .indirizzo {
    font-size: 12px !important;
    color: #666 !important;
    margin: 0 !important;
    line-height: 1.4;
}

.padelmap-popup-actions {
    margin-top: 4px;
}

/* Loader */
.loader-container {
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #ddd;
    border-top-color: #008489;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Load more */
.padelmap-load-more {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--spi-white);
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    color: #008489;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    margin-top: 8px;
    transition: background 0.2s;
}

.padelmap-load-more:hover {
    background: #f0fafa;
}

/* Responsive */
@media (max-width: 768px) {
    .padelmap-container {
        padding: 16px;
    }

    .padelmap-search-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .padelmap-search-section select,
    .padelmap-address-wrapper,
    #padelmap-geolocate {
        flex: 1 1 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .padelmap-content {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 12px;
    }

    .padelmap-map-wrapper {
        order: -1;
    }

    .padelmap-map-container {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 350px;
    }

    .padelmap-only-map .padelmap-map-container {
        height: 400px;
    }
}
.leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar {
      border: 0.5px solid #444444 !important;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background-color: #121212 !important;
  border: 1px solid #121212 !important;
}
.padelmap-popup-info h4{
  color: var(--spi-white) !important
}
button.padelmap-link.view-on-map-btn{
    border-radius: 50px !important;
}

.leaflet-popup-close-button {
    display: none !important;
}
.marker-cluster-small div {
    background-color: var(--primary-spi-color);
}
.marker-cluster-small div {
    background-color: var(--primary-spi-color);
}