/* ======= PIANIFICA · stili del plugin ViviPorto Planner ======= */

.viviporto-planner-wrapper {
    --navy-900: #050b17;
    --navy-800: #0a1628;
    --cyan-400: #8be3ff;
    --cyan-500: #4cc9f0;
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
}

.viviporto-planner-wrapper .pianifica-hero {
    position: relative;
    padding: 120px 28px 70px;
    text-align: center;
    background-image:
        linear-gradient(
            135deg,
            rgba(5, 11, 23, 0.75) 0%,
            rgba(5, 11, 23, 0.45) 50%,
            rgba(11, 29, 51, 0.65) 100%
        );
    background-size: cover;
    background-position: center 55%;
    background-repeat: no-repeat;
    color: #fff;
    overflow: hidden;
    border-radius: 18px;
    margin-bottom: 24px;
}
.viviporto-planner-wrapper .pianifica-hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(5,11,23,0) 0%, var(--navy-900) 100%);
    pointer-events: none;
}
.viviporto-planner-wrapper .pianifica-hero > * { position: relative; z-index: 1; }
.viviporto-planner-wrapper .pianifica-hero .eyebrow {
    display: inline-block;
    font-family: var(--font-body); font-size: 12px;
    letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--cyan-400); font-weight: 600;
    margin-bottom: 18px;
    padding: 5px 14px;
    border: 1px solid rgba(76,201,240,0.4);
    border-radius: 999px;
    background: rgba(76,201,240,0.08);
    backdrop-filter: blur(6px);
}
.viviporto-planner-wrapper .pianifica-hero h1 {
    font-family: var(--font-head); font-weight: 900;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.05; letter-spacing: -0.02em;
    color: #fff; max-width: 900px; margin: 0 auto 22px;
    text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.viviporto-planner-wrapper .pianifica-hero h1 .accent { color: var(--cyan-400); }
.viviporto-planner-wrapper .pianifica-hero p.lead {
    max-width: 720px; margin: 0 auto;
    font-size: 16px; line-height: 1.65;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* Pianificatore */
.viviporto-planner-wrapper .planner {
    max-width: 1400px; margin: 0 auto;
    padding: 0px 0px 40px;
    display: grid; grid-template-columns: 1fr 420px;
    gap: 24px;
}
.viviporto-planner-wrapper .planner-map-wrap {
    position: relative;
    border-radius: 18px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: var(--navy-800);
    height: 680px;
}
.viviporto-planner-wrapper #plannerMap {
    width: 100%; height: 100%;
    background: #0a1628;
}
.viviporto-planner-wrapper .map-hint {
    position: absolute; top: 16px; left: 16px;
    background: rgba(5,11,23,0.85); backdrop-filter: blur(10px);
    padding: 10px 16px; border-radius: 10px;
    font-size: 13px; color: rgba(255,255,255,0.9);
    border: 1px solid rgba(76,201,240,0.2);
    z-index: 401; pointer-events: none;
    max-width: 280px; line-height: 1.4;
    transition: opacity 0.3s;
}
.viviporto-planner-wrapper .map-hint strong { color: var(--cyan-400); }

/* Sidebar */
.viviporto-planner-wrapper .planner-panel {
    background: var(--navy-800);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 24px;
    height: 680px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(76,201,240,0.3) transparent;
}
.viviporto-planner-wrapper .planner-panel::-webkit-scrollbar { width: 6px; }
.viviporto-planner-wrapper .planner-panel::-webkit-scrollbar-thumb { background: rgba(76,201,240,0.3); border-radius: 3px; }

.viviporto-planner-wrapper .panel-title {
    font-family: var(--font-head); font-weight: 800;
    font-size: 13px; letter-spacing: 0.16em;
    text-transform: uppercase; color: rgba(255,255,255,0.55);
    margin: 0 0 14px;
}

.viviporto-planner-wrapper .route-list { display: grid; gap: 8px; margin-bottom: 10px; }
.viviporto-planner-wrapper .route-slot {
    position: relative;
    display: grid; grid-template-columns: 36px 1fr 28px;
    align-items: center; gap: 10px;
    padding: 11px 13px 11px 11px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.25s;
}
.viviporto-planner-wrapper .route-slot.active {
    background: rgba(76,201,240,0.07);
    border: 1px dashed rgba(76,201,240,0.55);
    animation: plan-pulse-border 1.8s ease-in-out infinite;
}
@keyframes plan-pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76,201,240,0); }
    50%      { box-shadow: 0 0 0 3px rgba(76,201,240,0.14); }
}
.viviporto-planner-wrapper .slot-icon {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-weight: 800; font-size: 13px;
    flex-shrink: 0; color: var(--navy-900);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.viviporto-planner-wrapper .route-slot.start .slot-icon { background: #4cd964; }
.viviporto-planner-wrapper .route-slot.intermediate .slot-icon { background: #ffb86c; }
.viviporto-planner-wrapper .route-slot.end .slot-icon   { background: #ff4d6d; color: #fff; }
.viviporto-planner-wrapper .slot-body { min-width: 0; }
.viviporto-planner-wrapper .slot-kick {
    font-size: 9px; letter-spacing: 0.14em;
    text-transform: uppercase; color: rgba(255,255,255,0.45);
    font-weight: 600; margin-bottom: 1px;
}
.viviporto-planner-wrapper .slot-name {
    font-family: var(--font-head); font-weight: 700;
    font-size: 14px; color: #fff; line-height: 1.25;
    word-break: break-word;
}
.viviporto-planner-wrapper .slot-region {
    font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 2px;
}
.viviporto-planner-wrapper .slot-placeholder {
    font-family: var(--font-body); font-weight: 400;
    font-style: italic; font-size: 12px;
    color: rgba(255,255,255,0.5);
}
.viviporto-planner-wrapper .slot-x {
    width: 26px; height: 26px; border-radius: 50%;
    border: 0; background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-size: 18px; line-height: 1;
    cursor: pointer; transition: all 0.2s;
    font-family: Arial, sans-serif;
    display: flex; align-items: center; justify-content: center;
}
.viviporto-planner-wrapper .slot-x:hover { background: rgba(255,77,109,0.18); color: #ff97ab; }
.viviporto-planner-wrapper .slot-x.hidden { visibility: hidden; }

.viviporto-planner-wrapper .route-add {
    width: 100%; padding: 11px;
    border-radius: 12px;
    background: transparent;
    border: 1px dashed rgba(76,201,240,0.35);
    color: var(--cyan-400);
    font-family: var(--font-head); font-weight: 700;
    font-size: 13px; letter-spacing: 0.04em;
    cursor: pointer; transition: all 0.2s;
    margin-bottom: 18px;
}
.viviporto-planner-wrapper .route-add:hover:not(:disabled) {
    background: rgba(76,201,240,0.06);
    border-color: var(--cyan-400);
}
.viviporto-planner-wrapper .route-add:disabled { opacity: 0.35; cursor: not-allowed; }

.viviporto-planner-wrapper .planner-ctrl {
    display: flex; gap: 10px; margin-bottom: 20px;
}
.viviporto-planner-wrapper .planner-btn {
    flex: 1; padding: 11px; border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff; font-family: var(--font-head); font-weight: 700;
    font-size: 12px; letter-spacing: 0.06em;
    cursor: pointer; transition: all 0.2s;
}
.viviporto-planner-wrapper .planner-btn:hover { background: rgba(255,255,255,0.1); }

.viviporto-planner-wrapper .planner-summary {
    padding: 14px 16px; border-radius: 12px;
    background: linear-gradient(160deg, rgba(76,201,240,0.1), rgba(76,201,240,0.02));
    border: 1px solid rgba(76,201,240,0.2);
    margin-bottom: 20px;
    display: none;
}
.viviporto-planner-wrapper .planner-summary.shown { display: block; }
.viviporto-planner-wrapper .planner-summary .row {
    display: flex; justify-content: space-between;
    font-size: 13px; color: rgba(255,255,255,0.75);
    padding: 4px 0;
}
.viviporto-planner-wrapper .planner-summary .row strong {
    color: var(--cyan-400); font-family: var(--font-head); font-weight: 700;
}

.viviporto-planner-wrapper .planner-results-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 12px;
}
.viviporto-planner-wrapper .planner-results-head h3 {
    font-family: var(--font-head); font-weight: 800;
    font-size: 16px; letter-spacing: 0.04em;
    text-transform: uppercase; color: #fff; margin: 0;
}
.viviporto-planner-wrapper .planner-results-head .count {
    font-size: 12px; color: var(--cyan-400); font-weight: 600;
}

.viviporto-planner-wrapper .leg-header {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 0 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(76,201,240,0.04);
    border-left: 3px solid var(--cyan-500);
    font-size: 11px;
}
.viviporto-planner-wrapper .leg-header:first-child { margin-top: 0; }
.viviporto-planner-wrapper .leg-header .leg-num {
    font-family: var(--font-head); font-weight: 800;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--cyan-400);
}
.viviporto-planner-wrapper .leg-header .leg-route {
    flex: 1; color: rgba(255,255,255,0.85);
    font-weight: 500;
    word-break: break-word; line-height: 1.3;
}
.viviporto-planner-wrapper .leg-header .leg-dist {
    font-family: var(--font-head); font-weight: 700;
    color: rgba(255,255,255,0.7);
    font-size: 11px; white-space: nowrap;
}

.viviporto-planner-wrapper .planner-results { display: grid; gap: 6px; }
.viviporto-planner-wrapper .res-card {
    display: flex; flex-direction: column;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
    transition: all 0.2s;
    min-width: 0;
}
.viviporto-planner-wrapper .res-card:hover {
    background: rgba(76,201,240,0.06);
    border-color: rgba(76,201,240,0.25);
    transform: translateX(2px);
}
.viviporto-planner-wrapper .res-card-link {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px;
    text-decoration: none; color: #fff;
    min-width: 0;
}
.viviporto-planner-wrapper .res-card .pin {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(76,201,240,0.15); color: var(--cyan-400);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-weight: 800; font-size: 12px;
    flex-shrink: 0;
}
.viviporto-planner-wrapper .res-card .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.viviporto-planner-wrapper .res-card .nm {
    font-family: var(--font-head); font-weight: 700;
    font-size: 14px; color: #fff; line-height: 1.3;
}
.viviporto-planner-wrapper .res-card .rg {
    font-size: 11px; color: rgba(255,255,255,0.55);
    margin-top: 3px;
}
.viviporto-planner-wrapper .res-card .meta {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    margin-top: 8px;
    font-size: 11px; color: rgba(255,255,255,0.5);
}
.viviporto-planner-wrapper .res-card .meta span strong {
    color: var(--cyan-400);
    font-family: var(--font-head); font-weight: 700;
    margin-right: 3px;
}
.viviporto-planner-wrapper .res-card-actions {
    display: flex;
    border-top: 1px solid rgba(76,201,240,0.18);
}
.viviporto-planner-wrapper .res-add-stop, .viviporto-planner-wrapper .res-cmp-btn {
    flex: 1; padding: 8px 8px;
    background: rgba(76,201,240,0.06);
    border: 0;
    color: var(--cyan-400);
    cursor: pointer;
    font-family: var(--font-head); font-weight: 700;
    font-size: 10.5px; letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
    gap: 6px;
    min-width: 0;
}
.viviporto-planner-wrapper .res-cmp-btn {
    border-left: 1px solid rgba(76,201,240,0.18);
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.7);
}
.viviporto-planner-wrapper .res-add-stop:hover {
    background: rgba(76,201,240,0.16);
    color: #fff;
}
.viviporto-planner-wrapper .res-cmp-btn:hover {
    background: rgba(76,201,240,0.16);
    color: var(--cyan-400);
}
.viviporto-planner-wrapper .res-cmp-btn.is-added {
    background: #4cc9f0;
    color: #0a1628;
}
.viviporto-planner-wrapper .res-cmp-btn.is-added:hover {
    background: #6ad6f5;
    color: #0a1628;
}
.viviporto-planner-wrapper .res-cmp-btn.is-full {
    background: rgba(255, 124, 110, 0.18);
    color: #ff7c6e;
    animation: vp-cmp-shake 0.4s ease-in-out;
}
.viviporto-planner-wrapper .res-cmp-btn svg {
    width: 13px; height: 13px;
    flex: 0 0 auto;
}
.viviporto-planner-wrapper .res-cmp-btn span, .viviporto-planner-wrapper .res-add-stop span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}
.viviporto-planner-wrapper .res-add-stop .plus {
    font-size: 14px; line-height: 1;
    font-weight: 800;
}

.viviporto-planner-wrapper .planner-empty-state {
    text-align: center; padding: 40px 12px;
    color: rgba(255,255,255,0.4);
    font-size: 13px; line-height: 1.55;
}
.viviporto-planner-wrapper .planner-empty-state svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: 0.3; }

.viviporto-planner-wrapper .disc-band {
    max-width: 1400px; margin: 0 auto 60px;
    padding: 20px 28px;
    display: grid; grid-template-columns: auto 1fr;
    gap: 16px; align-items: flex-start;
}
.viviporto-planner-wrapper .disc-band .icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,184,108,0.12);
    border: 1px solid rgba(255,184,108,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.viviporto-planner-wrapper .disc-band .text {
    font-size: 13px; line-height: 1.65;
    color: rgba(255,255,255,0.65);
}
.viviporto-planner-wrapper .disc-band .text strong { color: #ffb86c; font-weight: 600; }

/* Marker Leaflet */
.vpm-pin {
    width: 24px; height: 24px; border-radius: 50%;
    background: #4cc9f0; border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    cursor: pointer; transition: all 0.2s;
}
.vpm-pin.start        { background: #4cd964; }
.vpm-pin.end          { background: #ff4d6d; }
.vpm-pin.intermediate { background: #ffb86c; }
.vpm-pin.along        { background: #8be3ff; width: 18px; height: 18px; border-width: 2px; }
.vpm-pin.dimmed       { background: rgba(255,255,255,0.28); border-color: rgba(255,255,255,0.45); }

@media (max-width: 900px) {
    .viviporto-planner-wrapper .planner { grid-template-columns: 1fr; }
    .viviporto-planner-wrapper .planner-map-wrap { height: 420px; }
    .viviporto-planner-wrapper .planner-panel { height: auto; max-height: 620px; }
}
