/* PWA Specific Styles */

/* PWA Install Popup Styles */
.pwa-install-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwa-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.pwa-popup-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: pwaSlideIn 0.3s ease-out;
}

@keyframes pwaSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pwa-popup-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.pwa-app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pwa-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-app-info h3 {
    color: white;
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.pwa-app-info p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 8px 0;
    font-size: 14px;
}

.pwa-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-rating .stars {
    font-size: 12px;
}

.pwa-rating .rating-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
}

.pwa-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.pwa-popup-body {
    padding: 20px;
    background: white;
}

.pwa-popup-body h4 {
    color: #333;
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.pwa-subtitle {
    color: #666;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 14px;
}

.pwa-benefits {
    margin-bottom: 20px;
}

.pwa-benefit-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.pwa-benefit-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.benefit-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.benefit-text {
    flex: 1;
}

.benefit-text strong {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.benefit-text span {
    color: #666;
    font-size: 12px;
}

.pwa-features {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.pwa-features h5 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.pwa-features ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
    font-size: 13px;
    line-height: 1.6;
}

.pwa-features li {
    margin-bottom: 5px;
}

.pwa-popup-footer {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.pwa-install-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pwa-install-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.pwa-install-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pwa-later-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-later-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.pwa-install-hint {
    margin-top: 10px;
    color: #999;
    font-size: 11px;
}

/* PWA Top Banner Styles */
.pwa-top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pwa-top-banner.show {
    transform: translateY(0);
}

.pwa-top-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-top-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.pwa-top-icon {
    font-size: 18px;
}

.pwa-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-top-install-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-top-install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pwa-top-dismiss-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.pwa-top-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* PWA Install Banner Styles */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 15px 20px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-banner-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pwa-icon {
    font-size: 24px;
}

.pwa-banner-text strong {
    display: block;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.pwa-banner-text p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pwa-dismiss-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-dismiss-btn:hover {
    background: #f8f9fa;
    color: #333;
}

/* PWA Success Toast */
.pwa-success-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    z-index: 1001;
    animation: pwaToastSlideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

@keyframes pwaToastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pwa-toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-toast-icon {
    font-size: 16px;
}

/* Mobile specific styles */
@media (max-width: 768px) {
    .pwa-install-popup {
        padding: 10px;
    }
    
    .pwa-popup-content {
        max-height: 95vh;
    }
    
    .pwa-popup-header {
        padding: 15px;
    }
    
    .pwa-popup-body {
        padding: 15px;
    }
    
    .pwa-popup-footer {
        padding: 15px;
    }
    
    .pwa-app-icon {
        width: 50px;
        height: 50px;
    }
    
    .pwa-app-info h3 {
        font-size: 16px;
    }
    
    .pwa-popup-body h4 {
        font-size: 18px;
    }
    
    .pwa-top-banner {
        padding: 8px 15px;
    }
    
    .pwa-top-text {
        font-size: 13px;
    }
    
    .pwa-top-actions {
        gap: 8px;
    }
    
    .pwa-top-install-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .pwa-install-banner {
        padding: 12px 15px;
    }
    
    .pwa-banner-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .pwa-banner-text {
        justify-content: center;
    }
    
    .pwa-banner-actions {
        justify-content: center;
    }
}

/* PWA Standalone Mode Styles */
@media (display-mode: standalone) {
    /* Hide PWA install elements when app is already installed */
    .pwa-install-popup,
    .pwa-top-banner,
    .pwa-install-banner {
        display: none !important;
    }
    
    /* Adjust body padding for standalone mode */
    body {
        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);
    }
}

/* PWA Loading States */
.pwa-loading {
    opacity: 0.6;
    pointer-events: none;
}

.pwa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: pwaSpin 1s linear infinite;
}

@keyframes pwaSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
