/**
 * Mappa Contatti – Frontend styles
 */

/* Layout */
.mpc-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 60px;
    align-items: start;
}

/* ─── Info Panel ─── */
.mpc-info-panel {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-radius: 24px;
    padding: 40px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 40px;
}

.mpc-office-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mpc-office-name {
    font-family: 'Raleway', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.mpc-office-type {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Contact list */
.mpc-contact-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mpc-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 0;
    background: none;
    border-radius: 0;
    border: none;
    transition: all 0.3s ease;
}

.mpc-contact-item:hover {
    background: none;
    border: none;
    transform: translateX(4px);
}

.mpc-contact-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.mpc-contact-item:hover .mpc-contact-icon {
    color: #94a3b8;
    opacity: 1;
}

.mpc-contact-content {
    flex: 1;
}

.mpc-contact-label {
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.mpc-contact-value {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #f1f5f9;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.mpc-contact-item:hover .mpc-contact-value {
    color: #ffffff;
}

.mpc-contact-value a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.mpc-contact-value a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

/* Divider */
.mpc-contact-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

/* Impianti section */
.mpc-impianti-title {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 16px;
}

.mpc-impianto-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 0;
    padding: 0;
}

.mpc-impianto-item + .mpc-impianto-item {
    margin-top: 24px;
}

.mpc-impianto-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
    margin-top: 3px;
}

.mpc-impianto-content {
    flex: 1;
}

.mpc-impianto-name {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.mpc-impianto-address {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #e2e8f0;
    line-height: 1.5;
}

/* Embedded Google Maps */
.mpc-map-embed-wrap {
    position: relative;
    margin-top: 12px !important;
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mpc-embedded-map {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 8px;
    display: block;
}

.mpc-map-embed-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 8px;
    z-index: 0;
}

.mpc-map-embed-fallback p {
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    margin: 0;
    padding: 16px;
    line-height: 1.5;
}

/* ─── Map ─── */
.mpc-map-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.mpc-map-placeholder {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
}

.mpc-map-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Map points */
.mpc-map-point {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    padding: 0;
    background: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.mpc-map-point.mpc-headquarter {
    background: #6BB5FF;
    animation: mpcPulseHQ 4.5s ease-in-out infinite;
}

.mpc-map-point.mpc-sede-operativa {
    background: #dc2626;
    animation: mpcPulseOP 4.5s ease-in-out infinite;
}

/* Pulse animations */
@keyframes mpcPulseHQ {
    0%, 100% {
        box-shadow:
            0 4px 15px rgba(27, 130, 153, 0.25),
            0 0 0 2px rgba(27, 105, 153, 0.1);
    }
    50% {
        box-shadow:
            0 4px 25px rgba(27, 105, 153, 0.4),
            0 0 0 6px rgba(27, 73, 153, 0.15),
            0 0 0 12px rgba(27, 40, 153, 0.05);
    }
}

@keyframes mpcPulseOP {
    0%, 100% {
        box-shadow:
            0 4px 15px rgba(220, 38, 38, 0.25),
            0 0 0 2px rgba(220, 38, 38, 0.1);
    }
    50% {
        box-shadow:
            0 4px 25px rgba(220, 38, 38, 0.4),
            0 0 0 6px rgba(220, 38, 38, 0.15),
            0 0 0 12px rgba(220, 38, 38, 0.05);
    }
}

/* Pin Drop */
.mpc-map-pin {
    position: absolute;
    width: 24px;
    height: 36px;
    z-index: 20;
    pointer-events: none;
    transform: translate(-51%, -100%);
    margin-top: 6px;
}

.mpc-map-pin::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.mpc-map-pin::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 8px solid #dc2626;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes mpcPinDrop {
    0% {
        transform: translate(-51%, -150px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translate(-51%, -100%) scale(1.1);
        opacity: 1;
    }
    80% {
        transform: translate(-51%, -94%) scale(0.95);
    }
    100% {
        transform: translate(-51%, -100%) scale(1);
        opacity: 1;
    }
}

.mpc-map-pin.mpc-dropping {
    animation: mpcPinDrop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Tooltip */
.mpc-tooltip {
    font-family: 'Raleway', sans-serif;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    letter-spacing: 0.3px;
}

.mpc-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.mpc-map-point:hover .mpc-tooltip,
.mpc-map-point:focus .mpc-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Legend ─── */
.mpc-map-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin: 20px 0;
}

.mpc-map-legend.mpc-desktop-only {
    margin-top: 40px;
    margin-bottom: 0;
}

.mpc-map-legend.mpc-mobile-only {
    margin-bottom: 20px;
    margin-top: 0;
}

.mpc-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpc-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.mpc-legend-dot.mpc-headquarter {
    background: #6BB5FF;
}

.mpc-legend-dot.mpc-sede-operativa {
    background: #dc2626;
}

.mpc-legend-item span {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #e2e8f0;
    white-space: nowrap;
}

/* Show/hide legend by screen size */
.mpc-mobile-only {
    display: none;
}

.mpc-desktop-only {
    display: flex;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .mpc-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .mpc-info-panel {
        position: static;
        order: 2;
    }

    .mpc-map-container {
        order: 1;
        max-width: 500px;
    }

    .mpc-mobile-only {
        display: flex;
    }

    .mpc-desktop-only {
        display: none;
    }

    .mpc-map-legend {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .mpc-container {
        gap: 30px;
    }

    .mpc-info-panel {
        padding: 30px 24px;
    }

    .mpc-office-name {
        font-size: 28px;
    }

    .mpc-map-container {
        max-width: 100%;
        margin: 0;
    }

    .mpc-map-placeholder {
        border-radius: 16px;
    }

    .mpc-embedded-map {
        height: 180px;
    }

    .mpc-map-legend {
        gap: 20px;
    }

    .mpc-legend-item span {
        font-size: 13px;
    }

    .mpc-legend-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .mpc-container {
        gap: 25px;
    }

    .mpc-info-panel {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .mpc-office-name {
        font-size: 24px;
    }

    .mpc-office-header {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }

    .mpc-contact-list {
        gap: 20px;
    }

    .mpc-contact-item {
        gap: 14px;
    }

    .mpc-contact-value {
        font-size: 15px;
    }

    .mpc-map-placeholder {
        border-radius: 12px;
    }

    .mpc-map-point {
        width: 18px;
        height: 18px;
    }

    .mpc-tooltip {
        font-size: 11px;
        padding: 6px 10px;
    }

    .mpc-map-legend {
        gap: 16px 12px;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .mpc-legend-item {
        flex: 0 0 calc(50% - 6px);
        width: calc(50% - 6px);
        justify-content: flex-start;
    }
}
