/**
 * Estilos específicos para características PWA
 */

/* Notificación de actualización */
.update-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 15px 20px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.update-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.update-button {
    margin-left: 10px;
    padding: 6px 12px;
    background-color: white;
    color: var(--color-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.update-button:hover {
    background-color: #f0f0f0;
}

/* Banner de instalación */
.pwa-install-container {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 0 20px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pwa-install-container.show {
    transform: translateY(0);
}

.pwa-install-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-prompt-content {
    display: flex;
    align-items: center;
}

.pwa-prompt-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.pwa-prompt-text {
    display: flex;
    flex-direction: column;
}

.pwa-prompt-text strong {
    font-size: 1rem;
    margin-bottom: 2px;
}

.pwa-prompt-text span {
    font-size: 0.85rem;
    opacity: 0.8;
}

.pwa-prompt-buttons {
    display: flex;
    gap: 10px;
}

#pwa-install-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

#pwa-install-button:hover {
    background-color: #3a58d6;
}

#pwa-dismiss-button {
    background: none;
    border: none;
    color: var(--color-text);
    padding: 8px 16px;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.3s;
}

#pwa-dismiss-button:hover {
    opacity: 1;
}

/* Adaptaciones para dispositivos pequeños */
@media (max-width: 576px) {
    .pwa-install-prompt {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pwa-prompt-content {
        margin-bottom: 10px;
    }
    
    .pwa-prompt-buttons {
        width: 100%;
    }
    
    #pwa-install-button, 
    #pwa-dismiss-button {
        flex: 1;
        text-align: center;
    }
}

/* Ajustes para el modo standalone */
.standalone-mode .header-nav-desktop,
.standalone-mode .footer-desktop {
    display: none;
}

.standalone-mode .container {
    padding-top: 10px;
}

/* Estilos para botón de compartir */
.share-button {
    background: none;
    border: none;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.share-button:hover {
    background-color: rgba(74, 108, 247, 0.1);
}

.share-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Indicador de desconexión */
.offline-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: #f44336;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.offline-indicator.show {
    display: flex;
}

.offline-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Animación de pulso */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Estilos para splash screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.splash-screen.hide {
    opacity: 0;
    pointer-events: none;
}

.splash-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.splash-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.splash-subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background-color: white;
    border-radius: 4px;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -30%; }
    100% { left: 100%; }
}