/* ===========================================
   NGQC.Base.UI Mobile Components Stylesheet
   ===========================================

   This file contains styles for:
   - MobileNavigationDrawer
   - MobileDetailPanel
   - MobileBottomSheet
   - MobileActionSheet
*/

/* ===========================================
   MobileNavigationDrawer
   =========================================== */

.mobile-nav-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.mobile-nav-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    padding-left: env(safe-area-inset-left, 0px);
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

.mobile-nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    min-height: 56px;
    flex-shrink: 0;
}

.mobile-nav-drawer-close {
    margin-left: auto;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-nav-drawer-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    flex-shrink: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.mobile-nav-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-section:last-child {
    border-bottom: none;
}

.mobile-nav-section-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    transition: background-color 0.15s ease;
    min-height: 44px;
    gap: 0.75rem;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    background-color: #f8f9fa;
    color: #212529;
    text-decoration: none;
}

.mobile-nav-item:active {
    background-color: #e9ecef;
}

.mobile-nav-item i {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
    color: #6c757d;
}

.mobile-nav-item.active {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.mobile-nav-item.active i {
    color: #0d6efd;
}

.mobile-nav-item.text-warning i {
    color: #ffc107;
}

.mobile-nav-item.text-muted {
    color: #6c757d;
}

/* ===========================================
   MobileDetailPanel
   =========================================== */

.mobile-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-detail-panel.open {
    transform: translateX(0);
}

.mobile-detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    min-height: 56px;
    flex-shrink: 0;
}

.mobile-detail-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.5rem;
}

.mobile-detail-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mobile-detail-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-detail-panel-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background: #ffffff;
    flex-shrink: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.mobile-detail-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-detail-panel.open ~ .mobile-detail-panel-backdrop,
.mobile-detail-panel-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* ===========================================
   MobileBottomSheet
   =========================================== */

.mobile-bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-bottom-sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-radius: 1rem 1rem 0 0;
    z-index: 1050;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-sheet.open {
    transform: translateY(0);
}

.mobile-bottom-sheet.full-height {
    max-height: calc(100vh - 3rem);
    height: calc(100vh - 3rem);
}

.mobile-bottom-sheet-handle {
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-bottom-sheet-handle-bar {
    width: 36px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    margin: 0 auto;
}

.mobile-bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.mobile-bottom-sheet-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-bottom-sheet-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
}

/* ===========================================
   MobileActionSheet
   =========================================== */

.mobile-action-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1060;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.mobile-action-sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-action-sheet {
    position: fixed;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    z-index: 1070;
    transform: translateY(calc(100% + 1rem));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-action-sheet.open {
    transform: translateY(0);
}

.mobile-action-sheet-menu {
    background: #ffffff;
    border-radius: 0.875rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.mobile-action-sheet-header {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-action-sheet-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.mobile-action-sheet-message {
    font-size: 0.75rem;
    color: #868e96;
    line-height: 1.4;
}

.mobile-action-sheet-actions {
    display: flex;
    flex-direction: column;
}

.mobile-action-sheet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    border: none;
    background: transparent;
    font-size: 1.125rem;
    color: #007aff;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-top: 1px solid #f0f0f0;
}

.mobile-action-sheet-btn:first-child {
    border-top: none;
}

.mobile-action-sheet-btn:active {
    background-color: #f0f0f0;
}

.mobile-action-sheet-btn:disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

.mobile-action-sheet-btn.destructive {
    color: #dc3545;
}

.mobile-action-sheet-btn.primary {
    font-weight: 600;
}

.mobile-action-sheet-cancel {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    background: #ffffff;
    border-radius: 0.875rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #007aff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mobile-action-sheet-cancel:active {
    background-color: #f0f0f0;
}

/* ===========================================
   Utility Classes for Mobile Components
   =========================================== */

.mobile-bottom-sheet .list-group-flush .list-group-item {
    padding: 1rem;
    font-size: 1rem;
}

.mobile-bottom-sheet .list-group-flush .list-group-item-action:active {
    background-color: #f0f0f0;
}

.mobile-detail-panel .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.mobile-detail-panel .form-control,
.mobile-detail-panel .form-select {
    font-size: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

@media (min-width: 768px) {
    .mobile-bottom-sheet {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
    }

    .mobile-bottom-sheet.open {
        transform: translateX(-50%) translateY(0);
    }

    .mobile-action-sheet {
        max-width: 400px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(calc(100% + 1rem));
    }

    .mobile-action-sheet.open {
        transform: translateX(-50%) translateY(0);
    }
}

@media (prefers-color-scheme: dark) {
    .mobile-detail-panel {
        background: #1a1a1a;
        color: #ffffff;
    }

    .mobile-detail-panel-header {
        background: #2d2d2d;
        border-color: #404040;
    }

    .mobile-detail-panel-footer {
        background: #1a1a1a;
        border-color: #404040;
    }

    .mobile-bottom-sheet {
        background: #2d2d2d;
        color: #ffffff;
    }

    .mobile-bottom-sheet-handle-bar {
        background: #555555;
    }

    .mobile-action-sheet-menu {
        background: #2d2d2d;
    }

    .mobile-action-sheet-btn {
        border-color: #404040;
    }

    .mobile-action-sheet-btn:active,
    .mobile-action-sheet-cancel:active {
        background-color: #404040;
    }

    .mobile-action-sheet-cancel {
        background: #2d2d2d;
    }
}
