/**
 * ScrollSync Gallery Styles
 * Scroll-based image gallery with vertical thumbnail navigation
 */

.scrollsync-gallery-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Main Images Container */
.scrollsync-images {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-right: 180px; /* Space for thumbnails on right */
}

.scrollsync-gallery-container[data-thumbnail-position="left"] .scrollsync-images {
    padding-right: 2rem;
    padding-left: 180px; /* Space for thumbnails on left */
}

.scrollsync-image {
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scrollsync-image.in-view {
    opacity: 1;
    transform: translateY(0);
}

.scrollsync-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.scrollsync-caption {
    margin-top: 1rem;
    padding: 0 1rem;
}

.scrollsync-caption h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.scrollsync-caption p {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Vertical Thumbnail Navigation */
.scrollsync-thumbnails {
    position: fixed !important;
    top: 2rem !important;
    right: 2rem !important;
    z-index: 9999 !important;
    max-height: calc(100vh - 4rem) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.scrollsync-thumbnails[data-position="left"] {
    right: auto !important;
    left: 2rem !important;
}

.scrollsync-thumbnails-track {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    max-height: calc(100vh - 6rem) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.scrollsync-thumbnail {
    width: 80px;
    height: 80px;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.5;
}

.scrollsync-thumbnail:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.scrollsync-thumbnail.active {
    opacity: 1;
    transform: scale(1.1);
}

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

/* Active Indicator */
.scrollsync-indicator {
    position: absolute !important;
    right: -16px !important;
    top: 1rem !important;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.scrollsync-thumbnails[data-position="left"] .scrollsync-indicator {
    right: auto;
    left: -16px;
}

/* Dot style */
.scrollsync-indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Icon style */
.scrollsync-indicator-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.scrollsync-indicator-icon .dashicons {
    display: block;
}

/* Image style */
.scrollsync-indicator-image {
    width: auto;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.scrollsync-indicator-image img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .scrollsync-images {
        padding-right: 2rem;
        padding-left: 2rem;
    }

    .scrollsync-thumbnails {
        right: 1rem;
        transform: scale(0.85);
    }

    .scrollsync-thumbnails[data-position="left"] {
        left: 1rem;
    }

    .scrollsync-thumbnail {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .scrollsync-thumbnails {
        bottom: 2rem !important;
        top: auto !important;
        right: 50% !important;
        transform: translateX(50%) !important;
        width: 100% !important;
        max-width: 500px !important;
    }

    .scrollsync-thumbnails[data-position="left"] {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .scrollsync-thumbnails-track {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 0.75rem !important;
        padding: 0.75rem !important;
    }

    .scrollsync-thumbnail {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0 !important;
    }

    .scrollsync-indicator {
        display: none !important; /* Hide dot on mobile for simplicity */
    }

    .scrollsync-image {
        margin-bottom: 2rem !important;
    }

    /* Hide mobile thumbnails if disabled */
    .hide-mobile-thumbnails .scrollsync-thumbnails {
        display: none !important;
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Scrollbar styling for thumbnail track */
.scrollsync-thumbnails-track::-webkit-scrollbar {
    width: 6px;
}

.scrollsync-thumbnails-track::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    margin: 8px 0;
}

.scrollsync-thumbnails-track::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.scrollsync-thumbnails-track::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Firefox scrollbar styling */
.scrollsync-thumbnails-track {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}
