/**
 * PWA Install Prompt Styles
 */

/* Install Prompt Modal */
.pwa-install-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pwa-install-prompt.show {
    opacity: 1;
    visibility: visible;
}

.pwa-install-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.pwa-install-modal {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.4s ease-out;
}

@keyframes slideUpModal {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-install-header {
    padding: 24px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.pwa-install-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.pwa-install-header h3 {
    font-size: 24px;
    margin: 0;
    color: #2c3e50;
}

.pwa-install-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pwa-install-close:hover {
    background: #f0f0f0;
    color: #333;
}

.pwa-install-body {
    padding: 24px;
}

.pwa-install-body p {
    margin: 0 0 16px;
    font-size: 15px;
    color: #555;
}

.pwa-install-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.pwa-install-benefits li {
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #2c3e50;
}

.pwa-install-benefits li i {
    color: #28a745;
    font-size: 18px;
}

.pwa-install-ios-instructions {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.pwa-install-ios-instructions p {
    font-size: 14px;
    color: #856404;
    margin-bottom: 12px;
}

.pwa-install-ios-instructions ol {
    margin: 0;
    padding-left: 24px;
    color: #856404;
}

.pwa-install-ios-instructions ol li {
    margin-bottom: 8px;
    font-size: 13px;
}

.pwa-install-ios-instructions i {
    color: #007aff;
    font-size: 16px;
}

.pwa-install-footer {
    padding: 24px;
    border-top: 2px solid #f0f0f0;
}

.pwa-install-footer .btn {
    margin-bottom: 12px;
}

.pwa-install-footer .btn:last-child {
    margin-bottom: 0;
}

/* Install Button in Header */
.btn-install-pwa {
    padding: 10px 16px;
    margin-right: 12px;
}

.btn-install-pwa i {
    font-size: 18px;
}

/* Update Notification */
.pwa-update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99998;
    animation: slideUpNotification 0.4s ease-out;
}

@keyframes slideUpNotification {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.pwa-update-content {
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
}

.pwa-update-content i {
    font-size: 24px;
    color: #667eea;
}

.pwa-update-content span {
    flex: 1;
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.pwa-update-content .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.pwa-update-content .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pwa-update-content .btn-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Standalone Mode Adjustments */
.standalone-mode .site-header {
    padding-top: env(safe-area-inset-top);
}

.standalone-mode .site-header .container {
    padding-top: 8px;
}

/* iOS safe area adjustments */
@supports (padding: max(0px)) {
    .standalone-mode {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pwa-install-modal {
        max-width: 95%;
        border-radius: 16px;
    }

    .pwa-install-header {
        padding: 20px;
    }

    .pwa-install-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }

    .pwa-install-header h3 {
        font-size: 20px;
    }

    .pwa-install-body {
        padding: 20px;
    }

    .pwa-install-footer {
        padding: 20px;
    }

    .pwa-update-notification {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }

    .pwa-update-content {
        max-width: 100%;
    }
    
    /* Hide install text on mobile, show only icon */
    .btn-install-pwa .install-text {
        display: none;
    }
    
    .btn-install-pwa {
        padding: 0.5rem 0.75rem;
    }
}

/* PWA Install Button in Header */
.btn-install-pwa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-install-pwa:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.btn-install-pwa i {
    font-size: 16px;
}

.btn-install-pwa .install-text {
    font-size: 14px;
    white-space: nowrap;
}

/* Animation for install button */
@keyframes pulse-install {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
    }
}

.btn-install-pwa.pulse {
    animation: pulse-install 2s infinite;
}
