/* General body and background styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(270deg, #4a5568, #2d3748, #2c3e50, #1c2833); /* Muted tones */
    background-size: 600% 600%;
    animation: gradientTexture 20s ease infinite;
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    height: 100vh; /* Full viewport height */
    position: relative; /* Ensures that pseudo-elements are positioned correctly */
    overflow: hidden; /* Prevents overflow of animated background */
}

/* Keyframes for a subtle gradient animation */
@keyframes gradientTexture {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Adding moving wave-like texture overlay using pseudo-element */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.05), rgba(0,0,0,0.1)); /* Light texture effect */
    opacity: 0.5;
    z-index: 1;
    background-size: 200% 200%;
    animation: waveAnimation 15s linear infinite;
}

/* Keyframes for wave-like texture movement */
@keyframes waveAnimation {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(30px) translateY(20px);
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

/* Container styling */
.container {
    max-width: 800px; /* Reduced width for smaller display */
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9); /* Slightly transparent to show background */
    border: 2px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    position: relative;
    z-index: 2; /* Ensures content is above the background */
}

/* Box styling */
.box {
    padding: 20px;
}

/* Header styling */
.header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2em; /* Reduced font size */
    color: #333;
}

/* Gallery styling */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Smaller gallery items */
    gap: 15px; /* Reduced gap between items */
}

.gallery-item {
    background-color: #49515e;
    border: 2px solid #ccc;
    padding: 5px; /* Reduced padding */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer; /* Indicates that the item is clickable */
}

.gallery-item:hover {
    transform: scale(1.05); /* Slightly enlarges image on hover */
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Ensure images fit within their containers */
}

/* Footer styling */
.footer {
    text-align: center;
    margin-top: 20px; /* Reduced margin top */
}

.footer p {
    color: #555;
    font-size: 0.9em;
}

/* Modal styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.8); /* Black background with opacity */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
    margin-top: 5%; /* Center vertically */
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Navigation buttons */
.prev, .next {
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: #fff;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
}

.next {
    right: 0;
}

.prev {
    left: 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
