/* Overlay */
.pwa-update-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 18px;
    z-index: 1200;
    display: none;
    justify-content: center;
    pointer-events: none;
}

.pwa-update-banner.show {
    display: flex;
}

.pwa-update-content {
    width: min(100%, 440px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    color: #27313f;
    background: #fff;
    border: 1px solid #f0d6c0;
    border-left: 4px solid #d95d05;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(46, 32, 18, 0.18);
    pointer-events: auto;
}

.pwa-update-actions {
    display: inline-flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-update-actions button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #d95d05;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

#refreshApp {
    color: #fff;
    background: #d95d05;
}

#dismissUpdate {
    color: #d95d05;
    background: #fff;
}

.install-popup {
    display: none; /* Hide by default */
    position: fixed; /* Cover the whole screen */
    z-index: 1000; /* Sit above other content */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scrolling if needed */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent dark overlay */
    opacity: 0; /* Initially invisible */
    transition: opacity 0.3s ease; /* Smooth opacity transition */
}

/* Popup Content */
.install-popup-content {
    background: linear-gradient(135deg, #ffffff, #f9f9f9); /* Subtle gradient for background */
    margin: 10% auto; /* Centered on screen */
    padding: 25px; /* More comfortable padding */
    border: 1px solid #ddd; /* Soft border color */
    width: 90%; /* Responsive width */
    max-width: 450px; /* Limit max width */
    text-align: center; /* Centered content */
    border-radius: 15px; /* More rounded corners */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); /* Deep shadow for a modern look */
    transform: translateY(-50px); /* Start above view */
    transition: transform 0.4s ease, opacity 0.4s ease; /* Smooth transition */
    opacity: 0; /* Initially hidden */
}

/* Show the popup */
.install-popup.show {
    display: block; /* Make visible */
    opacity: 1; /* Fully visible */
}

.install-popup.show .install-popup-content {
    transform: translateY(0); /* Slide into view */
    opacity: 1; /* Fully visible */
}

/* Scrollbar Customization */
.install-popup-content {
    overflow-y: auto; /* Enable vertical scrolling */
    max-height: 70vh; /* Limit height for scrolling */
    scrollbar-width: thin; /* Firefox: Thin scrollbar */
    scrollbar-color: #d95d05 #f4f4f4; /* Firefox: Custom colors */
}

/* Webkit-based browsers: Scrollbar */
.install-popup-content::-webkit-scrollbar {
    width: 8px;
}

.install-popup-content::-webkit-scrollbar-thumb {
    background-color: #d95d05; /* Thumb color */
    border-radius: 4px; /* Rounded thumb */
}

.install-popup-content::-webkit-scrollbar-track {
    background-color: #f4f4f4; /* Track color */
    border-radius: 4px; /* Rounded track */
}

/* Close Button */
.install-popup-close {
    color: #888; /* Neutral color */
    float: right; /* Align to the top-right */
    font-size: 24px; /* Large and bold */
    font-weight: bold; /* Emphasis */
    cursor: pointer; /* Pointer cursor */
    margin-top: -10px; /* Fine-tune placement */
    margin-right: -10px; /* Fine-tune placement */
    transition: color 0.2s ease; /* Smooth color change */
}

.install-popup-close:hover,
.install-popup-close:focus {
    color: #d95d05; /* Highlight on hover/focus */
}

/* Title */
.install-popup-content h2 {
    font-size: 26px; /* Larger for emphasis */
    margin-bottom: 12px; /* Extra space below */
    color: #333; /* Darker for readability */
    font-weight: bold; /* Stronger text */
}

/* Paragraph */
.install-popup-content p {
    font-size: 16px; /* Standard text size */
    margin-bottom: 20px; /* Extra space below */
    color: #555; /* Softer color */
    line-height: 1.6; /* Improved readability */
}

/* Buttons */
#installPopupButton,
.closePopupButton {
    background: linear-gradient(135deg, #d95d05, #c45503); /* Gradient for modern look */
    color: #fff; /* White text */
    padding: 14px 28px; /* Larger padding */
    border: none; /* Remove borders */
    border-radius: 8px; /* Smoothly rounded */
    cursor: pointer; /* Pointer cursor */
    font-size: 16px; /* Standard text size */
    font-weight: bold; /* Emphasize buttons */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
    transition: background 0.3s ease, transform 0.2s ease; /* Smooth transitions */
}

#pwaInstallPopup .install-popup-content > p:not([data-install-helper]):not(.install-popup-manual-help) {
    display: none;
}

#installPopupButton.is-disabled,
#installPopupButton:disabled {
    color: #8a5a34;
    background: #fff4eb;
    border: 1px solid #f0d6c0;
    box-shadow: none;
    cursor: default;
}

#installPopupButton.is-disabled:hover,
#installPopupButton:disabled:hover {
    transform: none;
}

.install-popup-manual-help {
    padding: 10px 12px;
    background: #fff8f2;
    border: 1px solid #f0d6c0;
    border-radius: 8px;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

#installPopupButton:hover,
.closePopupButton:hover {
    background: linear-gradient(135deg, #c45503, #b54a02); /* Slightly darker on hover */
    transform: translateY(-2px); /* Hover lift effect */
}

#installPopupButton:active,
.closePopupButton:active {
    transform: translateY(0); /* Pressed effect */
}

/* Responsiveness */
@media (max-width: 768px) {
    .pwa-update-content {
        align-items: stretch;
        flex-direction: column;
    }

    .pwa-update-actions {
        width: 100%;
    }

    .pwa-update-actions button {
        flex: 1;
    }

    .install-popup-content {
        margin: 20% auto; /* Adjust positioning */
        width: 95%; /* Use more screen width */
    }

    #installPopupButton,
    .closePopupButton {
        font-size: 14px; /* Smaller font for smaller screens */
        padding: 12px 20px; /* Adjust padding */
    }
}
