* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212; 
    color: #e0e0e0;
    margin: 0;
    padding: 0;
}

header {
    background: linear-gradient(90deg, #ff6b6b, #f7d94c);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

nav h1 {
    margin: 0;
    font-size: 2.5em;
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 20px; /* Space between nav items */
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2); /* Subtle hover effect */
    color: #ff6f20; /* Change text color on hover */
}

.hero {
    padding: 60px 20px;
    text-align: center;
}

.hero h2 {
    font-size: 3em;
    margin: 0;
    color: #ff6f20; /* Highlighted color */
}

.hero p {
    font-size: 1.5em;
    margin-top: 10px;
}

main {
    padding: 20px;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px; /* Increased gap for modern spacing */
}

.collection-stack {
    margin: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px; /* More rounded corners */
    padding: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    max-width: 320px; /* Slightly larger max width */
    cursor: pointer;
}

.collection-stack:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
}

.collection-stack h2 {
    font-size: 1.5em;
    margin: 20px 0 0; /* Add top margin to position text 20px from the top */
}

.collection-stack .main-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 5px;
    align-self: center;
}

.hidden-image {
    max-width: 80%;
    height: auto;
    margin-top: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.hidden-image:hover {
    opacity: 1;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 1000;
    overflow-y: auto;
}

.close-button {
    position: fixed;
    top: 40px;
    right: 40px;
    background: transparent;
    color: white;
    border: none;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

.close-button:hover {
    color: #ff6b6b;
}

.modal-content {
    max-height: 80%;
    overflow-y: auto;
    width: 90%;
    margin-top: 20px;
}

.image-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
}

.image-wrapper {
    cursor: pointer;
    margin: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    transition: transform 0.3s, box-shadow 0.3s; /* Added box-shadow transition */
    overflow: hidden;
    opacity: 0;
    transform: rotateY(90deg);
    animation: flipIn 0.5s ease forwards;
}

.image-wrapper.show {
    transform: rotateY(0deg);
}

.image-wrapper img {
    cursor: pointer;
}

.image-description {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    transition: opacity 0.3s ease;
}

.image-wrapper:hover .image-description {
    opacity: 0;
}

.modal-image {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.fanned-out {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fanned-out img {
    width: 200px;
    margin: 10px;
    transform: translateY(100px);
    transition: transform 0.5s ease;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.fanned-out.show {
    opacity: 1;
}

.fanned-out img.move {
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    position: relative;
    bottom: 0;
    width: 100%;
    margin: 0;
}

.collection-title {
    color: #f0f0f0;
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.hidden-title {
    display: none;
}

@keyframes flipIn {
    0% {
        transform: rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

.main-header {
    text-align: center;
    margin: 20px 0;
}

.main-header h1 {
    font-size: 3em;
    letter-spacing: 2px;
}

.frozen {
    color: #00f;
    text-shadow: 0 0 5px rgba(0, 0, 255, 0.5), 0 0 10px rgba(0, 0, 255, 0.5);
    animation: freeze 1.5s infinite alternate;
    display: inline-block;
}

.frozen:hover {
    animation: shiver 0.2s infinite;
}

@keyframes freeze {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

@keyframes shiver {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    50% {
        transform: translateX(2px);
    }
    75% {
        transform: translateX(-2px);
    }
    100% {
        transform: translateX(0);
    }
}

.pulsing {
    position: relative;
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.5), rgba(255, 0, 0, 1), rgba(255, 0, 0, 0.5));
    background-size: 200% 100%;
    animation: pulseColor 1.5s infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

@keyframes pulseColor {
    0% {
        background-position: 100% 0;
    }
    50% {
        background-position: 0 0;
    }
    100% {
        background-position: 100% 0;
    }
}

.pulsing::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: calc(50% + var(--random-left, 0px)); /* Use the random left  */
    transform: translateX(-50%);
    width: 5px;
    height: 10px;
    background: red;
    border-radius: 50%;
    opacity: 0;
    animation: bleed 5s infinite;
}

@keyframes bleed {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    10% {
        opacity: 1;
    }
    20% {
        transform: translateY(60px); 
    }
    30% {
        opacity: 0;
    }
    100% {
        transform: translateY(0); /* Reset */
    }
}

.memories {
    display: inline-block;
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 2px rgba(255, 255, 255, 0.15), 0 0 5px rgba(255, 255, 255, 0.15);
    }
    100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.3), 0 0 10px rgba(255, 255, 255, 0.3);
    }
}

.footer {
    text-align: center;
    margin: 20px 0;
    color: #f0f0f0;
}

.shivering {
    color: #00f;
    text-shadow: 0 0 5px rgba(0, 0, 255, 0.5), 0 0 10px rgba(0, 0, 255, 0.5);
    display: inline-block;
    transition: transform 0.2s;
}

.shivering:hover {
    animation: shiver 0.2s infinite;
}

.large-modal-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    margin: auto;
}

.large-image-description {
    color: white;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin-bottom: 10px;
}

.nav-button {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: none;
    font-size: 2em;
    cursor: pointer;
    z-index: 1002;
}

.nav-button-left {
    left: 10px;
}

.nav-button-right {
    right: 10px;
}