/* =========================================================================
   KEYİFBİZDE.COM - INSTAGRAM TARZI KAYAR DURUMLAR (STORIES CAROUSEL & VIEWER)
   ========================================================================= */

/* --- 1. YATAY KAYAR HALKALAR ŞERİDİ (SAĞ LİSTE & ÜST BAR POPOVER) --- */
.kb-story-strip-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.kb-story-track {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 8px;
    width: 100%;
    cursor: grab;
    user-select: none;
}

.kb-story-track:active {
    cursor: grabbing;
    scroll-behavior: auto;
}

.kb-story-track::-webkit-scrollbar {
    display: none;
}

.kb-story-nav-arrow {
    position: absolute;
    top: 44%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.kb-story-nav-arrow:hover {
    background: #6366f1;
    transform: translateY(-50%) scale(1.08);
}

.kb-story-nav-arrow.prev { left: 3px; }
.kb-story-nav-arrow.next { right: 3px; }
.kb-story-nav-arrow.kb-hidden {
    opacity: 0;
    pointer-events: none;
}

@media (hover: none) and (pointer: coarse) {
    .kb-story-nav-arrow { display: none !important; }
}

/* Instagram Halka Stili (İzlenmemiş = Canlı Gökkuşağı, İzlenmiş = Gümüş) */
.kb-ig-bubble {
    flex: 0 0 auto;
    width: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.kb-ig-bubble:hover {
    transform: translateY(-2px);
}

.kb-ig-bubble-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 2.5px;
    background: conic-gradient(from 195deg, #f59e0b, #ef4444, #ec4899, #8b5cf6, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}

.kb-ig-bubble.is-seen .kb-ig-bubble-ring {
    background: linear-gradient(135deg, #94a3b8, #cbd5e1);
    box-shadow: none;
}

.kb-ig-bubble.is-add .kb-ig-bubble-ring {
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

.kb-ig-bubble-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.kb-theme-dark .kb-ig-bubble-inner,
.kb-theme-night .kb-ig-bubble-inner {
    border-color: #1e293b;
}

.kb-ig-bubble-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.kb-ig-bubble-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    font-size: 9.5px;
    font-weight: 900;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.kb-ig-bubble-nick {
    font-size: 10.5px;
    font-weight: 700;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* Sağ Nick Listesi için biraz daha kompakt halka */
#kbNickStoryBar .kb-ig-bubble { width: 50px; }
#kbNickStoryBar .kb-ig-bubble-ring { width: 44px; height: 44px; }
#kbNickStoryBar .kb-ig-bubble-nick { font-size: 10px; max-width: 50px; }

/* --- 2. KOMPAKT & SEVİMLİ KAYAR STORY İZLEYİCİ (SOHBETİ KAPATMAYAN MİNİ KART) --- */
.kb-ig-viewer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100400;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2.5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    touch-action: none;
    user-select: none;
    animation: kbIgFadeIn 0.18s ease-out;
}

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

.kb-ig-viewer-shell {
    position: relative;
    width: 100%;
    max-width: 338px;
    height: min(485px, 78dvh);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .kb-ig-viewer-shell {
        max-width: min(326px, calc(100vw - 28px));
        height: min(465px, 74dvh);
    }
}

.kb-ig-card {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(165deg, #0f172a 0%, #1e1b4b 55%, #0b1020 100%);
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.62), 0 0 0 1.5px rgba(255, 255, 255, 0.16);
    will-change: transform, opacity;
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.kb-ig-card.is-dragging {
    transition: none !important;
}

/* Üst Çoklu İlerleme Çubukları (Instagram Progress Segments) */
.kb-ig-progress-row {
    display: flex;
    gap: 4px;
    padding: 10px 12px 6px;
    z-index: 15;
}

.kb-ig-prog-seg {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
}

.kb-ig-prog-fill {
    height: 100%;
    width: 0%;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}

/* Üst Profil ve Kontroller */
.kb-ig-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px 10px;
    z-index: 15;
    color: #fff;
    transition: opacity 0.2s ease;
}

.kb-ig-card.is-paused .kb-ig-header,
.kb-ig-card.is-paused .kb-ig-bottom {
    opacity: 0.18;
}

.kb-ig-user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.kb-ig-user-meta img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ec4899;
}

.kb-ig-user-txt b {
    display: block;
    font-size: 13.5px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.kb-ig-user-txt span {
    font-size: 11px;
    color: #cbd5e1;
}

.kb-ig-head-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kb-ig-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.58);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.kb-ig-icon-btn:hover {
    background: rgba(99, 102, 241, 0.85);
}

/* Orta Medya Sahnesi */
.kb-ig-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    overflow: hidden;
}

.kb-ig-stage img,
.kb-ig-stage video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    pointer-events: none !important;
}

.kb-ig-caption-pill {
    margin-top: 8px;
    padding: 7px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    max-width: 95%;
    word-break: break-word;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.kb-ig-text-only-card {
    padding: 18px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.44), rgba(236, 72, 153, 0.44));
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 15.5px;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
    max-width: 92%;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

/* Çift Dokunuş Büyük Kalp Patlaması */
.kb-ig-heart-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 84px;
    color: #fb7185;
    filter: drop-shadow(0 10px 24px rgba(225, 29, 72, 0.65));
    pointer-events: none;
    z-index: 30;
    animation: kbIgHeartPop 0.75s cubic-bezier(0.17, 0.89, 0.32, 1.35) forwards;
}

@keyframes kbIgHeartPop {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
    35% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; }
    70% { transform: translate(-50%, -50%) scale(0.96); opacity: 1; }
    100% { transform: translate(-50%, -62%) scale(1.08); opacity: 0; }
}

/* Alt Etkileşim ve Yorum Bölümü */
.kb-ig-bottom {
    z-index: 16;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.8));
    padding: 7px 11px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: opacity 0.2s ease;
}

.kb-ig-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 5px;
}

.kb-ig-pill-btn {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.78);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kb-ig-pill-btn.liked {
    background: #e11d48;
    border-color: #fb7185;
    color: #fff;
}

.kb-ig-comments-list {
    max-height: 60px;
    overflow-y: auto;
    margin-bottom: 6px;
    padding-right: 4px;
    font-size: 11.5px;
    color: #e2e8f0;
}

/* Masaüstü Sağ/Sol Dış Geçiş Okları */
.kb-ig-side-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.84);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
}

.kb-ig-side-arrow:hover {
    background: #6366f1;
    transform: translateY(-50%) scale(1.08);
}

.kb-ig-side-arrow.prev { left: -46px; }
.kb-ig-side-arrow.next { right: -46px; }

@media (max-width: 460px) {
    .kb-ig-side-arrow { display: none !important; }
}

/* --- 3. EKRAN GÖRÜNTÜSÜ, UZUN BASIP KAYDETME VE EKRAN ALINTISI KORUMA KALKANI --- */
.kb-ig-drm-glass {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    -webkit-touch-callout: none !important;
    user-select: none !important;
}

.kb-ig-drm-wm {
    transform: rotate(-24deg);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.12);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    white-space: nowrap;
}

.kb-ig-ss-curtain {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: #020617;
    color: #f8fafc;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px;
    text-align: center;
}

.kb-ig-card.kb-ss-shielded .kb-ig-ss-curtain {
    display: flex !important;
}

.kb-ig-card.kb-ss-shielded .kb-ig-stage img,
.kb-ig-card.kb-ss-shielded .kb-ig-stage video,
.kb-ig-card.kb-ss-shielded .kb-ig-embed-wrap,
.kb-ig-card.kb-ss-shielded .kb-ig-text-only-card,
.kb-ig-card.kb-ss-shielded .kb-ig-caption-pill {
    visibility: hidden !important;
    filter: blur(28px) brightness(0) !important;
}

/* YouTube / TikTok Harici Video Embed Sahnesi ve Link Sekmeleri */
.kb-ig-embed-wrap {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 200px;
    max-height: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #020617;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
    z-index: 13;
}
.kb-ig-embed-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #020617;
}
.kb-st-src-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    border-radius: 11px;
    background: #e2e8f0;
}
.kb-st-src-tab {
    padding: 7px 8px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.kb-st-src-tab.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

@media print {
    #kbStoryViewModal, .kb-ig-viewer-backdrop {
        display: none !important;
        visibility: hidden !important;
    }
}

