/* ====================== */
/* Messages/Notifications - Stylish Version */
/* ====================== */

.messages-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    width: 90%;
    max-width: 600px;
    padding: 0 1rem;
    pointer-events: none;
}

.alert-message {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.75rem;
    overflow: hidden;
    position: relative;
    pointer-events: auto;
    animation: fadeSlideIn 0.5s ease forwards, pulse 2s infinite ease-in-out;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease-out,
    transform 0.3s ease-out,
    background-color 0.3s ease;
}

.alert-message.success {
    background: rgba(25, 135, 84, 0.1);
    border-left: 5px solid #198754;
}

.alert-message.error {
    background: rgba(220, 53, 69, 0.1);
    border-left: 5px solid #dc3545;
}

.alert-message.warning {
    background: rgba(253, 126, 20, 0.1);
    border-left: 5px solid #fd7e14;
}

.alert-message.info {
    background: rgba(13, 202, 240, 0.1);
    border-left: 5px solid #0dcaf0;
}

.alert-message.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: -1;
}

.alert-message.fade-out .alert-progress {
    opacity: 0;
}

.alert-content {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    position: relative;
}

.alert-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-message.success .alert-icon {
    background-color: #198754;
    color: white;
}

.alert-message.error .alert-icon {
    background-color: #dc3545;
    color: white;
}

.alert-message.warning .alert-icon {
    background-color: #fd7e14;
    color: white;
}

.alert-message.info .alert-icon {
    background-color: #0dcaf0;
    color: white;
}

.alert-text {
    flex-grow: 1;
    font-size: 1rem;
    color: #212529;
}

.alert-close {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.alert-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
}

.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: currentColor;
    animation: progressBar 5s linear forwards;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    transition: opacity 0.2s ease;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.10);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.15);
    }
}

@media (max-width: 576px) {
    .alert-content {
        padding: 0.5rem 0.75rem;
    }

    .alert-text {
        font-size: 0.9rem;
    }
}
