/**
 * PWA Styles
 * Estilos para notificaciones de actualización e instalación
 */

/* ============================================
   NOTIFICACIÓN DE ACTUALIZACIÓN
   ============================================ */
#pwa-update-notification {
    position: fixed;
    bottom: -300px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 20px 24px;
    max-width: 500px;
    width: 90%;
    z-index: 10000;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pwa-update-notification.show {
    bottom: 20px;
}

.pwa-update-content {
    display: flex;
    gap: 16px;
    align-items: center;
}

.pwa-update-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.pwa-update-text {
    flex: 1;
}

.pwa-update-text strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: #1f2937;
}

.pwa-update-text p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.pwa-update-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-btn-primary {
    background: #4F46E5;
    color: white;
}

.pwa-btn-primary:hover {
    background: #4338CA;
    transform: translateY(-1px);
}

.pwa-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.pwa-btn-secondary:hover {
    background: #d1d5db;
}

/* ============================================
   NOTIFICACIÓN OFFLINE
   ============================================ */
#pwa-offline-notification {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pwa-offline-notification.show {
    top: 20px;
}

.pwa-offline-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.pwa-offline-icon {
    font-size: 1.2rem;
}

/* ============================================
   BOTÓN INSTALAR APP
   ============================================ */
#pwa-install-prompt {
    position: fixed;
    bottom: -200px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    max-width: 320px;
    z-index: 9999;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pwa-install-prompt.show {
    bottom: 20px;
}

.pwa-install-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pwa-install-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
}

.pwa-install-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.pwa-install-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.pwa-install-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-install-btn-primary {
    background: white;
    color: #667eea;
}

.pwa-install-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.pwa-install-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.pwa-install-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pwa-install-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    transition: background 0.2s;
}

.pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   PROMPT iOS
   ============================================ */
.pwa-ios-prompt {
    position: fixed;
    bottom: -600px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    padding: 24px;
    max-width: 420px;
    width: 90%;
    z-index: 10000;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-ios-prompt.show {
    bottom: 20px;
}

.pwa-ios-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pwa-ios-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-right: 24px;
}

.pwa-ios-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.pwa-ios-title strong {
    display: block;
    font-size: 1.2rem;
    color: #1f2937;
    margin-bottom: 4px;
}

.pwa-ios-title p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwa-ios-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pwa-ios-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.pwa-ios-step-content {
    flex: 1;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pwa-ios-step-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pwa-ios-step-text {
    flex: 1;
    padding-top: 2px;
}

.pwa-ios-step-text strong {
    color: #1f2937;
}

.pwa-ios-hint {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 2px;
}

.pwa-ios-checkbox {
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 8px;
}

.pwa-ios-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.pwa-ios-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.pwa-ios-checkbox span {
    font-size: 0.9rem;
    color: #4b5563;
}

.pwa-ios-actions {
    display: flex;
    gap: 8px;
}

.pwa-ios-actions button {
    flex: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    #pwa-update-notification {
        bottom: -350px;
        width: calc(100% - 32px);
    }

    #pwa-update-notification.show {
        bottom: 16px;
    }

    .pwa-update-content {
        flex-direction: column;
        text-align: center;
    }

    .pwa-update-actions {
        width: 100%;
        flex-direction: column;
    }

    .pwa-btn {
        width: 100%;
    }

    #pwa-install-prompt {
        right: 16px;
        left: 16px;
        max-width: none;
    }

    #pwa-offline-notification {
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
    }
}

/* ============================================
   DARK MODE
   ============================================ */
body.dark-theme #pwa-update-notification {
    background: #1f2937;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body.dark-theme .pwa-update-text strong {
    color: #f9fafb;
}

body.dark-theme .pwa-update-text p {
    color: #9ca3af;
}

body.dark-theme .pwa-btn-secondary {
    background: #374151;
    color: #e5e7eb;
}

body.dark-theme .pwa-btn-secondary:hover {
    background: #4b5563;
}
