body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2em;
}

.error {
    text-align: center;
    padding: 40px;
    color: #cc0000;
    font-size: 1.1em;
    background-color: #ffe6e6;
    border: 1px solid #cc0000;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 600px;
}

.no-images {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1em;
    background-color: #f9f9f9;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 600px;
    line-height: 1.6;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

#modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ccc;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 48px;
    font-weight: bold;
    padding: 20px 25px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s ease;
    z-index: 1001;
    user-select: none;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.4);
}

.prev-arrow {
    left: 30px;
}

.next-arrow {
    right: 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-arrow {
        font-size: 36px;
        padding: 15px 20px;
    }
    
    .prev-arrow {
        left: 15px;
    }
    
    .next-arrow {
        right: 15px;
    }
    
    .close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
    
    #modal-image {
        max-width: 95%;
        max-height: 85%;
    }
}