/* 
 * Sistema de Modal de Atualização - Voyger PDV
 * Animações modernas e responsivas para apresentação de novas versões
 */

/* Container principal do modal de atualização */
.update-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.95));
    backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    padding: 20px;
    overflow: hidden;
}

.update-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
    animation: overlayPulse 3s ease-in-out infinite;
}

/* Garantir que o modal fique acima de TUDO */
.update-modal-overlay.active {
    z-index: 99999 !important;
}

.update-modal-container {
    z-index: 100000;
}

/* Esconder notificações quando o modal de atualização está ativo */
body:has(.update-modal-overlay.active) #global-notification,
body:has(.update-modal-overlay.active) .notification-dropdown-container,
body:has(.update-modal-overlay.active) .notification-item {
    z-index: 1 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

@keyframes overlayPulse {
    0%, 100% { background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.95)); }
    50% { background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.92)); }
}

/* Container do conteúdo */
.update-modal-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(0, 0, 0, 0.1);
    transform: scale(0.3) translateY(100px) rotate(-15deg);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.update-modal-overlay.active .update-modal-container {
    transform: scale(1) translateY(0) rotate(0deg);
    opacity: 1;
    animation: containerShine 2s ease-in-out 0.8s infinite, containerFloat 3s ease-in-out infinite;
}

@keyframes containerShine {
    0%, 100% {
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.3),
            0 0 1px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.4),
            0 0 1px rgba(0, 0, 0, 0.1);
    }
}

@keyframes containerFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Cabeçalho do modal */
.update-modal-header {
    position: relative;
    padding: 40px 40px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    background-size: 200% 200%;
    animation: headerShimmer 3s ease infinite;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

@keyframes headerShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Logo animado */
.update-logo-container {
    position: relative;
    display: inline-flex;
    margin-bottom: 20px;
    animation: logoExplosion 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s both;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

@keyframes logoExplosion {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-360deg);
    }
    60% {
        transform: scale(1.3) rotate(20deg);
    }
    80% {
        transform: scale(0.9) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.update-logo {
    width: 100px;
    height: 100px;
    padding: 15px;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    background-size: 200% 200%;
    animation: logoShine 3s ease infinite, logoPulse 2s ease-in-out infinite;
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@keyframes logoShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.update-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: logoSpin 4s ease-in-out infinite;
    filter: brightness(0) invert(1);
}

@keyframes logoSpin {
    0%, 90% { transform: rotate(0deg); }
    95% { transform: rotate(20deg); }
    100% { transform: rotate(0deg); }
}

/* Badge "Novo" */
.update-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    background-size: 200% 200%;
    animation: badgeShine 1.5s ease infinite, badgeBounce 1s ease-in-out infinite;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(0, 0, 0, 0.1);
    transform-origin: center;
}

@keyframes badgeShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes badgeBounce {
    0%, 100% { 
        transform: translateY(0) scale(1) rotate(-5deg);
    }
    25% {
        transform: translateY(-8px) scale(1.1) rotate(5deg);
    }
    50% { 
        transform: translateY(0) scale(1) rotate(-5deg);
    }
    75% {
        transform: translateY(-4px) scale(1.05) rotate(5deg);
    }
}

/* Título e subtítulo */
.update-modal-title {
    position: relative;
    font-size: 36px;
    font-weight: 800;
    color: #000000;
    margin: 0 0 12px 0;
    line-height: 1.2;
    animation: titleReveal 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.6s both;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

@keyframes titleReveal {
    0% {
        transform: translateX(-100px) scale(0.5) rotate(-10deg);
        opacity: 0;
    }
    70% {
        transform: translateX(10px) scale(1.05) rotate(2deg);
    }
    100% {
        transform: translateX(0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.update-modal-title .highlight {
    color: #000000;
}

.update-modal-subtitle {
    position: relative;
    font-size: 18px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    animation: subtitleSlide 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.9s both;
}

@keyframes subtitleSlide {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Versão */
.update-version {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    animation: fadeInUp 0.5s ease 0.5s both;
}

/* Corpo do modal */
.update-modal-body {
    padding: 40px;
}

/* Seção de features */
.update-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.update-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-section-title i {
    color: #000000;
    font-size: 24px;
}

/* Feature card */
.update-feature {
    position: relative;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: featureReveal 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Delays sequenciais para efeito cascata */
.update-feature:nth-child(1) { animation-delay: 1.2s; }
.update-feature:nth-child(2) { animation-delay: 1.4s; }
.update-feature:nth-child(3) { animation-delay: 1.6s; }
.update-feature:nth-child(4) { animation-delay: 1.8s; }
.update-feature:nth-child(5) { animation-delay: 2.0s; }
.update-feature:nth-child(6) { animation-delay: 2.2s; }

@keyframes featureReveal {
    0% {
        transform: rotateY(90deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: rotateY(-10deg) scale(1.05);
    }
    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.update-feature:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.update-feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    background-size: 200% 200%;
    animation: iconShine 3s ease infinite;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes iconShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.update-feature-icon i {
    font-size: 24px;
    color: #ffffff;
    animation: iconBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.update-feature-title {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 8px 0;
}

.update-feature-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
}

/* Tag de categoria */
.update-feature-tag {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    background-size: 200% 200%;
    animation: tagShine 2s ease infinite;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

@keyframes tagShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.update-feature-tag.new {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    animation: tagShine 1.5s ease infinite, tagBounce 2s ease infinite;
}

@keyframes tagBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.update-feature-tag.improved {
    background: linear-gradient(135deg, #4a4a4a 0%, #6a6a6a 100%);
    color: #ffffff;
    animation: tagShine 2s ease infinite;
}

.update-feature-tag.fixed {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    color: #ffffff;
    animation: tagShine 2.5s ease infinite;
}

/* Rodapé do modal */
.update-modal-footer {
    padding: 30px 40px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.update-modal-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6c757d;
}

.update-modal-info i {
    color: #000000;
}

.update-modal-actions {
    display: flex;
    gap: 12px;
}

/* Botões */
.update-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.update-btn-primary {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    background-size: 200% 200%;
    animation: buttonShine 2s ease infinite, buttonPulse 1.5s ease-in-out infinite;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@keyframes buttonShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes buttonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.update-btn-primary:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: buttonShine 1s ease infinite, buttonShake 0.5s ease infinite;
}

@keyframes buttonShake {
    0%, 100% { transform: scale(1.1) translateY(-2px) rotate(0deg); }
    25% { transform: scale(1.1) translateY(-2px) rotate(-2deg); }
    75% { transform: scale(1.1) translateY(-2px) rotate(2deg); }
}

.update-btn-secondary {
    background: #ffffff;
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.update-btn-secondary:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-color: rgba(0, 0, 0, 0.3);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Botão de fechar */
.update-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100001;
}

.update-close-btn:hover {
    background: #f8f9fa;
    color: #000000;
    border-color: rgba(0, 0, 0, 0.2);
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .update-modal-overlay {
        padding: 0;
        align-items: flex-start;
    }
    
    .update-modal-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .update-modal-header {
        padding: 30px 24px 24px;
    }
    
    .update-logo {
        width: 64px;
        height: 64px;
        padding: 16px;
    }
    
    .update-logo i {
        font-size: 32px;
    }
    
    .update-modal-title {
        font-size: 28px;
    }
    
    .update-modal-subtitle {
        font-size: 16px;
    }
    
    .update-modal-body {
        padding: 24px;
    }
    
    .update-section-title {
        font-size: 18px;
    }
    
    .update-feature {
        padding: 20px;
    }
    
    .update-feature-title {
        font-size: 16px;
    }
    
    .update-feature-description {
        font-size: 13px;
    }
    
    .update-modal-footer {
        padding: 20px 24px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .update-modal-info {
        justify-content: center;
        order: 2;
    }
    
    .update-modal-actions {
        order: 1;
        flex-direction: column;
    }
    
    .update-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== VERSÃO MOBILE ULTRA-SIMPLIFICADA ===== */
.update-modal-overlay-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 10px;
}

.update-modal-overlay-mobile.active {
    opacity: 1;
    pointer-events: all;
}

.update-modal-container-mobile {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.update-modal-overlay-mobile.active .update-modal-container-mobile {
    transform: scale(1);
    opacity: 1;
}

.update-modal-header-mobile {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.update-logo-mobile {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    padding: 10px;
    background: #000000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.update-logo-mobile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.update-modal-title-mobile {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.update-modal-subtitle-mobile {
    font-size: 16px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.update-modal-body-mobile {
    padding: 20px;
}

.update-section-title-mobile {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 15px 0;
    text-align: center;
}

.update-features-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.update-feature-mobile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.update-feature-icon-mobile {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    border-radius: 6px;
    flex-shrink: 0;
}

.update-feature-icon-mobile i {
    color: #ffffff;
    font-size: 14px;
}

.update-feature-content-mobile {
    flex: 1;
    min-width: 0;
}

.update-feature-title-mobile {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.update-feature-description-mobile {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.update-feature-tag-mobile {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.update-feature-tag-mobile.new {
    background: #000000;
    color: #ffffff;
}

.update-feature-tag-mobile.improved {
    background: #6c757d;
    color: #ffffff;
}

.update-modal-footer-mobile {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.update-modal-actions-mobile {
    display: flex;
    gap: 10px;
}

.update-btn-mobile {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
}

.update-btn-primary-mobile {
    background: #000000;
    color: #ffffff;
}

.update-btn-primary-mobile:hover {
    background: #333333;
}

.update-btn-secondary-mobile {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.update-btn-secondary-mobile:hover {
    background: #e9ecef;
}

.update-close-btn-mobile {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 1;
}

.update-close-btn-mobile:hover {
    background: #e9ecef;
}

.update-close-btn-mobile i {
    color: #6c757d;
    font-size: 14px;
}

/* Responsividade para desktop */
@media (min-width: 769px) {
    .update-modal-overlay-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .update-modal-overlay:not(.update-modal-overlay-mobile) {
        display: none !important;
    }
}

/* Animação de saída */
.update-modal-overlay.closing {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.update-modal-overlay.closing .update-modal-container {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Scrollbar personalizada */
.update-modal-container::-webkit-scrollbar {
    width: 8px;
}

.update-modal-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.update-modal-container::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.update-modal-container::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

