/* PWA Installation Styles */

/* Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.pwa-install-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.pwa-install-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pwa-install-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-install-text {
    flex: 1;
}

.pwa-install-text h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: #333;
}

.pwa-install-text p {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.pwa-install-features {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pwa-install-features span {
    font-size: 11px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pwa-install-features span i {
    font-size: 10px;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.pwa-dismiss-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.pwa-dismiss-btn:hover {
    background: #f0f0f0;
    color: #666;
}

/* Installation Success Toast */
.pwa-install-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.pwa-install-success.show {
    transform: translateX(0);
}

.pwa-install-success i {
    font-size: 24px;
}

.pwa-install-success h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.pwa-install-success p {
    font-size: 13px;
    opacity: 0.9;
}

/* Update Notification */
.pwa-update-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 350px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-left: 4px solid #007bff;
}

.pwa-update-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.pwa-update-notification i {
    color: #007bff;
    font-size: 20px;
}

.pwa-update-notification span {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.pwa-update-notification button {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-update-notification button:hover {
    background: #0056b3;
}

/* Network Toast */
.pwa-network-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 350px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pwa-network-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.pwa-network-toast.success {
    border-left: 4px solid #28a745;
}

.pwa-network-toast.warning {
    border-left: 4px solid #ffc107;
}

.pwa-network-toast i {
    font-size: 20px;
}

.pwa-network-toast.success i {
    color: #28a745;
}

.pwa-network-toast.warning i {
    color: #ffc107;
}

.pwa-network-toast span {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Installation Instructions Modal */
.pwa-instructions-modal .modal-content {
    max-width: 500px;
}

.platform-instructions {
    padding: 20px;
}

.platform-instructions h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.platform-instructions h3 i {
    margin-right: 10px;
}

.platform-instructions ol {
    padding-left: 25px;
    margin-bottom: 20px;
}

.platform-instructions li {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

.platform-instructions li i {
    color: #dc3545;
    margin: 0 4px;
}

.instruction-image {
    text-align: center;
    margin-top: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.instruction-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

/* Display Mode Styles */
.display-mode-standalone,
.display-mode-fullscreen,
.display-mode-minimal-ui {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.display-mode-standalone .navbar {
    padding-top: env(safe-area-inset-top);
}

.display-mode-standalone .main-content {
    padding-bottom: env(safe-area-inset-bottom);
}

/* PWA Install Button in Menu */
.pwa-install-menu-btn {
    background: none;
    border: none;
    color: #666;
    padding: 10px 15px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.pwa-install-menu-btn:hover {
    background: #f8f9fa;
}

.pwa-install-menu-btn i {
    color: #dc3545;
    width: 20px;
}

/* Badge for installed status */
.pwa-installed-badge {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.pwa-installed-badge i {
    color: #28a745;
}

/* Offline indicator */
body.offline .offline-indicator {
    display: block;
}

.offline-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffc107;
    color: #333;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    z-index: 10010;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pwa-install-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .pwa-install-content {
        flex-wrap: wrap;
    }

    .pwa-install-icon {
        width: 50px;
        height: 50px;
    }

    .pwa-install-text {
        width: calc(100% - 70px);
    }

    .pwa-install-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pwa-install-banner {
        background: #2d2d2d;
        border-color: rgba(220, 53, 69, 0.4);
    }

    .pwa-install-text h3 {
        color: #fff;
    }

    .pwa-install-text p {
        color: #aaa;
    }

    .pwa-install-features span {
        background: rgba(40, 167, 69, 0.2);
        color: #28a745;
    }

    .pwa-dismiss-btn {
        color: #666;
    }

    .pwa-dismiss-btn:hover {
        background: #3d3d3d;
        color: #999;
    }

    .pwa-update-notification,
    .pwa-network-toast {
        background: #2d2d2d;
    }

    .pwa-update-notification span,
    .pwa-network-toast span {
        color: #fff;
    }
}/* PWA Install Button */
.pwa-install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    opacity: 0;
    transform: translateY(20px);
}

.pwa-install-btn.show {
    opacity: 1;
    transform: translateY(0);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.pwa-install-btn i:first-child {
    font-size: 18px;
}

#pwa-install-close {
    margin-left: 10px;
    font-size: 14px;
    opacity: 0.7;
    cursor: pointer;
}

#pwa-install-close:hover {
    opacity: 1;
}

/* Hide install button when app is installed */
.pwa-installed .pwa-install-btn {
    display: none !important;
}