/* Estilos para Modais de Animação/História */
.animation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.animation-modal-content {
    background: 
        linear-gradient(135deg, rgba(52, 152, 219, 0.8) 0%, rgba(41, 128, 185, 0.8) 50%, rgba(52, 152, 219, 0.8) 100%),
        url('../../public/images/lab/5.jpg');
    background-size: 100% 100%;
    
    border-radius: 15px;
    padding: 20px;
    max-width: fit-content;
    min-width: 400px;
    position: relative;
    border: 3px solid #d4af37;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    overflow: hidden;
}

/* Camada da imagem de fundo com opacidade */
.animation-modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('public/images/lab/5.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

/* Efeito de neve caindo por cima de tudo */
.animation-modal-content::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    height: calc(100% + 50px);
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff, transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: snowfall 8s linear infinite;
    opacity: 0.8;
    pointer-events: none;
    z-index: 3;
}

@keyframes snowfall {
    0% { transform: translateY(-50px); }
    100% { transform: translateY(calc(100% + 50px)); }
}

.animation-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #f39c12;
    cursor: pointer;
    font-weight: bold;
}

.animation-close-btn:hover {
    color: #e67e22;
}

.story-balloon {
    display: none;
    align-items: center;
    gap: 20px;
    min-height: 200px;
    position: relative;
    z-index: 2;
}

.story-balloon.active {
    display: flex;
}

.animation-modal-character-sprite {
    width: 180px !important;
    height: 180px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    flex-shrink: 0;
}

.speech-bubble {
    background: rgba(236, 240, 241, 0.95);
    border-radius: 15px;
    padding: 20px;
    position: relative;
    max-width: 300px;
    min-width: 200px;
    width: fit-content;
    border: 2px solid #bdc3c7;
    backdrop-filter: blur(3px);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #ecf0f1;
}

.character-name {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 8px;
    font-size: 14px;
}

.speech-bubble p {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    line-height: 1.4;
}

.speech-bubble button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.speech-bubble button:hover {
    background: #2980b9;
}

.message-content {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
        display: flex;
    flex-wrap: wrap;
    line-height: 1.4;
}

.message-image {
    display: inline-block;
    margin: 5px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    vertical-align: top;
}

.message-image img {
    max-height: 50px;
    width: auto;
    border-radius: 4px;
    border: 1px solid #d4af37;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    display: block;
}

.message-image img:hover {
    transform: scale(1.1);
}

/* Responsivo */
@media (max-width: 768px) {
    .animation-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .story-balloon {
        flex-direction: column;
        text-align: center;
    }
    
    .speech-bubble::before {
        display: none;
    }
    
    .character-sprite {
        width: 80px;
        height: 80px;
    }
}