.viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

.viewer-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

.viewer-main img,
.viewer-main video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.viewer-bottom-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    height: 120px;
    padding: 12px 16px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.viewer-bottom {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    flex: 1;
    min-width: 0;
    height: 100%;
    align-items: center;
    scroll-behavior: smooth;

    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #666 #2a2a2a;
}

.viewer-bottom::-webkit-scrollbar {
    height: 8px;
}

.viewer-bottom::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.viewer-bottom::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.viewer-bottom::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.thumb {
    flex: 0 0 auto;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.thumb:active {
    transform: scale(0.98);
}

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

.scroll-btn {
    width: 44px;
    height: 80px;
    background: #2a2a2a;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-btn:hover {
    background: #3a3a3a;
    transform: scale(1.02);
}

.scroll-btn:active {
    transform: scale(0.98);
    background: #1a1a1a;
}

/* Responsive design */
@media (max-width: 768px) {
    .viewer-bottom-wrapper {
        height: 100px;
        padding: 8px 12px;
        gap: 8px;
    }

    .thumb {
        width: 70px;
        height: 70px;
    }

    .scroll-btn {
        width: 36px;
        height: 70px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .viewer-bottom-wrapper {
        height: 80px;
        padding: 6px 8px;
        gap: 6px;
    }

    .thumb {
        width: 60px;
        height: 60px;
    }

    .scroll-btn {
        width: 32px;
        height: 60px;
        font-size: 14px;
    }
}

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

.viewer-overlay {
    animation: fadeIn 0.2s ease;
}
