/* PWA Specific Styles */

/* Standalone mode styles */
.standalone .pwa-install-btn {
    display: none !important;
}

.standalone header {
    padding-top: env(safe-area-inset-top);
}

.standalone .min-h-screen {
    padding-bottom: env(safe-area-inset-bottom);
}

/* PWA Install Button Animation */
.pwa-install-btn {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Offline Indicator Styles */
#offline-indicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* PWA Splash Screen */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    color: white;
    font-family: "Poppins", sans-serif;
    text-align: center;
}

.pwa-splash.hidden {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.pwa-splash .logo {
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    border-radius: 20px;
}

.pwa-splash .logo-fallback {
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    animation: fadeInUp 1s ease;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.pwa-splash .fallback-icon {
    font-size: 80px;
    opacity: 0.8;
}

.pwa-splash .app-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    animation: fadeInUp 1s ease 0.2s both;
}

.pwa-splash .app-description {
    font-size: 16px;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.4s both;
}

.pwa-splash .loading {
    margin-top: 30px;
    animation: fadeInUp 1s ease 0.6s both;
}

.pwa-splash .loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.pwa-splash .loading-progress {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loading 2s ease infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* PWA Toast Notifications */
.pwa-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* PWA Navigation Enhancement */
.pwa-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 10px 0;
    z-index: 1000;
    display: none;
}

.standalone .pwa-nav {
    display: block;
}

.pwa-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.pwa-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6b7280;
    font-size: 12px;
    transition: color 0.3s ease;
}

.pwa-nav .nav-item.active {
    color: #e74c3c;
}

.pwa-nav .nav-item .icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Responsive PWA Elements */
@media (max-width: 768px) {
    .pwa-install-btn {
        top: 10px;
        left: 10px;
        padding: 10px 16px;
        font-size: 12px;
    }

    .pwa-splash .logo {
        width: 150px;
        height: 150px;
    }

    .pwa-splash .logo-fallback {
        width: 150px;
        height: 150px;
    }

    .pwa-splash .fallback-icon {
        font-size: 60px;
    }

    .pwa-splash .app-name {
        font-size: 24px;
    }

    .pwa-splash .app-description {
        font-size: 14px;
    }
}

/* PWA Print Styles */
@media print {
    .pwa-install-btn,
    .pwa-nav,
    #offline-indicator {
        display: none !important;
    }
}
