/**
 * PWA Styles - Encontre.ai
 * Estilos específicos para funcionalidades PWA
 */

/* PWA Install Banner */
.pwa-install-banner,
.pwa-update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pwa-install-banner.show,
.pwa-update-banner.show {
    transform: translateY(0);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 12px;
}

.pwa-banner-icon {
    flex-shrink: 0;
}

.pwa-banner-icon img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.pwa-banner-subtitle {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.2;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.pwa-install-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.pwa-dismiss-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.pwa-dismiss-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Notification Permission Modal */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.notification-modal.show {
    opacity: 1;
}

.notification-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.notification-modal.show .notification-modal-content {
    transform: scale(1);
}

.notification-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.notification-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.notification-modal-body {
    padding: 20px 24px;
    text-align: center;
}

.notification-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.notification-modal-body p {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 14px;
}

.notification-modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.notification-modal-body li {
    padding: 4px 0;
    font-size: 14px;
    color: #475569;
}

.notification-modal-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.notification-modal-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.notification-modal-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.notification-modal-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.notification-modal-actions .btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.notification-modal-actions .btn-secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Offline Notification */
.offline-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
    z-index: 9998;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

.offline-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.offline-content i {
    font-size: 18px;
    flex-shrink: 0;
}

.offline-content span {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.offline-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.offline-close:hover {
    background: rgba(255,255,255,0.2);
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    /* Estilos quando app está instalado */
    .pwa-install-banner {
        display: none !important;
    }
    
    /* Ajusta padding do header para compensar status bar */
    .header {
        padding-top: env(safe-area-inset-top);
    }
    
    /* Ajusta padding do footer para compensar home indicator */
    .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* iOS Safari específico */
@supports (-webkit-touch-callout: none) {
    .pwa-install-banner {
        /* Ajustes específicos para iOS */
        padding-top: env(safe-area-inset-top);
    }
}

/* Animações */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Loading States */
.pwa-loading {
    position: relative;
    overflow: hidden;
}

.pwa-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pwa-banner-content {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .pwa-banner-icon img {
        width: 32px;
        height: 32px;
    }
    
    .pwa-banner-title {
        font-size: 13px;
    }
    
    .pwa-banner-subtitle {
        font-size: 11px;
    }
    
    .pwa-install-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .notification-modal-content {
        margin: 16px;
    }
    
    .notification-modal-header,
    .notification-modal-body,
    .notification-modal-actions {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .offline-notification {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .pwa-banner-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .pwa-install-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .notification-modal-actions {
        gap: 8px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .notification-modal-content {
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .notification-modal-header h3 {
        color: #f1f5f9;
    }
    
    .modal-close {
        color: #94a3b8;
    }
    
    .modal-close:hover {
        background: #334155;
        color: #f1f5f9;
    }
    
    .notification-modal-body p {
        color: #94a3b8;
    }
    
    .notification-modal-body ul {
        background: #334155;
    }
    
    .notification-modal-body li {
        color: #cbd5e1;
    }
    
    .notification-modal-actions .btn-secondary {
        background: #334155;
        color: #94a3b8;
    }
    
    .notification-modal-actions .btn-secondary:hover {
        background: #475569;
        color: #f1f5f9;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .pwa-install-banner,
    .pwa-update-banner {
        background: #000;
        border-bottom: 2px solid #fff;
    }
    
    .pwa-install-btn {
        background: #fff;
        color: #000;
        border: 2px solid #fff;
    }
    
    .offline-notification {
        background: #000;
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pwa-install-banner,
    .pwa-update-banner,
    .notification-modal,
    .notification-modal-content,
    .offline-notification {
        transition: none;
        animation: none;
    }
    
    .pwa-loading::after {
        animation: none;
    }
}

