/**
 * bex-action-center.css — İşlem Merkezi ve Modalların Tasarım Stilleri
 */
.bex-action-center-overlay {
    position: fixed;
    inset: 0;
    z-index: 100050 !important;
    background: rgba(11, 20, 26, 0.52);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: opacity 0.2s ease;
}

@media (min-width: 640px) {
    .bex-action-center-overlay {
        align-items: center;
        padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    }
}

.bex-action-center-overlay.hidden {
    display: none !important;
}

.bex-rail-action-menu[hidden] {
    display: none !important;
}

.bex-rail-action-menu {
    position: fixed;
    z-index: 100090;
    width: min(240px, calc(100vw - 24px));
    padding: 7px;
    border: 1px solid var(--wa-line, rgba(0, 0, 0, 0.1));
    border-radius: 16px;
    background: var(--wa-surface, #fff);
    color: var(--wa-text, var(--color-bg-dark));
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2), 0 4px 14px rgba(0, 0, 0, 0.08);
    animation: bex-rail-menu-in 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .bex-rail-action-menu {
    border-color: var(--wa-line, rgba(255, 255, 255, 0.12));
    background: var(--wa-surface, #1f2c34);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}

.bex-rail-action-menu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 46px;
    padding: 8px 10px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--wa-text, var(--color-bg-dark));
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}

html.dark .bex-rail-action-menu-item {
    color: var(--wa-text, #e9edef);
}

.bex-rail-action-menu-item:hover,
.bex-rail-action-menu-item:focus-visible {
    background: var(--wa-search, #f0f2f5);
    color: var(--wa-primary, var(--color-primary));
    outline: none;
}

html.dark .bex-rail-action-menu-item:hover,
html.dark .bex-rail-action-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.bex-rail-action-menu-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 11px;
    background: var(--wa-search, #f0f2f5);
    color: var(--wa-primary, var(--color-primary));
}

.bex-rail-action-menu-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bex-rail-action-menu-icon--story {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
}

.bex-rail-action-menu-icon--post {
    background: rgba(0, 168, 132, 0.12);
    color: var(--wa-primary, var(--color-primary));
}

@keyframes bex-rail-menu-in {
    from { opacity: 0; transform: translateX(-5px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .bex-rail-action-menu { animation: none; }
}

.bex-action-center-container {
    width: 100%;
    max-width: min(540px, calc(100vw - 32px));
    background: var(--wa-surface, #fff);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding: 12px max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left));
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    animation: bex-sheet-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: min(85vh, calc(100dvh - 32px));
    overflow-y: auto;
    position: relative;
    z-index: 100051 !important;
}

@media (min-width: 640px) {
    .bex-action-center-container {
        border-radius: 28px;
        padding: 24px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
        animation: bex-modal-zoom-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

.bex-action-center-handle {
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--wa-line, #d1d7db);
    margin: 4px auto 16px;
}

@media (min-width: 640px) {
    .bex-action-center-handle {
        display: none;
    }
}

.bex-action-center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wa-line, #e9edef);
}

.bex-action-center-close {
    background: none;
    border: none;
    color: var(--wa-muted, #667781);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.bex-action-center-close:hover {
    background: var(--wa-hover, rgba(0, 0, 0, 0.05));
    color: var(--wa-text, var(--color-bg-dark));
}

.bex-action-center-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bex-action-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--wa-search, #f0f2f5);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.bex-action-item:hover {
    background: var(--wa-hover, #e9edef);
    border-color: var(--wa-line, #d1d7db);
    transform: translateY(-1px);
}

.bex-action-item:active {
    transform: scale(0.98);
}

.bex-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.bex-icon-chat   { background: #e8f5e9; color: #2e7d32; }
.bex-icon-group  { background: #e3f2fd; color: #1565c0; }
.bex-icon-post   { background: #f3e5f5; color: #7b1fa2; }
.bex-icon-story  { background: #fff3e0; color: #ef6c00; }
.bex-icon-room   { background: #fce4ec; color: #c2185b; }
.bex-icon-invite { background: #e0f7fa; color: #00838f; }

.bex-action-text {
    flex: 1 1 0;
    min-width: 0;
}

.bex-action-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--wa-text, var(--color-bg-dark));
}

.bex-action-desc {
    display: block;
    font-size: 11px;
    color: var(--wa-muted, #667781);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bex-action-arrow {
    color: var(--wa-muted, #94a3b8);
    font-size: 16px;
    transition: transform 0.15s ease;
}

.bex-action-item:hover .bex-action-arrow {
    transform: translateX(3px);
    color: var(--wa-green-deep, #25d366);
}

/* Dialog Surfaces */
.bex-action-dialog-surface {
    width: 100%;
    max-width: min(480px, calc(100vw - 32px));
    max-height: min(85vh, calc(100dvh - 32px));
    background: var(--wa-surface, #fff);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    animation: bex-sheet-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 200;
}

@media (min-width: 640px) {
    .bex-action-dialog-surface {
        border-radius: 24px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
        animation: bex-modal-zoom-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

.bex-action-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--wa-line, #e9edef);
}

@keyframes bex-sheet-slide-up {
    from { transform: translateY(100%); opacity: 0.5; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bex-modal-zoom-in {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ── Dark Mode Uyumluluğu ── */
html.dark .bex-action-center-container {
    background: var(--wa-surface, var(--color-bg-dark));
    border-top: 1px solid var(--wa-line, rgba(255, 255, 255, 0.1));
    box-shadow: 0 -8px 36px rgba(0, 0, 0, 0.45);
}
@media (min-width: 640px) {
    html.dark .bex-action-center-container {
        border: 1px solid var(--wa-line, rgba(255, 255, 255, 0.1));
    }
}
html.dark .bex-action-center-handle {
    background: rgba(255, 255, 255, 0.2);
}
html.dark .bex-action-center-header {
    border-bottom-color: var(--wa-line, rgba(255, 255, 255, 0.08));
}
html.dark .bex-action-center-close {
    color: var(--wa-muted, #8696a0);
}
html.dark .bex-action-center-close:hover {
    background: var(--wa-hover, rgba(255, 255, 255, 0.08));
    color: var(--wa-text, var(--color-bg-light));
}
html.dark .bex-action-item {
    background: var(--wa-search, #202c33);
    border-color: var(--wa-line, rgba(255, 255, 255, 0.04));
}
html.dark .bex-action-item:hover {
    background: var(--wa-hover, #2a3942);
    border-color: var(--wa-line, rgba(255, 255, 255, 0.12));
}
html.dark .bex-action-name {
    color: var(--wa-text, var(--color-bg-light));
}
html.dark .bex-action-desc {
    color: var(--wa-muted, #8696a0);
}
html.dark .bex-action-arrow {
    color: var(--wa-muted, #64748b);
}
html.dark .bex-action-dialog-surface {
    background: var(--wa-surface, var(--color-bg-dark));
    border: 1px solid var(--wa-line, rgba(255, 255, 255, 0.1));
}
html.dark .bex-action-dialog-header {
    border-bottom-color: var(--wa-line, rgba(255, 255, 255, 0.08));
}


/* ========================================================
   GLOBAL HEADER (+) PAYLAÅIM MERKEZİ POPOVER (MASAÜSTÜ)
   ======================================================== */
.bex-header-share-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100060;
    min-width: 230px;
    padding: 6px;
    border-radius: 18px;
    background: var(--wa-surface, var(--color-bg-light));
    border: 1px solid var(--wa-line, rgba(0, 0, 0, 0.1));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: bex-popover-in 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

@media (max-width: 639px) {
    .bex-header-share-popover {
        display: none !important;
    }
}

.bex-header-share-popover.hidden {
    display: none !important;
}

@keyframes bex-popover-in {
    from { opacity: 0; transform: scale(0.94) translateY(-6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

html.dark .bex-header-share-popover {
    background: var(--wa-surface, #1f2c34);
    border-color: var(--wa-line, rgba(255, 255, 255, 0.12));
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

.bex-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 7px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--wa-text, var(--color-bg-dark));
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    touch-action: manipulation;
}

html.dark .bex-popover-item {
    color: var(--wa-text, #e9edef);
}

.bex-popover-item:hover,
.bex-popover-item:focus-visible {
    background: var(--wa-search, #f0f2f5);
    color: var(--wa-primary, var(--color-primary));
    outline: none;
}

html.dark .bex-popover-item:hover,
html.dark .bex-popover-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.bex-popover-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    background: var(--wa-search, #f0f2f5);
    color: var(--wa-primary, var(--color-primary));
    transition: transform 0.15s ease;
}

.bex-popover-item:hover .bex-popover-icon {
    transform: scale(1.08);
}

html.dark .bex-popover-icon {
    background: rgba(255, 255, 255, 0.06);
}

.bex-popover-divider {
    height: 1px;
    margin: 5px 6px;
    background: var(--wa-line, rgba(0, 0, 0, 0.08));
}

html.dark .bex-popover-divider {
    background: var(--wa-line, rgba(255, 255, 255, 0.08));
}

.bex-popover-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
