/* PWA Installation and Update Banners */
.pwa-banner {
    position: fixed;
    z-index: 9999;
    background-color: #215F76;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 380px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    margin: 0 auto; /* Center the banner */
}

/* Dark mode specific styling */
.dark-mode .pwa-banner {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Bounce animation for better visibility */
@keyframes pwa-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.pwa-banner-bounce {
    animation: pwa-bounce 1s ease;
}

.pwa-install-banner {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
}

.pwa-update-banner {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
}

.pwa-banner-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) !important;
}

.pwa-banner-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px) !important;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #215F76, #1a4d61);
    border-left: 4px solid #c69c6d;
}

.pwa-banner-icon {
    flex: 0 0 50px;
    height: 50px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pwa-banner-icon img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.pwa-banner-text {
    flex: 1;
}

.pwa-banner-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pwa-banner-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.pwa-banner-actions {
    display: flex;
    flex-direction: column;
    margin-left: 15px;
    gap: 8px;
    align-items: center;
    min-width: 70px; /* Ensure enough space for buttons */
}

.pwa-btn {
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin: 5px 0;
    transition: all 0.2s ease;
}

.pwa-btn-install {
    background-color: #c69c6d;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pwa-btn-install:hover {
    background-color: #b78b5c;
}

.pwa-btn-update {
    background-color: #c69c6d;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pwa-btn-update:hover {
    background-color: #b78b5c;
}

.pwa-btn-close {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    margin: 0 auto;
}

.pwa-btn-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* PWA Install button styling */
.pwa-install-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 1000; /* Higher z-index to ensure it appears above most elements */
}

.pwa-install-button {
    background-color: #215F76;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    display: none; /* Hidden by default, shown when install prompt is available */
}

.pwa-install-button:hover {
    background-color: #174654;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Media queries for mobile devices */
@media (max-width: 600px) {
    .pwa-banner {
        width: 85%;
        max-width: 320px;
        border-radius: 8px;
    }
    
    .pwa-install-banner {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
    }
    
    .pwa-banner-visible.pwa-install-banner {
        transform: translateX(-50%) translateY(0);
    }
    
    .pwa-update-banner {
        top: 15px;
        left: 50%;
        transform: translateX(-50%) translateY(-20px);
    }
    
    .pwa-banner-visible.pwa-update-banner {
        transform: translateX(-50%) translateY(0);
    }
    
    .pwa-install-container {
        right: 10px;
    }
    
    .pwa-banner-content {
        padding: 12px;
    }
    
    .pwa-banner-text strong {
        font-size: 15px;
    }
      .pwa-banner-text p {
        font-size: 13px;
    }
}

/* iOS-specific styles */
@supports (-webkit-touch-callout: none) {
    .pwa-banner {
        /* iOS shadow style */
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    
    .pwa-banner-icon {
        /* iOS icon styling */
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }
    
    /* Improve iOS appearance */
    .pwa-banner-actions {
        padding-top: 5px;
    }
    
    /* iOS-styled buttons */
    .pwa-install-btn {
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
        border-radius: 8px;
        font-weight: 500;
    }
    
    .pwa-dismiss-btn {
        background: rgba(0, 0, 0, 0.05);
        color: rgba(255, 255, 255, 0.85);
    }
}

/* iOS banner specific styles */
.ios-banner .pwa-banner-content {
    border-left: 4px solid #FFD700;
}

.ios-banner .pwa-banner-text p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.ios-banner .pwa-banner-text i {
    margin: 0 2px;
}

.ios-banner .ios-install-btn {
    background: linear-gradient(to bottom, #4CD964, #34C759);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
