/* Základní styly */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
body {
    font-family: 'Inter', sans-serif;
    background-color: #f7f7f7;
    min-height: 100vh;
}

/* Kontejner pro hlavní obrázek a hot-spoty */
#main-container {
    position: relative;
    max-width: 900px;
    margin: 20px auto;
    border: 3px solid black;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background-color: #e0e0e0;
}

/* Hlavní obrázek */
#main-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    min-height: 500px;
    transition: opacity 0.5s ease-in-out; 
}

/* Styl pro interaktivní hot-spot */
.hotspot {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #000000e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s, opacity 0.3s;
    z-index: 10;
    opacity: 0.9;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    visibility: visible;
    pointer-events: auto;
}

.hotspot.hidden-view-2 {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
}

.hotspot:hover {
    transform: scale(1.1);
    background-color: #CC0000;
    opacity: 1;
}

.hotspot svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Styl pro vysvětlující koláž */
.collage {
    position: absolute;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 300px;
    display: none;
    z-index: 20;
    border: 3px solid #CC0000;
}

/* Zobrazení koláže při najetí myši na desktopu */
@media (min-width: 769px) {
    .hotspot:hover .collage {
        display: block;
    }
}

/* Zobrazení koláže při kliknutí (mobil a aktivní stav) */
.hotspot.hotspot-active .collage {
    display: block;
}

/* Skrytí neaktivních hotspotů, když je jedna koláž otevřená */
#main-container.collage-open .hotspot:not(.hotspot-active) {
    opacity: 0 !important;
    pointer-events: none;
}
#main-container.collage-open .hotspot-active {
    opacity: 1 !important;
    transform: scale(1.0);
}

/* Základní styl pro obrázky v koláži */
.collage img {
    width: 100%;
    height: 200px; 
    border-radius: 6px;
    margin-bottom: 5px;
    object-fit: contain; 
    background-color: #eee;
    cursor: zoom-in;
}

/* Obal pro dva obrázky v jedné koláži */
.collage .two-img-col {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.collage .two-img-col img {
    height: 150px; 
    width: 50%;
    object-fit: cover; 
    margin-bottom: 0;
}

/* Obal pro tři obrázky v jedné koláži */
.collage .three-img-col {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.collage .three-img-col .col-one {
    width: 100%;
}

.collage .three-img-col .col-one img {
    height: 150px; 
    object-fit: contain;
    object-position: top;
}

.collage .three-img-col .col-two {
    display: flex;
    gap: 5px;
    width: 100%;
}

.collage .three-img-col .col-two img {
    width: calc(50% - 2.5px);
    height: 100px; 
    object-fit: contain;
    object-position: top;
}

/* UMÍSTĚNÍ KOLÁŽÍ (RELATIVNÍ K HOTSPOTU) - DESKTOP */
#hotspot-1 .collage { top: 0; left: 50px; transform: translateY(-30%); }
#hotspot-2 .collage { top: 10px; right: 50px; }
#hotspot-3 .collage { bottom: -150px; right: 50px; top: unset; left: unset; }
#hotspot-4 .collage { top: 10px; right: 50px; }
#hotspot-5 .collage { top: 10px; left: 50px; right: unset; }
#hotspot-6 .collage { bottom: 10px; left: 50px; right: unset; }
#hotspot-7 .collage { bottom: 10px; right: 50px; left: unset; }
#hotspot-8 .collage { bottom: -30px; left: 50px; right: unset; }
#hotspot-9 .collage { top: 10px; right: 50px; left: unset; }
#hotspot-10 .collage { bottom: 10px; right: 50px; left: unset; }

.collage-title {
    font-weight: 700;
    color: #CC0000;
    margin-bottom: 5px;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

/* ZOOM MODAL STYLY */
#zoom-modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none; 
    align-items: center; 
    justify-content: center;
    z-index: 1000; 
    padding: 20px;
}
#zoom-modal.active { display: flex; }

#zoom-content-wrapper { 
    position: relative; 
    max-width: 90%; 
    max-height: 90%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

#zoom-content { 
    max-width: 100%; 
    max-height: 100vh; 
    width: auto; 
    height: auto; 
    object-fit: contain; 
    border: 5px solid white; 
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.5); 
    border-radius: 8px; 
    transition: opacity 0.3s; 
}

.zoom-nav-button { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(0, 0, 0, 0.5); 
    color: white; 
    padding: 15px 10px; 
    border: none; 
    cursor: pointer; 
    z-index: 10; 
    border-radius: 4px; 
    opacity: 0.8; 
    transition: background 0.2s, opacity 0.2s; 
    display: none;
}

.zoom-nav-button:hover:not(:disabled) { 
    background: rgba(0, 0, 0, 0.8); 
    opacity: 1; 
}

.zoom-nav-button:disabled { 
    cursor: default; 
    opacity: 0.3 !important; 
}

#prev-button { left: -60px; }
#next-button { right: -60px; }

#close-button { 
    position: absolute; 
    top: -50px; 
    right: -50px; 
    background: #CC0000; 
    color: white; 
    font-size: 24px;  
    padding: 6px 11px; 
    border-radius: 100%; 
    cursor: pointer; 
    z-index: 15; 
    line-height: 1; 
    transition: background 0.2s;
}

#close-button:hover { 
    background: #a30000;
}

/* ========================================== */
/* MOBILNÍ OPTIMALIZACE - HLAVNÍ ZMĚNY */
/* ========================================== */

@media (max-width: 768px) {
    /* Menší odsazení na mobilu */
    body {
        padding: 8px;
    }
    
    /* Zmenšení kontejneru */
    #main-container {
        margin: 10px auto;
        border-width: 2px;
        border-radius: 8px;
    }
    
    /* Menší minimální výška na mobilu */
    #main-image {
        min-height: 300px;
    }
    
    /* VĚTŠÍ HOTSPOTY PRO DOTYKOVÉ OVLÁDÁNÍ */
    .hotspot {
        width: 48px;
        height: 48px;
        /* Zvýraznění pro lepší viditelnost */
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    }
    
    .hotspot svg {
        width: 24px;
        height: 24px;
    }
    
    /* KOLÁŽE NA CELOU ŠÍŘKU OBRAZOVKY */
    .collage {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        border: none;
        border-top: 4px solid #CC0000;
        padding: 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }
    
    /* Větší nadpis v koláži */
    .collage-title {
        font-size: 18px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    /* Menší obrázky v kolážích */
    .collage img {
        height: 140px;
        margin-bottom: 8px;
    }
    
    .collage .two-img-col img {
        height: 120px;
    }
    
    .collage .three-img-col .col-one img {
        height: 120px;
    }
    
    .collage .three-img-col .col-two img {
        height: 80px;
    }
    
    /* Větší text v popisku */
    .collage .text-xs {
        font-size: 13px !important;
        line-height: 1.4;
        margin-top: 8px;
    }
    
    /* ZOOM MODAL - LEPŠÍ OVLÁDÁNÍ */
    #zoom-content-wrapper { 
        max-width: 100%; 
        max-height: 100%; 
        padding: 0 10px;
    }
    
    #zoom-content {
        border-width: 2px;
        max-height: 85vh;
    }
    
    /* Navigační tlačítka dole */
    #prev-button { 
        left: 10px;
        top: auto;
        bottom: 20px;
        transform: none;
        padding: 12px 10px;
        border-radius: 8px;
        font-size: 18px;
    }
    
    #next-button { 
        right: 10px;
        top: auto;
        bottom: 20px;
        transform: none;
        padding: 12px 10px;
        border-radius: 8px;
        font-size: 18px;
    }
    
    /* Zavírací tlačítko v rohu */
    #close-button { 
        top: 15px;
        right: 15px;
        font-size: 28px;
        padding: 8px 14px;
    }
    
    /* Tlačítko pro přepínání pohledů */
    #toggle-view-btn {
        width: 100%;
        max-width: 400px;
        padding: 14px 24px;
        font-size: 16px;
    }
    
    /* Nadpisy */
    .text-3xl {
        font-size: 24px !important;
    }
    
    .text-lg {
        font-size: 16px !important;
    }
}

/* EXTRA MALÉ DISPLEJE (iPhone SE apod.) */
@media (max-width: 380px) {
    .hotspot {
        width: 44px;
        height: 44px;
    }
    
    .collage {
        max-height: 65vh;
        padding: 12px;
    }
    
    .collage img {
        height: 120px;
    }
    
    .collage .two-img-col img {
        height: 100px;
    }
    
    .collage .three-img-col .col-one img {
        height: 100px;
    }
    
    .collage .three-img-col .col-two img {
        height: 70px;
    }
    
    #zoom-content {
        max-height: 80vh;
    }
}

/* LANDSCAPE MÓDY NA MOBILECH */
@media (max-width: 768px) and (orientation: landscape) {
    .collage {
        max-height: 85vh;
    }
    
    #zoom-content {
        max-height: 90vh;
    }
    
    #prev-button,
    #next-button {
        bottom: 10px;
        padding: 10px 8px;
    }
}