/* ==========================================================================
   ANXA 2.0 - GUIDA DIGITALE CENTRO STORICO (css/guida-digitale.css)
   UNIFORMATO A SANITÀ, SPORT, DOVE MANGIARE, SHOPPING & CONSULENTI
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. INTRODUZIONE & TITOLI
   -------------------------------------------------------------------------- */
.guida-intro-section {
    margin-bottom: 24px;
}

.guida-intro-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0033A0;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="rossonero"] .guida-intro-title {
    color: var(--yellow-anxa);
}

.guida-intro-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    opacity: 0.95;
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   2. SELETTORE LINGUA (8 LINGUE CON PILLOLE MODERNE)
   -------------------------------------------------------------------------- */
.language-selector {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.lang-pill {
    padding: 8px 14px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.lang-pill:hover {
    transform: translateY(-1px);
    border-color: #0033A0;
}

.lang-pill.active {
    background: #0033A0;
    color: #ffffff;
    border-color: #0033A0;
    box-shadow: 0 4px 12px rgba(0, 51, 160, 0.3);
}

[data-theme="rossonero"] .lang-pill.active {
    background: var(--yellow-anxa);
    color: #000000;
    border-color: var(--yellow-anxa);
    box-shadow: 0 4px 12px rgba(255, 213, 79, 0.3);
}

/* --------------------------------------------------------------------------
   3. DASHBOARD GPS & MAPPA LEAFLET
   -------------------------------------------------------------------------- */
.gps-dashboard {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.gps-dashboard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.gps-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gps-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-main);
}

.gps-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #64748B;
    transition: background-color 0.3s;
}

.gps-dot.active {
    background-color: #25D366;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.3);
    animation: pulse-green 1.5s infinite;
}

.gps-dot.error {
    background-color: #FF3B30;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.gps-details {
    font-size: 0.82rem;
    color: var(--text-main);
    opacity: 0.8;
    font-weight: 600;
}

/* Radar Scan Visual */
.radar-container {
    width: 52px;
    height: 52px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
}

.radar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #0033A0;
    border-radius: 50%;
    opacity: 0;
}

[data-theme="rossonero"] .radar-ring {
    border-color: var(--yellow-anxa);
}

.radar-container.scanning .radar-ring {
    animation: radar-pulse 3s infinite linear;
}

.radar-container.scanning .radar-ring:nth-child(2) { animation-delay: 1s; }
.radar-container.scanning .radar-ring:nth-child(3) { animation-delay: 2s; }

.radar-center {
    width: 10px;
    height: 10px;
    background-color: #0033A0;
    border-radius: 50%;
    z-index: 2;
}

[data-theme="rossonero"] .radar-center {
    background-color: var(--yellow-anxa);
}

@keyframes radar-pulse {
    0% { transform: scale(0.2); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* Mappa Leaflet Contenitore */
#map {
    width: 100%;
    height: 240px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
    z-index: 1;
}

.user-pulse-marker {
    background: #007AFF;
    border: 2px solid #ffffff;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.6);
    animation: user-marker-pulse 1.8s infinite;
}

@keyframes user-marker-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

/* --------------------------------------------------------------------------
   4. INTERRUTTORI SWITCH MODERN
   -------------------------------------------------------------------------- */
.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    user-select: none;
}

.switch-input { display: none; }

.switch-slider {
    width: 42px;
    height: 22px;
    background-color: rgba(127,127,127,0.3);
    border-radius: 20px;
    position: relative;
    transition: background-color 0.3s;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.switch-input:checked + .switch-slider {
    background-color: #25D366;
}

.switch-input:checked + .switch-slider::before {
    transform: translateX(20px);
}

/* --------------------------------------------------------------------------
   5. PANNELLO TOUR GUIDATO & BANNER INIZIO
   -------------------------------------------------------------------------- */
.tour-panel {
    margin-top: 15px;
    border: 1px solid #0033A0 !important;
    display: none;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 51, 160, 0.05);
    border-radius: 18px;
    padding: 16px;
}

[data-theme="rossonero"] .tour-panel {
    border-color: var(--yellow-anxa) !important;
    background: rgba(255, 213, 79, 0.06);
}

.tour-progress-badge {
    background: #0033A0;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 800;
}

[data-theme="rossonero"] .tour-progress-badge {
    background: var(--yellow-anxa);
    color: #000000;
}

.tour-start-banner {
    margin-top: 15px;
    border: 1px solid #0033A0;
    border-left: 5px solid #0033A0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(135deg, rgba(0, 51, 160, 0.08) 0%, rgba(0, 51, 160, 0.02) 100%);
    padding: 18px;
    border-radius: 16px;
}

[data-theme="rossonero"] .tour-start-banner {
    border-color: var(--yellow-anxa);
    border-left-color: var(--yellow-anxa);
    background: linear-gradient(135deg, rgba(255, 213, 79, 0.12) 0%, rgba(255, 213, 79, 0.02) 100%);
}

/* --------------------------------------------------------------------------
   6. FILTRO RIONI / QUARTIERI STORICI
   -------------------------------------------------------------------------- */
.district-filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   7. LISTA CARD MONUMENTI / POI
   -------------------------------------------------------------------------- */
.poi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    margin-bottom: 16px;
    cursor: pointer;
}

.poi-card:hover {
    border-color: #0033A0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="rossonero"] .poi-card:hover {
    border-color: var(--yellow-anxa);
}

.poi-card.near {
    border-color: #25D366 !important;
    box-shadow: 0 8px 26px rgba(37, 211, 102, 0.25) !important;
}

.poi-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.poi-subtitle {
    font-size: 0.8rem;
    color: var(--text-main);
    opacity: 0.75;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poi-distance-badge {
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(127,127,127,0.12);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.poi-card.near .poi-distance-badge {
    background: #25D366;
    color: #ffffff;
}

.poi-body {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.poi-card.expanded .poi-body {
    display: flex;
}

.poi-chevron {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.poi-card.expanded .poi-chevron {
    transform: rotate(180deg);
}

.poi-image-container {
    width: 100%;
    height: 190px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #000000;
}

.poi-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.poi-card:hover .poi-image {
    transform: scale(1.04);
}

.poi-description {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-main);
    white-space: pre-wrap;
}

.poi-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn-action {
    flex: 1;
    min-width: 130px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
}

.btn-play-guide {
    background: linear-gradient(135deg, #FFE066 0%, #FFB300 100%);
    color: #000000 !important;
}

.btn-directions {
    background: var(--card-bg);
    border: 1px solid #0033A0 !important;
    color: #0033A0 !important;
}

[data-theme="rossonero"] .btn-directions {
    border-color: var(--yellow-anxa) !important;
    color: var(--yellow-anxa) !important;
}

/* Equalizzatore Audio in riproduzione TTS */
.audio-wave {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    width: 20px;
}

.poi-card.playing .audio-wave {
    display: flex;
}

.wave-bar {
    width: 3px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 1px;
    animation: bounce-wave 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { animation-duration: 0.6s; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { animation-duration: 0.8s; animation-delay: 0.3s; }
.wave-bar:nth-child(3) { animation-duration: 0.5s; animation-delay: 0.5s; }
.wave-bar:nth-child(4) { animation-duration: 0.7s; animation-delay: 0.2s; }

@keyframes bounce-wave {
    0% { height: 3px; }
    100% { height: 14px; }
}

/* --------------------------------------------------------------------------
   8. LIGHTBOX FULLSCREEN OVERLAY
   -------------------------------------------------------------------------- */
.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.lightbox-overlay.active { display: flex; }

.lightbox-content {
    max-width: 92%;
    max-height: 85vh;
    border-radius: 12px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 20px;
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
}

/* RESPONSIVE */
@media (max-width: 767px) {
    #map {
        height: 200px;
    }

    .poi-title {
        font-size: 1rem;
    }

    .poi-image-container {
        height: 160px;
    }
}
