.gallery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: clamp(20px, 4vh, 40px) 10px;
    text-align: center;
}

.gallery-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 360px;
    opacity: 1;
}

.gallery-form.active {
    animation: slideFadeIn .35s cubic-bezier(.25, 1, .5, 1) forwards;
}

.gallery-form.exit {
    animation: slideFadeOut .3s cubic-bezier(.4, 0, 1, 1) forwards;
}

.gallery-input {
    width: 100%;
    background: rgba(20, 20, 20, .6);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 1.05rem;
    color: #fff;
    outline: none;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background .3s, border-color .3s, box-shadow .3s;
}

.gallery-input:focus {
    background: rgba(30, 30, 30, .8);
    border-color: rgba(255, 255, 255, .35);
    box-shadow: 0 0 16px rgba(255, 255, 255, .08);
}

.gallery-input::placeholder {
    color: rgba(255, 255, 255, .35);
}

.gallery-btn {
    width: 100%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    border-radius: 16px;
    padding: 14px 0;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    transition: background .3s, border-color .3s, transform .2s, box-shadow .3s;
}

.gallery-btn:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .4);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
    transform: translateY(-1px);
}

.gallery-btn:active {
    transform: scale(.97);
}

.gallery-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.gallery-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;

    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    );

    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 5%,
        black 95%,
        transparent 100%
    );
}

.gallery-footer {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    justify-content: center;
}

.gallery-wrapper.active {
    animation: listSlideDown .4s cubic-bezier(.25, 1, .5, 1) forwards;
}

.date-tile {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.date-header.shimmer-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, .85);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding-bottom: 8px;
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

.date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    width: 100%;
    justify-items: center;
    align-items: start;
    margin-bottom: 25px;
}

.gallery-item {
    width: 100%;
    max-width: 140px;
    height: 130px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    transition: transform .2s, border-color .3s;
}

.gallery-item:hover {
    border-color: rgba(255, 255, 255, .4);
    transform: scale(1.03);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item img {
    cursor: zoom-in;
    transition: transform .5s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.date-grid div[class*="media-mp3"],
.date-grid div[class*="media-wav"],
.date-grid div[class*="media-ogg"] {
    grid-column: 1 / -1;
    max-width: 100%;
    width: 100%;
    height: auto;
}

.audio-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.audio-icon {
    font-size: 1.8rem;
}

.audio-label {
    font-size: .9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .8);
    word-break: break-all;
}

.audio-card audio {
    width: 100%;
}

#gallery-footer-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 16px;
}

.gallery-footer.active {
    animation: slideFadeIn .35s cubic-bezier(.25, 1, .5, 1) forwards;
}

.gallery-back-btn {
    max-width: 360px;
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .gallery-container {
        padding: 15px 0;
    }

    .gallery-input,
    .gallery-btn {
        padding: 12px 16px;
        font-size: .95rem;
        border-radius: 12px;
    }

    .date-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .gallery-item {
        max-width: 110px;
        height: 100px;
    }

    .date-header.shimmer-text {
        font-size: .95rem;
        letter-spacing: 1px;
    }
}

#lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 9999;
}

#lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}