/* PWA Specific Styles */

/* Install Banner Styles */
#pwa-install-banner {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: slideUp 0.3s ease-out;
}

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

/* PWA Standalone Mode Styles */
@media all and (display-mode: standalone) {
    /* Hide elements that are not needed in standalone mode */
    .browser-only {
        display: none !important;
    }
    
    /* Optimizar el uso del espacio - sin padding superior */
    body {
        padding-top: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Asegurar que el contenido principal use todo el espacio disponible */
    #wrapper {
        min-height: 100vh;
        padding-top: 0;
    }
    
    /* Style adjustments for standalone mode */
    #header-container {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-top: 0;
    }
    
    /* Optimizar secciones para mejor uso del espacio */
    .section {
        padding-top: 20px;
    }
    
    /* Asegurar que los modales y alerts se muestren correctamente */
    .bootbox {
        z-index: 10002;
    }
}

/* PWA Install Button */
.pwa-install-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 8px;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* PWA Splash Screen Prevention */
.no-splash {
    background: white;
}

/* iOS PWA Status Bar - Reducido para aprovechar mejor el espacio */
@supports (-webkit-touch-callout: none) {
    @media all and (display-mode: standalone) {
        body {
            padding-top: 0; /* Eliminado el padding superior para iOS */
        }
    }
}

/* Android PWA Navigation Bar */
@media all and (display-mode: standalone) {
    .android-nav-padding {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Loading States for PWA */
.pwa-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
