/* Základní nastavení */
body {
    margin: 0;
    padding: 0;
    background-color: #ffe6e6; /* Růžové pozadí stránky */
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* TLAČÍTKO ZPĚT (MENU) */
.menu-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    
    /* 1. BARVA A TEXT */
    background-color: #ff66b2; /* Sytější růžová */
    color: white;              /* Bílý text */
    text-decoration: none;     /* Zruší podtržení odkazu */
    font-weight: bold;
    font-size: 1.1rem;
    
    /* 2. TVAR PARALENU (TABLETKY) */
    padding: 12px 35px;        /* Víc do šířky, aby to vypadalo jako pilulka */
    border-radius: 50px;       /* Maximální kulatost rohů */
    
    /* 3. EFEKTY */
    box-shadow: 0 4px 10px rgba(255, 102, 178, 0.3); /* Jemný růžový stín */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Plynulý pohyb */
    z-index: 100;
}

/* EFEKT PŘI NAJETÍ MYŠÍ */
.menu-btn:hover {
    transform: translateY(-5px); /* ZVEDNE SE o 5 pixelů nahoru */
    box-shadow: 0 8px 20px rgba(255, 102, 178, 0.6); /* Stín se zvětší (vypadá to 3D) */
    background-color: #ff4da6; /* O trošičku tmavší růžová pro efekt stisknutí */
}

/* Hlavní rámeček galerie */
.gallery-container {
    position: relative;
    width: 95%;
    max-width: 1000px;
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

h2 {
    text-align: center;
    color: #d63384;
    margin-bottom: 25px;
    font-size: 2rem;
}

/* Obal pro slidery */
.slider-wrapper {
    position: relative;
    min-height: 350px; /* Aby stránka neskákala */
}

/* Mřížka fotek (4 sloupce, 2 řádky) */
.slide {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    animation: fadeEffect 0.6s;
}

.slide.active {
    display: grid;
}

/* Styl fotek v mřížce */
.slide img {
    width: 100%;
    height: 180px; /* Výška náhledu */
    object-fit: cover;
    border-radius: 10px;
    cursor: zoom-in; /* Změní kurzor na lupu */
    transition: transform 0.3s, filter 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.slide img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Šipky (Vlevo/Vpravo) */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    color: white;
    background-color: #d63384;
    font-weight: bold;
    font-size: 24px;
    border-radius: 50%;
    border: none;
    user-select: none;
    z-index: 10;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(214, 51, 132, 0.4);
}

.prev { left: -25px; }
.next { right: -25px; }

.prev:hover, .next:hover {
    background-color: #a82363;
    transform: scale(1.1);
}

/* Animace prolnutí */
@keyframes fadeEffect {
    from {opacity: 0} 
    to {opacity: 1}
}

/* --- MODAL (FULLSCREEN) --- */
/* Černé pozadí přes celou obrazovku */
.modal {
    display: none; /* Skryté defaultně */
    position: fixed;
    z-index: 9999; /* Musí být úplně nahoře */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.9); /* 90% černá */
    
    /* Centrování velké fotky */
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

/* Velká fotka */
.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    animation: zoomIn 0.3s;
}

/* Tlačítko zavřít (X) */
.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
}

/* Animace modalu */
@keyframes zoomIn {
    from {transform: scale(0.5)} 
    to {transform: scale(1)}
}

@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

/* --- MOBILNÍ VERZE --- */
@media only screen and (max-width: 700px) {
    .slide {
        grid-template-columns: repeat(2, 1fr); /* Jen 2 sloupce na mobilu */
        grid-template-rows: repeat(4, 1fr);
    }
    .slide img {
        height: 120px;
    }
    .prev { left: -10px; }
    .next { right: -10px; }
}

/* --- ANIMOVANÉ POZADÍ (SRDÍČKA) --- */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* DŮLEŽITÉ: Aby to bylo AŽ za fotkami */
}

.floating-hearts span {
    position: absolute;
    display: block;
    bottom: -50px; /* Začínají pod obrazovkou */
    font-size: 20px;
    color: rgba(255, 0, 0, 0.3); /* Průhledná červená */
    animation: floatUp 15s linear infinite;
    opacity: 0;
}

/* --- ANIMOVANÉ POZADÍ (HUSTÁ ZÁPLAVA SRDÍČEK) --- */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* Aby to bylo za fotkami */
    pointer-events: none; /* Aby šlo klikat skrz ně */
}

.floating-hearts span {
    position: absolute;
    display: block;
    bottom: -100px; /* Začínají hlouběji pod obrazovkou */
    font-size: 20px;
    color: rgba(255, 0, 0, 0.4); /* Trochu viditelnější červená */
    animation: floatUp 15s linear infinite;
    opacity: 0;
}

/* --- ANIMOVANÉ POZADÍ (DÉŠŤ SRDÍČEK 🌧️❤️) --- */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* Aby to bylo za fotkami */
    pointer-events: none; /* Aby šlo klikat skrz ně */
}

.floating-hearts span {
    position: absolute;
    display: block;
    /* ZMĚNA 1: Začínají NAD obrazovkou */
    top: -100px;
    /* bottom: -100px; <--- Toto jsme smazali */
    
    font-size: 20px;
    color: rgba(255, 0, 0, 0.6); /* Trochu sytější červená pro déšť */
    
    /* ZMĚNA 2: Nová animace "rainDown" a rychlejší čas (8s místo 15s) */
    animation: rainDown 8s linear infinite;
    opacity: 0;
}

/* --- NASTAVENÍ PRO KAŽDÉ Z 25 SRDÍČEK --- */
/* (Toto zůstává stejné - určuje pozici zleva a různorodost rychlostí) */
.floating-hearts span:nth-child(1) { left: 5%; width: 80px; font-size: 40px; animation-delay: 0s; animation-duration: 7s; }
.floating-hearts span:nth-child(2) { left: 10%; width: 20px; font-size: 20px; animation-delay: 2s; animation-duration: 10s; }
.floating-hearts span:nth-child(3) { left: 15%; width: 50px; font-size: 30px; animation-delay: 4s; animation-duration: 5s; }
.floating-hearts span:nth-child(4) { left: 20%; width: 60px; font-size: 50px; animation-delay: 1s; animation-duration: 8s; }
.floating-hearts span:nth-child(5) { left: 25%; width: 20px; font-size: 25px; animation-delay: 3s; animation-duration: 12s; }

.floating-hearts span:nth-child(6) { left: 30%; width: 110px; font-size: 60px; animation-delay: 1s; animation-duration: 9s; }
.floating-hearts span:nth-child(7) { left: 35%; width: 30px; font-size: 35px; animation-delay: 2s; animation-duration: 6s; }
.floating-hearts span:nth-child(8) { left: 40%; width: 25px; font-size: 20px; animation-delay: 4s; animation-duration: 15s; }
.floating-hearts span:nth-child(9) { left: 45%; width: 15px; font-size: 30px; animation-delay: 0s; animation-duration: 11s; }
.floating-hearts span:nth-child(10) { left: 50%; width: 150px; font-size: 40px; animation-delay: 3s; animation-duration: 14s; }

.floating-hearts span:nth-child(11) { left: 55%; width: 40px; font-size: 28px; animation-delay: 1s; animation-duration: 8s; }
.floating-hearts span:nth-child(12) { left: 60%; width: 90px; font-size: 55px; animation-delay: 2s; animation-duration: 10s; }
.floating-hearts span:nth-child(13) { left: 65%; width: 20px; font-size: 18px; animation-delay: 4s; animation-duration: 6s; }
.floating-hearts span:nth-child(14) { left: 70%; width: 60px; font-size: 45px; animation-delay: 0s; animation-duration: 9s; }
.floating-hearts span:nth-child(15) { left: 75%; width: 30px; font-size: 32px; animation-delay: 3s; animation-duration: 13s; }

.floating-hearts span:nth-child(16) { left: 80%; width: 100px; font-size: 65px; animation-delay: 1s; animation-duration: 7s; }
.floating-hearts span:nth-child(17) { left: 85%; width: 25px; font-size: 22px; animation-delay: 3s; animation-duration: 11s; }
.floating-hearts span:nth-child(18) { left: 90%; width: 50px; font-size: 38px; animation-delay: 5s; animation-duration: 6s; }
.floating-hearts span:nth-child(19) { left: 95%; width: 15px; font-size: 15px; animation-delay: 2s; animation-duration: 14s; }
.floating-hearts span:nth-child(20) { left: 50%; width: 80px; font-size: 42px; animation-delay: 4s; animation-duration: 9s; }

.floating-hearts span:nth-child(21) { left: 5%; width: 40px; font-size: 25px; animation-delay: 6s; animation-duration: 10s; }
.floating-hearts span:nth-child(22) { left: 25%; width: 60px; font-size: 35px; animation-delay: 1s; animation-duration: 8s; }
.floating-hearts span:nth-child(23) { left: 55%; width: 20px; font-size: 20px; animation-delay: 3s; animation-duration: 12s; }
.floating-hearts span:nth-child(24) { left: 85%; width: 70px; font-size: 50px; animation-delay: 5s; animation-duration: 7s; }
.floating-hearts span:nth-child(25) { left: 95%; width: 30px; font-size: 30px; animation-delay: 2s; animation-duration: 11s; }

/* ZMĚNA 3: Nová animace pro pád ROVNĚ dolů (bez točení) */
@keyframes rainDown {
    0% {
        /* Začátek nahoře, viditelné */
        /* Smazali jsme 'rotate' a 'scale' */
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        /* Konec dole. Padá jen po ose Y (svisle) */
        transform: translateY(1200px);
        opacity: 0;
    }
}

/* --- MOBILNÍ VERZE PRO GALERII --- */
@media (max-width: 600px) {
    .gallery-container {
        width: 100%; /* Na mobilu využijeme celou šířku */
        padding: 10px;
        box-sizing: border-box; /* Aby padding neroztahoval šířku */
    }

    /* Změna mřížky na 2 sloupce */
    .slide {
        grid-template-columns: repeat(2, 1fr); 
        grid-template-rows: repeat(4, 1fr);    
    }

    .slide img {
        height: 120px; /* Menší výška fotek */
    }

    /* --- OPRAVA ŠIPEK PRO MOBIL --- */
    .prev, .next {
        width: 50px;  /* Zvětšeno zpět na 50px (pro prst ideální) */
        height: 50px;
        font-size: 24px; /* Větší šipka */
        padding: 0;
        
        display: flex;
        align-items: center;
        justify-content: center;
        
        /* Průhlednější pozadí, aby přes ně bylo vidět fotky */
        background-color: rgba(214, 51, 132, 0.8); 
        box-shadow: 0 4px 15px rgba(0,0,0,0.3); /* Výraznější stín */
        
        /* Zrušíme posun myší (-25px), který je na PC */
        margin-top: -25px; 
    }
    
    /* Umístění šipek - dáme je mírně "přes" fotky, aby byly vždy na displeji */
    .prev { 
        left: 5px; /* 5px od levého okraje (uvnitř, ne mimo) */
    }
    .next { 
        right: 5px; /* 5px od pravého okraje */
    }
}