/* PWA Specific Styles */

/* Splash Screen Enhancements for PWA */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3f704d 0%, #78866b 100%);
    display: none; /* Hidden by default - PWA manager will show it */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.splash-logo {
    text-align: center;
    animation: splashPulse 2s infinite;
}

.splash-logo img {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.splash-text {
    font-size: 32px;
    font-weight: 700;
    color: white;
    font-family: 'Vazirmatn', sans-serif;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes splashPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* PWA Mode Specific Styles */
body.pwa-mode {
    padding-top: 0 !important;
    /* Remove any top padding when in PWA mode */
}

/* Hide elements in PWA mode */
body.pwa-mode .browser-only {
    display: none !important;
}

/* Install Button Styles */
.install-button {
    animation: installButtonBounce 2s infinite;
}

@keyframes installButtonBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* PWA Status Bar Compensation */
body.pwa-mode .sticky-top {
    top: env(safe-area-inset-top, 0);
}

/* Safe Area for PWA */
body.pwa-mode {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Enhanced mobile experience in PWA */
@media (max-width: 768px) {
    body.pwa-mode .container {
        padding-left: max(15px, env(safe-area-inset-left, 0));
        padding-right: max(15px, env(safe-area-inset-right, 0));
    }
    
    body.pwa-mode .splash-logo img {
        width: 100px;
        height: 100px;
    }
    
    body.pwa-mode .splash-text {
        font-size: 28px;
    }
}

/* Update notification styles */
.pwa-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #3f704d;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInFromRight 0.3s ease;
    max-width: 300px;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* PWA Connection Status */
.pwa-connection-status {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-family: 'Vazirmatn', sans-serif;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwa-connection-status.show {
    opacity: 1;
}

.pwa-connection-status.offline {
    background: #f44336;
}

.pwa-connection-status.online {
    background: #4CAF50;
}

/* PWA Mode Header Adjustments */
body.pwa-mode header {
    padding-top: env(safe-area-inset-top, 0);
}

/* Loading indicator for PWA */
.pwa-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
}

.pwa-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(63, 112, 77, 0.3);
    border-top: 4px solid #3f704d;
    border-radius: 50%;
    animation: pwaSpin 1s linear infinite;
}

@keyframes pwaSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 