/* =====================================================================
   BEXGRAM HEDİYE GÖNDER POPUP MODALI (KEŞFET & REELS UYUMLU)
   ===================================================================== */

.bex-gift-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .bex-gift-modal-backdrop {
        align-items: center;
        padding: 20px;
    }
}

.bex-gift-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.bex-gift-modal-card {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: #111b21;
    color: #e9edef;
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .bex-gift-modal-card {
        border-radius: 24px;
        transform: scale(0.92) translateY(20px);
    }
}

.bex-gift-modal-backdrop.is-open .bex-gift-modal-card {
    transform: translateY(0) scale(1);
}

/* Light Mode Overrides */
html:not(.dark) .bex-gift-modal-card,
[data-theme="light"] .bex-gift-modal-card {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Header */
.bex-gift-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

html:not(.dark) .bex-gift-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.bex-gift-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bex-gift-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00a884;
    flex-shrink: 0;
}

.bex-gift-user-meta {
    min-width: 0;
}

.bex-gift-user-name {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bex-gift-balance-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 3px;
}

.bex-gift-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: inherit;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.bex-gift-close-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* Category Filter Bar */
.bex-gift-cats {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.bex-gift-cats::-webkit-scrollbar {
    display: none;
}

.bex-gift-cat-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

html:not(.dark) .bex-gift-cat-btn {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
}

.bex-gift-cat-btn.is-active,
.bex-gift-cat-btn:hover {
    background: #00a884;
    color: #ffffff;
    border-color: #00a884;
}

/* Grid of Gifts */
.bex-gift-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    box-sizing: border-box;
}

@media (max-width: 420px) {
    .bex-gift-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 8px 14px;
    }
}

.bex-gift-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid transparent;
    border-radius: 16px;
    padding: 10px 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    user-select: none;
}

html:not(.dark) .bex-gift-card {
    background: #f8fafc;
}

.bex-gift-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.bex-gift-card.is-selected {
    border-color: #00a884;
    background: rgba(0, 168, 132, 0.12);
    box-shadow: 0 0 16px rgba(0, 168, 132, 0.3);
    transform: scale(1.03);
}

.bex-gift-img-wrap {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.bex-gift-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.bex-gift-title {
    font-size: 11.5px;
    font-weight: 750;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bex-gift-price {
    font-size: 11px;
    font-weight: 800;
    color: #f59e0b;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Footer / Action Bar */
.bex-gift-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
}

html:not(.dark) .bex-gift-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
    background: #f8fafc;
}

.bex-gift-qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bex-gift-qty-pill {
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
}

.bex-gift-qty-pill.is-active {
    background: #00a884;
    border-color: #00a884;
    color: #ffffff;
}

.bex-gift-send-btn {
    flex: 1 1 auto;
    padding: 12px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #00a884 0%, #059669 100%);
    border: none;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 900;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 168, 132, 0.35);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bex-gift-send-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.bex-gift-send-btn:active {
    transform: scale(0.97);
}

/* Floating Celebration Animation */
.bex-gift-flying-anim {
    position: fixed;
    pointer-events: none;
    z-index: 1000000;
    width: 140px;
    height: 140px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
    animation: bexGiftFly 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bexGiftFly {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -60%) scale(1.3);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -80%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -120%) scale(0.5);
        opacity: 0;
    }
}

/* =====================================================================
   VIP LÜKS HEDİYE VİTRİNİ & NADİRLİK DERECELERİ (RARITY SYSTEM)
   ===================================================================== */
.bex-gift-card {
    position: relative;
    overflow: hidden;
}

.bex-gift-rarity-pill {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 8.5px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    pointer-events: none;
    z-index: 2;
}

/* Yaygın */
.bex-rarity-yaygin {
    border-color: rgba(16, 185, 129, 0.25) !important;
}
.bex-gift-rarity-pill.bex-rarity-yaygin {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Nadir */
.bex-rarity-nadir {
    border-color: rgba(59, 130, 246, 0.35) !important;
}
.bex-gift-rarity-pill.bex-rarity-nadir {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}
.bex-gift-card.bex-rarity-nadir.is-selected {
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.45);
}

/* Efsanevi */
.bex-rarity-efsanevi {
    border-color: rgba(245, 158, 11, 0.45) !important;
}
.bex-gift-rarity-pill.bex-rarity-efsanevi {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
}
.bex-gift-card.bex-rarity-efsanevi.is-selected {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.55);
}

/* Bexgram Özel VIP */
.bex-rarity-vip {
    border-color: rgba(168, 85, 247, 0.55) !important;
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%) !important;
}
.bex-gift-rarity-pill.bex-rarity-vip {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(236, 72, 153, 0.4));
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.5);
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
}
.bex-gift-card.bex-rarity-vip.is-selected {
    border-color: #ec4899 !important;
    box-shadow: 0 0 24px rgba(236, 72, 153, 0.6);
}
