/* Bottom Sheet Modal Styles */

.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
}

.bottom-sheet-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 92vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    animation: slideUpSheet 0.3s ease-out forwards;
    z-index: 51;
    touch-action: none;
}

.bottom-sheet-modal.closing {
    animation: slideDownSheet 0.25s ease-in forwards;
}

.bottom-sheet-overlay.closing {
    animation: fadeOut 0.25s ease-in forwards;
}

/* Swipe Handle */
.bottom-sheet-handle {
    width: 100%;
    padding: 12px 0 8px;
    display: flex;
    justify-content: center;
    cursor: grab;
    flex-shrink: 0;
}

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

.bottom-sheet-handle-bar {
    width: 40px;
    height: 5px;
    background: #d1d5db;
    border-radius: 3px;
    transition: background 0.2s;
}

.bottom-sheet-handle:hover .bottom-sheet-handle-bar {
    background: #9ca3af;
}

/* Header */
.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.bottom-sheet-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.bottom-sheet-close {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.2s;
}

.bottom-sheet-close:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Content */
.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Animations */
@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDownSheet {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

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

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

/* Safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-sheet-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* React bottom sheet animation (for Codex.jsx) */
.animate-slide-up-sheet {
    animation: slideUpSheet 0.3s ease-out forwards;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
