/* STILOVI ZA GALERIJU (1b-gallery.css) */

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa; /* Malo svjetlija, modernija siva */
    padding: 20px;
    margin: 0;
    color: #333;
}

.nav-top {
    margin-bottom: 30px;
    text-align: left;
}

.back-link {
    text-decoration: none;
    color: #444;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 25px; /* Zaobljeniji, moderniji izgled */
    background-color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.back-link:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Prikaz grid thumbnailova */
.gallery {
    display: grid;
    /* Povećao sam minmax na 200px da slike budu preglednije na većim ekranima */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery img {
    width: 100%;
    height: 200px; /* Malo veći thumbnailovi */
    object-fit: cover;
    border-radius: 12px; /* Jače zaobljeni uglovi za "soft" izgled */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    filter: grayscale(10%); /* Blagi retro efekt koji nestaje na hover */
}

.gallery img:hover {
    transform: translateY(-5px) scale(1.03); /* Slika se blago podigne */
    filter: grayscale(0%);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

/* ================================== */
/* MODALNI PROZOR (FULLSCREEN) STILOVI */
/* ================================== */

#gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Skoro potpuno crna za bolji kontrast slike */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Blago zamućivanje pozadine */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

.modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#modal-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    /* Animacija pojave slike */
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* STILOVI ZA STRELICE */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 30px 15px;
    color: rgba(255,255,255,0.7);
    font-size: 50px;
    transition: all 0.3s;
    background: none;
    border: none;
    outline: none;
    z-index: 10002;
}

.nav-arrow:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.prev { left: 10px; }
.next { right: 10px; }

/* PRILAGOĐAVANJE ZA MOBITELE */
@media (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr); /* Dvije slike u redu na mobitelu */
        gap: 10px;
    }
    .gallery img {
        height: 140px;
    }
    .nav-arrow {
        font-size: 40px;
        padding: 15px 5px;
    }
    #modal-img {
        max-width: 98%;
    }
}