body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

h1 {
    text-align: center;
    margin: 20px 0;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.gallery-item {
    margin: 15px;
    text-align: center;
    width: 250px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Ana resim */
.gallery-item .main-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item .main-image:hover {
    transform: scale(1.05);
}

/* Gizli resimler */
.additional-images {
    display: flex;
    margin-top: 10px;
}

.additional-images img {
    margin-right: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.additional-images img:hover {
    transform: scale(1.1);
}
/* Modal */
.modal {
    display: none;
    
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal İçerik */
.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;  /* Genişlik %90 */
    max-height: 90%; /* Yükseklik %90 */
    object-fit: contain;
    border-radius: 10px;  /* Köşeleri yuvarlat */
    position: absolute;   /* İçerik pozisyonunu ayarlıyoruz */
    top: 50%;             /* Yüksekliğin ortasına yerleştir */
    left: 50%;            /* Genişliğin ortasına yerleştir */
    transform: translate(-50%, -50%); /* Tam ortada olması için kaydırma yap */
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    user-select: none;
}

.prev {
    left: 0;
}

.next {
    right: 0;
}

.prev:hover, .next:hover {
    color: #bbb;
}

/* Caption */
#caption {
    color: white;
    text-align: center;
    padding: 10px 20px;
}

/* Mobil Uyumlu Tasarım */
@media (max-width: 768px) {
    .modal-content {
        max-width: 85%;  /* Mobilde genişliği biraz daha daralt */
        max-height: 85%; /* Mobilde yüksekliği biraz daha daralt */
    }

    .prev, .next {
        font-size: 18px;
        padding: 10px;
    }

    .close {
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    /* Daha küçük ekranlar için */
    .modal-content {
        max-width: 80%;  /* Küçük ekranlarda genişliği daha da küçült */
        max-height: 80%; /* Yüksekliği %80 ile sınırla */
    }

    .prev, .next {
        font-size: 16px;  /* İleri/geri oklarını daha da küçült */
        padding: 8px;
    }

    .close {
        font-size: 25px;
    }
}
