/**
 * Unified bottom sheet / dialog overlay component.
 * Use class "app-bottom-sheet" for the container, "app-bottom-sheet-overlay",
 * "app-bottom-sheet-content", and "app-bottom-sheet-handle" for consistent
 * behavior across the site (add money, bank select, confirmation, attachments, etc.).
 */

.app-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.app-bottom-sheet.active {
    opacity: 1;
    visibility: visible;
}

.app-bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: opacity 0.2s ease-out;
    opacity: min(1, max(0, calc(1 - var(--sheet-drag, 0) / 280)));
}

.app-bottom-sheet-content {
    width: 100%;
    height: 65vh;
    min-height: 65vh;
    max-height: 65vh;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: var(--spacing-md);
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    will-change: transform;
}

.app-bottom-sheet.active .app-bottom-sheet-content {
    transform: translateY(0);
}

.app-bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 0 auto var(--spacing-md) auto;
    cursor: grab;
}

.app-bottom-sheet-handle:active {
    cursor: grabbing;
}