/* General Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body.modal-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

header {
    text-align: center;
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
}

h1 {
    margin: 0;
}

/* Carousel Section */
.carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-height: 600px;
    background-color: #000;
}

.carousel {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    min-width: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.carousel-item.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* Grid Section */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 20px;
}

.grid-item {
    width: 100%;
    aspect-ratio: 1; /* Ensures square images */
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
}

.grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.grid-item:hover img {
    transform: scale(1.1);
}

/* Image Modal Styling */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.image-modal.image-modal-open {
    opacity: 1;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-modal.image-modal-open .image-modal-content {
    transform: scale(1);
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    line-height: 1;
}

.image-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}
