/* Instagram Viewer Styles */
.ig-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 999999;
    display: none;
    flex-direction: column;
}

.ig-viewer-modal.active {
    display: flex;
}

.ig-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000000;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    transition: background 0.2s;
}

.ig-viewer-close:hover {
    background: rgba(0,0,0,0.8);
}

.ig-viewer-track {
    flex: 1;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE and Edge */
}
.ig-viewer-track::-webkit-scrollbar {
    display: none;
}

.ig-viewer-track.horizontal {
    flex-direction: row;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

.ig-viewer-item {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    flex: 0 0 100dvh;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.ig-viewer-track.horizontal .ig-viewer-item {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

.ig-viewer-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ig-viewer-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 20px 40px 20px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.ig-viewer-username {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.ig-viewer-username img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
}

.ig-viewer-caption {
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.ig-viewer-stats {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    margin-top: 4px;
}

.ig-viewer-mute-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 10;
}

.ig-viewer-mute-btn.show {
    opacity: 1;
}

.ig-viewer-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255,255,255,0.3);
    width: 100%;
}
.ig-viewer-progress-bar {
    height: 100%;
    background: #fff;
    width: 0%;
}

.ig-carousel-track {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
}

.ig-carousel-track::-webkit-scrollbar {
    display: none;
}

.ig-carousel-track > * {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    scroll-snap-align: start;
}