/* map.php — extracted inline CSS (step 2) */

/* Badge eventi nella scheda profilo */
.profile-events-badge {
    color: white;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    position: relative;
}

.profile-events-badge:hover {
    background: rgba(255, 118, 1, 0.9);
    border-color: rgba(255, 118, 1, 1);
    color: white;
    transform: scale(1.1);
}

.profile-events-badge:active { transform: scale(0.95); }
.profile-events-badge i { font-size: 1.1rem; }

.profile-events-badge span {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #FF7601;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    font-family: 'Agrandir Grand Heavy', sans-serif;
    border: none;
}

/* ── Righe evento/invito nella scheda profilo ───────────────── */
#profile-badges-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    align-items: flex-start;
    min-width: 0;
}

.pbi-row {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 2px 0;
    max-width: 100%;
    min-width: 0;
    transition: opacity 0.15s ease;
}
.pbi-row:hover { opacity: 0.65; }

.pbi-icon {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    flex-shrink: 0;
    width: 13px;
    text-align: center;
}

.pbi-label {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
    line-height: 1.3;
}

.pbi-check {
    font-size: 8px;
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
}

.pbi-row.pbi-invited {
    opacity: 0.38;
    cursor: default;
    pointer-events: none;
}
.pbi-row.pbi-invited:hover { opacity: 0.38; }

/* Handle delle modali - visibile solo su mobile */
.modal-handle { display: none; }
@media (max-width: 768px) { .modal-handle { display: block !important; } }

/* Stili per menu dropdown eventi utente */
#user-events-dropdown { animation: fadeInDropdown 0.2s ease; }
@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#user-events-dropdown::-webkit-scrollbar { width: 6px; }
#user-events-dropdown::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
#user-events-dropdown::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
#user-events-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

#invite-events-dropdown { animation: fadeInDropdown 0.2s ease; }
#invite-events-dropdown::-webkit-scrollbar { width: 6px; }
#invite-events-dropdown::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
#invite-events-dropdown::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
#invite-events-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 768px) {
    .profile-events-badge { width: 40px; height: 40px; font-size: 1rem; }
    .profile-events-badge span { font-size: 0.65rem; padding: 1px 4px; }
    #profile-badges-wrapper { gap: 6px; min-height: 40px; }
    .badge-count { font-size: 0.7rem; padding: 1px 5px; }

    .event-modal-description {
        position: relative;
        max-height: 150px;
        overflow-y: auto;
        padding-bottom: 10px;
        margin: 10px 0;
        color: rgba(255,255,255,0.85);
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .event-modal-description::after {
        content: '';
        position: sticky;
        bottom: -10px;
        left: 0;
        right: 0;
        height: 30px;
        background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.7));
        pointer-events: none;
        display: block;
    }
}

/* Stili per la scheda di profilo con match */
.match-category-all {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.match-category-all:last-child { border-bottom: none; padding-bottom: 6px; }

.match-cat-icons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.match-cat-icons .ucis-bubble { width: 24px; height: 24px; font-size: 10px; }
.match-cat-icons .uci-count-badge { font-size: 7px; min-width: 11px; height: 11px; }

#match-details { display: block; padding: 0 4px; }

.match-category-tit-bar { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.match-icon-wrapper { display: flex; align-items: center; flex-shrink: 0; }
.match-icon-wrapper img { width: 28px; height: 28px; opacity: 0.85; }

.match-label-wrapper { display: flex; flex-direction: column; gap: 2px; }
.match-category-label {
    font-family: "Agrandir Grand Heavy", sans-serif;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    line-height: 1.2;
}
.match-category-label img { width: 16px; height: 16px; }
.match-category-sublabel { font-size: 10px; color: rgba(255,255,255,0.38); font-weight: 400; line-height: 1.2; }

.match-category-progress {
    width: 100%;
    height: 4px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.12);
}

.match-percentage-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-family: "Agrandir Grand Heavy", sans-serif;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    flex-shrink: 0;
    min-width: 38px;
    text-align: right;
}

.match-category-bar {
    height: 100%;
    background-color: #fff;
    transition: width 1s ease;
}

.match-summary {
    margin: 30px 0;
    font-size: 18px;
    text-align: center;
    font-family: Agrandir, sans-serif;
}

.match-emoji { font-size: 24px; margin-right: 10px; }

@keyframes fillProgress {
    0% { width: 0%; opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 1; }
}

.match-category-bar {
    height: 100%;
    position: relative;
    width: 0%;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
}
.match-category-bar.animate { animation: fillProgress 1.2s ease-out forwards; }
.match-category-bar.animate::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ── Mini-chat nella scheda profilo ─────────────────────────── */
#profile-actions { padding: 12px 20px 24px; }

#profile-minichat {
    border-radius: 16px;
    overflow: hidden;
    margin: 30px 0 120px 0;
}

.minichat-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 12px 8px;
}

.minichat-messages {
    max-height: 290px;
    overflow-y: auto;
    padding: 12px 14px 8px;
    display: none;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.minichat-messages::-webkit-scrollbar { width: 4px; }
.minichat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.minichat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}
.minichat-msg.mine {
    align-self: flex-end;
    background: #FF7601;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.minichat-msg.mine a { color: #fff; }
.minichat-msg.theirs {
    align-self: flex-start;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.88);
    border-bottom-left-radius: 4px;
}

#minichat-greetings {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px 4px;
}

.minichat-greeting-chip {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.minichat-greeting-chip:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
}

.minichat-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.minichat-messages[style*="flex"] + .minichat-input-row {
    border-top: 1px solid rgba(255,255,255,0.07);
}

.minichat-input {
    flex: 1;
    background: #fff;
    color: #000;
    border: none;
    outline: none;
    font-size: 13px;
    padding: 6px 12px;
    min-width: 0;
}
.minichat-input::placeholder { color: rgba(0,0,0,0.35); }

.minichat-send-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #FF7601;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.18s ease, opacity 0.18s ease;
}
.minichat-send-btn:hover { background: #e06800; }
.minichat-send-btn:disabled { opacity: 0.45; cursor: default; }

.minichat-full-link-wrapper {
    text-align: center;
    padding: 7px 12px 10px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.minichat-full-link-wrapper a {
    font-size: 11px;
    color: rgba(255,255,255,0.38);
    text-decoration: none;
    transition: color 0.15s;
}
.minichat-full-link-wrapper a:hover { color: rgba(255,255,255,0.7); }

@media (max-width: 768px) {
    #profile-actions { padding: 8px 16px 24px; }
}

.gps-attention-animation { animation: gpsAttention 0.6s ease-in-out; }
@keyframes gpsAttention {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

#crea-viaggio-button:hover {
    transform: scale(1.1) !important;
    background: rgba(255, 118, 1, 1) !important;
    box-shadow: 0 5px 15px rgba(255, 118, 1, 0.4) !important;
}

.map-icon-button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important;
}
.map-icon-button:disabled:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* ============================================================
   MAP2 — SPLIT VIEW LAYOUT (stile Airbnb — light theme)
   ============================================================ */

body {
    overflow: hidden !important;
    display: block !important;  /* annulla il flex globale */
}

.map2-split-wrapper {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    overflow: hidden;
    background: #fff;
    z-index: 0;
}

.users-list-panel {
    width: 45%;
    min-width: 380px;
    max-width: 600px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0d0d0d;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.07);
    z-index: 2;
    flex-shrink: 0;
}

.users-list-header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.mc-notice-map { margin: 12px 16px; border-radius: 10px; }
.mc-notice-map .mc-notice-text { font-size: 12px; }
.mc-notice-map .mc-notice-cta {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 7px;
    background: #FF7601;
    color: #fff;
    border: none;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.users-list-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    font-family: 'Agrandir Grand Heavy', sans-serif;
}

#users-visible-count { font-family: 'Agrandir Grand Heavy', sans-serif; }

.users-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 20px 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(320px, auto);
    gap: 16px;
    align-content: start;
}

.users-list-scroll::-webkit-scrollbar { width: 5px; }
.users-list-scroll::-webkit-scrollbar-track { background: transparent; }
.users-list-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.map-panel {
    flex: 1;
    min-width: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.user-card.map-highlighted {
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.1),
        0 4px 16px rgba(0,0,0,0.4);
}

.user-card.map-active {
    box-shadow:
        0 0 0 2px #FF7601,
        0 6px 24px rgba(255,118,1,0.35);
    outline: none;
}

.user-card-match-badge {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: 'Agrandir Grand Heavy', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.45);
    min-width: 38px;
    min-height: 18px;
}
.user-card-match-badge .match-skeleton {
    display: inline-block;
    width: 28px;
    height: 9px;
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
}

.users-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: rgba(255,255,255,0.3);
    gap: 14px;
    grid-column: 1 / -1;
}
.users-list-empty i { font-size: 40px; color: rgba(255,255,255,0.12); }
.users-list-empty p { font-size: 14px; margin: 0; line-height: 1.6; }

.bottom-sheet-handle { display: none; }

@media (max-width: 768px) {
    .map2-split-wrapper { flex-direction: column !important; }

    .map-panel {
        position: absolute;
        inset: 0;
        height: 100%;
        flex: none;
        z-index: 1;
    }

    .users-list-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 400;
        width: 100% !important;
        min-width: unset !important;
        max-width: unset !important;
        height: 96px !important;
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.55);
        transition: height 0.42s cubic-bezier(0.32, 0.72, 0, 1);
        overflow: hidden;
        will-change: height;
    }

    .bottom-sheet-handle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 18px 0 16px;
        cursor: grab;
        touch-action: none;
        flex-shrink: 0;
        -webkit-user-select: none;
        user-select: none;
        width: 100%;
        gap: 6px;
        min-height: 52px;
        background: linear-gradient(
            to bottom,
            rgba(255,255,255,0.13) 0px,
            rgba(255,255,255,0.06) 2px,
            rgba(255,255,255,0.02) 40%,
            transparent 100%
        );
        border-top: 1px solid rgba(255,255,255,0.22);
    }

    .bottom-sheet-handle:active { cursor: grabbing; }

    .bottom-sheet-handle-bar {
        position: relative;
        width: 120px;
        height: 4px;
        background: #fff;
        border-radius: 999px;
        box-shadow:
            0 0 0 1px rgba(255,255,255,0.20),
            0 6px 16px rgba(0,0,0,0.55);
        transition:
            width 0.22s ease,
            background 0.22s ease,
            box-shadow 0.22s ease,
            transform 0.22s ease,
            opacity 0.22s ease;
        opacity: 0.95;
        animation: handlePulse 2.4s ease-in-out infinite;
    }

    .bottom-sheet-handle-bar::before {
        content: '';
        position: absolute;
        inset: 1px 6px;
        border-radius: inherit;
        background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.9), rgba(255,255,255,0.0));
        opacity: 0.55;
        pointer-events: none;
    }
    .bottom-sheet-handle:active .bottom-sheet-handle-bar,
    .bottom-sheet-handle:hover  .bottom-sheet-handle-bar {
        width: 60px;
        background: linear-gradient(90deg, rgba(255,255,255,1), rgba(255,255,255,0.55));
        box-shadow:
            0 0 0 1px rgba(255,255,255,0.26),
            0 8px 20px rgba(0,0,0,0.65);
        transform: translateY(1px);
        opacity: 1;
    }

    @keyframes handlePulse {
        0%, 100% {
            transform: translateY(0);
            box-shadow:
                0 0 0 1px rgba(255,255,255,0.20),
                0 6px 16px rgba(0,0,0,0.55);
        }
        50% {
            transform: translateY(1px);
            box-shadow:
                0 0 0 1px rgba(255,255,255,0.26),
                0 10px 22px rgba(0,0,0,0.65);
        }
    }

    .users-list-panel[data-bs-state="collapsed"] .users-list-scroll { overflow-y: hidden; }
    .users-list-panel[data-bs-state="half"] .users-list-scroll,
    .users-list-panel[data-bs-state="expanded"] .users-list-scroll {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .users-list-header {
        padding: 4px 20px 10px;
        border-bottom-color: rgba(255,255,255,0.08);
        text-align: center;
    }

    .users-list-scroll {
        padding: 12px 12px 100px;
        gap: 12px;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: minmax(250px, auto);
        -webkit-overflow-scrolling: touch;
    }

    /* Profile card e modale eventi sopra la barra di navigazione del footer */
    .map2-split-wrapper.modal-overlay-open { z-index: 10001 !important; }
    #event-details-modal { z-index: 10001 !important; }

    /* Profile card overlay dentro il bottom-sheet su mobile */
    #users-list-panel > #profile-card-overlay {
        position: absolute !important;
        top: 44px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 0 !important;
        align-items: stretch !important;
        animation: none !important;
        z-index: 10 !important;
        box-shadow: 0 0 30px 30px #000 !important;
    }
    #users-list-panel > #profile-card-overlay #profile-card {
        max-width: 100% !important;
        max-height: none !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: none !important;
        animation: none !important;
        overflow-y: auto;
    }
    #users-list-panel > #profile-card-overlay #profile-close { display: none !important; }
}

/* ─── Barra filtri lista utenti ──────────────────────────────── */
.users-list-filters {
    padding: 8px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow: hidden;
    transition:
        max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        padding    0.28s cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.28s ease,
        border-color 0.28s ease;
    opacity: 1;
}

.users-list-filters.filters-hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-bottom-color: transparent;
    pointer-events: none;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-label {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: 'Agrandir Grand Heavy', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 44px;
}

.sort-pill,
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Agrandir Grand Heavy', sans-serif;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.4);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}

.sort-pill:hover,
.filter-chip:hover {
    border-color: rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.7);
}

.sort-pill.active {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.38);
    color: #fff;
}

.filter-chip.active {
    background: #FF7601;
    border-color: #FF7601;
    color: #fff;
}

@media (max-width: 768px) {
    .users-list-filters { padding: 6px 14px 10px; }
}

