/* PWA 专用样式 */

/* PWA 模式下的样式调整 */
.pwa-mode {
    /* 在PWA模式下隐藏浏览器相关的UI元素 */
}

.pwa-mode .navbar-brand {
    /* PWA模式下的导航栏样式 */
}

.pwa-mode .sidebar {
    /* PWA模式下的侧边栏样式 */
}

/* PWA 安装按钮样式 */
#install-button {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

#install-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

#install-button:active {
    transform: translateY(0);
}

/* PWA 状态指示器 */
.pwa-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.pwa-status.online {
    background: rgba(40, 167, 69, 0.9);
}

.pwa-status.offline {
    background: rgba(220, 53, 69, 0.9);
}

/* PWA 模式下的全屏样式 */
.pwa-mode .content-wrapper {
    padding-top: 0;
}

.pwa-mode .main-header {
    display: none;
}

.pwa-mode .main-sidebar {
    display: none;
}

/* PWA 模式下的移动端优化 */
@media (max-width: 768px) {
    .pwa-mode .content-wrapper {
        margin-left: 0;
    }
    
    .pwa-mode .main-content {
        padding: 10px;
    }
}

/* PWA 安装横幅动画 */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutToBottom {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.pwa-install-banner {
    animation: slideInFromBottom 0.3s ease-out;
}

.pwa-install-banner.hide {
    animation: slideOutToBottom 0.3s ease-in;
}

/* PWA 离线状态样式 */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* PWA 模式下的触摸优化 */
.pwa-mode .btn {
    min-height: 44px;
    min-width: 44px;
}

.pwa-mode .form-control {
    min-height: 44px;
}

.pwa-mode .table td {
    padding: 12px 8px;
}

/* PWA 模式下的滚动优化 */
.pwa-mode .content-wrapper {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* PWA 模式下的安全区域适配 */
@supports (padding: max(0px)) {
    .pwa-mode .content-wrapper {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

/* PWA 模式下的深色主题支持 */
@media (prefers-color-scheme: dark) {
    .pwa-mode {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .pwa-mode .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .pwa-mode .table {
        color: #ffffff;
    }
    
    .pwa-mode .table th,
    .pwa-mode .table td {
        border-color: #404040;
    }
}

/* PWA 模式下的高对比度支持 */
@media (prefers-contrast: high) {
    .pwa-mode .btn {
        border: 2px solid;
    }
    
    .pwa-mode .form-control {
        border: 2px solid;
    }
}

/* PWA 模式下的减少动画支持 */
@media (prefers-reduced-motion: reduce) {
    .pwa-mode * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
