﻿
.custom-alert {
    position: fixed;
    top: 10%;
    right: 10%; /* Align to the right */
    transform: translate(0, 0); /* No horizontal centering needed */
    z-index: 1000;
    padding: 15px 20px;
    max-width: 90%; /* Ensure it fits within smaller screens */
    width: auto; /* Adjust width dynamically */
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    font-size: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slide-down 0.5s ease;
}

    /* Alert Types */
    .custom-alert.success {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .custom-alert.error {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

    .custom-alert.warning {
        background-color: #fff3cd;
        color: #856404;
        border: 1px solid #ffeeba;
    }

.alert-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0; /* Prevent icon from shrinking on smaller screens */
}

/* Animation */
@keyframes slide-down {
    from {
        top: -50px;
        opacity: 0;
    }

    to {
        top: 10%;
        opacity: 1;
    }
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .custom-alert {
        font-size: 14px; /* Slightly smaller text on smaller screens */
        padding: 10px 15px; /* Reduce padding */
    }

    .alert-icon {
        width: 25px;
        height: 25px; /* Smaller icons for smaller screens */
    }
}

@media (max-width: 480px) {
    .custom-alert {
        font-size: 12px; /* Even smaller text for very small screens */
        padding: 8px 10px; /* Reduce padding further */
        max-width: 95%; /* Make sure it fits within narrow screens */
    }

    .alert-icon {
        width: 20px;
        height: 20px; /* Further reduce icon size */
    }
}
