/**
 * Flyup System - Unified Styles
 * 
 * Consolidated styles for all flyup/action sheet components
 * Replaces scattered backdrop and flyup styles throughout the codebase
 * 
 * @version 1.0.0
 */

/* ============================================
   SHARED BACKDROP
   ============================================ */

.flyup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 8999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: auto !important;
    touch-action: none;
}

.flyup-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   BASE FLYUP SHEET STYLES
   ============================================ */

.flyup-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto !important;
    z-index: 9000;
}

.flyup-sheet.open {
    transform: translateY(0);
}

/* ============================================
   FLYUP COMPONENTS
   ============================================ */

/* Handle for swipe-to-close */
.action-sheet-handle {
    width: 40px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    margin: 12px auto 8px;
    flex-shrink: 0;
    cursor: grab;
}

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

/* Header */
.action-sheet-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    flex-shrink: 0;
}

.action-sheet-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #c41e3a;
}

/* Close button */
.sheet-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.sheet-close-btn:hover {
    color: #c41e3a;
}

/* Content area */
.action-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Footer */
.action-sheet-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
    display: flex;
    gap: 12px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Removed desktop max-width restriction - flyups are now full width on all devices */

@media (max-width: 576px) {
    .action-sheet-content {
        padding: 16px;
    }
    
    .action-sheet-footer {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================
   SPECIFIC FLYUP OVERRIDES
   ============================================ */

/* Submit Location Flyup */
#addlocation {
    z-index: 9002;
}

/* City Selector Flyup */
#citySelectorSheet {
    z-index: 9003;
}

/* Address List Flyup */
#addressListSheet {
    z-index: 9000;
    max-height: 70vh;
}

/* Filters Flyup */
.filters-sheet {
    z-index: 9001;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states */
.sheet-close-btn:focus {
    outline: 3px solid #2e7d32;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .flyup-backdrop,
    .flyup-sheet {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .flyup-sheet {
        border: 2px solid currentColor;
    }
}