/* =====================================================================
   BEXGRAM â€” WhatsApp Tarzı Tam Ekran Medya Görüntüleyicisi (Lightbox)
   Zoom / Pan, Medya Galerisi, İndirme, Paylaşma ve Åikayet Entegrasyonu
   ===================================================================== */

.bex-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100060 !important;
    background: rgba(11, 20, 26, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    color: var(--color-bg-light);
    user-select: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.bex-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* â”€â”€ Üst Bar (Header) â”€â”€ */
.bex-lightbox-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(12px, env(safe-area-inset-top, 12px)) max(16px, env(safe-area-inset-right, 16px)) 10px max(16px, env(safe-area-inset-left, 16px));
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
    flex-shrink: 0;
    z-index: 20;
    gap: 12px;
}

.bex-lightbox-sender {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.bex-lightbox-sender img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.bex-lightbox-sender-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bex-lightbox-sender-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-bg-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bex-lightbox-sender-date {
    font-size: 11.5px;
    color: var(--wa-muted, #94a3b8);
}

.bex-lightbox-counter {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    color: var(--color-bg-light);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* â”€â”€ Belirgin Sağ Üst X Kapatma Butonu â”€â”€ */
.bex-lightbox-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    color: var(--color-bg-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: all 0.18s ease;
    flex-shrink: 0;
    touch-action: manipulation;
}

.bex-lightbox-close:hover {
    background: rgba(239, 68, 68, 0.88);
    transform: scale(1.05);
}

.bex-lightbox-close:active {
    transform: scale(0.92);
}

.bex-lightbox-close svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* â”€â”€ Orta Görsel / Video Sahnesi â”€â”€ */
.bex-lightbox-stage {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    padding: 6px;
}

.bex-lightbox-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform-origin: center center;
    transition: transform 0.15s ease-out;
}

.bex-lightbox-img {
    max-width: min(100%, calc(100vw - 32px));
    max-height: min(100%, calc(100dvh - 96px));
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
    transition: transform 0.12s ease-out;
}

.bex-lightbox-video {
    max-width: min(100%, calc(100vw - 32px));
    max-height: min(100%, calc(100dvh - 96px));
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    background: var(--color-text);
}

/* Yükleniyor Göstergesi */
.bex-lightbox-loader {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--wa-green-deep);
    border-radius: 50%;
    animation: bex-lb-spin 0.8s linear infinite;
    pointer-events: none;
}
@keyframes bex-lb-spin {
    to { transform: rotate(360deg); }
}

/* â”€â”€ Sağ / Sol Navigasyon Butonları â”€â”€ */
.bex-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    color: var(--color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    z-index: 10;
}
.bex-lightbox-nav:hover {
    background: rgba(0, 168, 132, 0.85);
    transform: translateY(-50%) scale(1.08);
}
.bex-lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}
.bex-lightbox-nav.prev {
    left: 14px;
}
.bex-lightbox-nav.next {
    right: 14px;
}
.bex-lightbox-nav svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
@media (max-width: 640px) {
    .bex-lightbox-nav {
        display: none; /* Mobilde swipe hareketi öncelikli */
    }
}

/* â”€â”€ Alt Bar (Toolbar) â”€â”€ */
.bex-lightbox-bottombar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px max(16px, env(safe-area-inset-right, 16px)) max(14px, env(safe-area-inset-bottom, 14px)) max(16px, env(safe-area-inset-left, 16px));
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    flex-shrink: 0;
    z-index: 20;
    gap: 8px;
}

.bex-lightbox-action-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
    gap: 4px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.15s ease;
    user-select: none;
}
.bex-lightbox-action-btn:hover {
    color: var(--color-bg-light);
    background: rgba(255, 255, 255, 0.12);
}
.bex-lightbox-action-btn:active {
    transform: scale(0.92);
}
.bex-lightbox-action-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.bex-lightbox-action-btn.btn-report:hover {
    color: #f87171;
}

/* â”€â”€ Bilgi Modal / Sayfası (Media Info Drawer) â”€â”€ */
.bex-lightbox-info-sheet {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    width: 100%;
    max-width: min(540px, calc(100vw - 32px));
    max-height: min(70vh, calc(100dvh - 32px));
    overflow-y: auto;
    background: var(--wa-surface, var(--color-bg-dark));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    padding: 16px max(20px, env(safe-area-inset-right, 20px)) max(20px, env(safe-area-inset-bottom, 20px)) max(20px, env(safe-area-inset-left, 20px));
    color: var(--color-bg-light);
    z-index: 30;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.bex-lightbox-info-sheet.is-open {
    transform: translate(-50%, 0);
}
.bex-lightbox-info-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bex-lightbox-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}
.bex-lightbox-info-label {
    color: var(--wa-muted, var(--wa-muted));
}
.bex-lightbox-info-val {
    font-weight: 600;
    color: var(--wa-text, var(--wa-line));
}

/* â”€â”€ WhatsApp Tarzı Medya Mesaj Balonları â”€â”€ */
.bw-img-link, .bw-img-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    display: block;
    width: 100%;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    line-height: 0;
    text-align: left;
}
.bw-img-link img, .bw-img-btn img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    transition: transform 0.2s ease;
}
.bw-img-link:hover img, .bw-img-btn:hover img {
    transform: scale(1.015);
}

.bw-video-btn {
    position: relative;
    display: block;
    width: 100%;
    border: none;
    background: var(--color-text);
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
}
.bw-video-btn video {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    pointer-events: none;
}
.bw-video-play-overlay {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
}
.bw-video-btn:hover .bw-video-play-overlay {
    background: rgba(0, 168, 132, 0.9);
    transform: scale(1.08);
}
.bw-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: var(--color-bg-light);
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    line-height: 1.2;
}


/* â”€â”€ Bexgram Belge ve PDF Tam Ekran Önizleme â”€â”€ */
.bex-lightbox-pdf {
    width: min(92vw, 920px);
    height: min(80vh, 760px);
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
    background: var(--color-bg-light);
}

.bex-lightbox-doc-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    background: rgba(30, 42, 50, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    max-width: min(90vw, 420px);
    width: 100%;
    gap: 16px;
    backdrop-filter: blur(12px);
}

.bex-lb-doc-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(0, 168, 132, 0.15);
    border: 2px solid var(--wa-green-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wa-green-deep);
}

.bex-lb-doc-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-bg-light);
    word-break: break-word;
    max-width: 100%;
}

.bex-lb-doc-sub {
    font-size: 13px;
    color: #94a3b8;
}

.bex-lb-doc-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.bex-lb-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bex-lb-doc-btn.primary {
    background: var(--wa-green-deep);
    color: var(--color-bg-light);
    border: none;
}
.bex-lb-doc-btn.primary:hover {
    background: #008f70;
}

.bex-lb-doc-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-bg-light);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.bex-lb-doc-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

