/* Container principal de mensajes */
.django-messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* Mensaje individual */
.django-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    opacity: 0;
    animation: slideInMessage 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

/* Animaciones */
@keyframes slideInMessage {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutMessage {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
        max-height: 100px;
        margin-bottom: 12px;
    }
    to {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Tipos de mensaje */
.django-message-success {
    background: linear-gradient(135deg, 
        rgba(34, 197, 94, 0.9) 0%, 
        rgba(16, 185, 129, 0.9) 100%);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(34, 197, 94, 0.3);
}

.django-message-error {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.9) 0%, 
        rgba(220, 38, 38, 0.9) 100%);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(239, 68, 68, 0.3);
}

.django-message-warning {
    background: linear-gradient(135deg, 
        rgba(251, 146, 60, 0.9) 0%, 
        rgba(245, 158, 11, 0.9) 100%);
    border-color: rgba(251, 146, 60, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(251, 146, 60, 0.3);
}

.django-message-info {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.9) 0%, 
        rgba(37, 99, 235, 0.9) 100%);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(59, 130, 246, 0.3);
}

.django-message-debug {
    background: linear-gradient(135deg, 
        rgba(107, 114, 128, 0.9) 0%, 
        rgba(75, 85, 99, 0.9) 100%);
    border-color: rgba(107, 114, 128, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(107, 114, 128, 0.3);
}

/* Icono del mensaje */
.message-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Contenido del mensaje */
.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-text {
    line-height: 1.4;
    word-wrap: break-word;
}

/* Botón de cerrar */
.message-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    line-height: 1;
}

.message-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Barra de progreso para auto-dismiss */
.message-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 0 0 12px 12px;
    transform-origin: left;
    animation: messageProgress 5s linear forwards;
}

@keyframes messageProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Efectos hover */
.django-message:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(255, 255, 255, 0.15);
}

.django-message:hover .message-progress {
    animation-play-state: paused;
}

/* Responsive */
@media (max-width: 768px) {
    .django-messages-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .django-message {
        padding: 14px 16px;
        font-size: 0.85rem;
        min-height: 55px;
    }
    
    .message-icon {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .django-messages-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .django-message {
        padding: 12px 14px;
        border-radius: 10px;
        min-height: 50px;
    }
    
    .message-close {
        height: 22px;
        width: 22px;
        font-size: 16px;
    }
}

/* Estados de mensaje */
.django-message.dismissing {
    animation: slideOutMessage 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    pointer-events: none;
}

/* Efecto de entrada escalonada para múltiples mensajes */
.django-message:nth-child(1) { animation-delay: 0s; }
.django-message:nth-child(2) { animation-delay: 0.1s; }
.django-message:nth-child(3) { animation-delay: 0.2s; }
.django-message:nth-child(4) { animation-delay: 0.3s; }
.django-message:nth-child(5) { animation-delay: 0.4s; }