@charset "utf-8";
/* CSS Document */

:root {
    --active-color: #FFA600;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #f0f0f0;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

#map {
    height: 100vh;
    width: 100vw;
    background: #ffffff;
    cursor: grab;
}

#map:active {
    cursor: grabbing;
}

.leaflet-image-layer {
    transition: opacity 0.6s ease-in-out;
}

header {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    text-align: center;
    background: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 6px;
    border-radius: 8px;
}

header img {
    max-width: 200px;
    height: auto;
}

#rotate-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    color: white;
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

@media (max-height: 450px) and (orientation: landscape) {
    #rotate-message {
        display: flex;
    }
}

/* ============================================================
   TIMELINE UI
   ============================================================ */
.timeline-container {
    position: absolute;
    bottom: 30px;
    left: 2.5%;
    z-index: 1000;
    width: 40%;
    max-width: 850px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    gap: 25px;
}

.zoom-controls-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 20px;
    border-right: 2px solid #CCCCCC;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #FF2A00;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.zoom-btn:hover {
    background-color: #FFA600 !important;
    transform: scale(1.1);
}

.controls-wrapper {
    flex-grow: 1;
    position: relative;
    padding-top: 45px;
}

.timeline-icons-wrapper {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    padding: 0 10px;
}

.era-icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.era-icon:hover {
    transform: scale(1.3);
}

.era-icon.active {
    transform: scale(1.5) translateY(-15px);
}

.slider {
    width: 90%;
    height: 5px;
    border-radius: 10px;
    background: #cccccc;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    display: block;
    margin-left: 25px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 30px;
    background: var(--active-color);
    clip-path: polygon(50% 0%, 100% 40%, 100% 100%, 0% 100%, 0% 40%);
    cursor: pointer;
    transition: background 0.4s ease;
    margin-top: -10px;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.label-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 90px;
    color: #909090;
    transition: color 0.4s ease;
    line-height: 1.2;
    cursor: pointer;
}

.era-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.era-date {
    font-size: 0.75rem;
    font-weight: 600;
}

.label-group.active {
    color: var(--active-color);
}

/* ============================================================
   TOOLTIP: Stile pulito bianco/nero
   ============================================================ */
.leaflet-tooltip-own {
    background: #ffffff;
    color: #2c3e50;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    line-height: 1.4;
    white-space: normal;
    width: 180px;
}

.leaflet-tooltip-right::before {
    border-right-color: #ffffff;
}

.leaflet-tooltip {
    border: none;
}

/* ============================================================
   MODALE: Layout e Scrollbar
   ============================================================ */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    border-radius: 15px;
    width: 80%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Personalizzazione Scrollbar Webkit */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 20px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.modal-photo-hero {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 0;
}

.modal-description {
    padding: 25px;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #333;
}

.close-button {
    position: absolute; 
    right: 15px; 
    top: 10px;
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer;
    z-index: 2001;
    color: #333;
}

iframe { 
    width: 100%; 
    aspect-ratio: 16 / 9; 
    border: none; 
    border-radius: 10px; 
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    header { top: 10px; right: 10px; padding: 5px 8px;}
            header h2 { font-size: 10pt !important; }
			header img { max-width: 150px}
    .timeline-container { width: 90% !important; bottom: 15px; gap: 15px; padding: 10px; }
    .zoom-controls-container { padding-right: 10px; }
    .zoom-btn { width: 35px; height: 35px; font-size: 18px; }
    .era-icon { width: 40px; height: 40px; }
    .era-title { font-size: 0.55rem; }
    .era-date { font-size: 0.65rem; }
    .slider { margin-left: 20px; width: 85%; }
    .label-group { width: 60px; }
    .modal-content {
        margin-top: 5%;
        max-height: 85vh;
        width: 95%;
    }
}