.banner {
    position: relative; /* Required for close button positioning */
    margin: 5px 0;
    padding: 15px 40px 15px 15px; /* Add space for the close button */
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.5;
    text-align: center;
}

/* Default banner styles for light mode (already included in your CSS) */
.banner.info {
    background-color: #e0f7fa;
    color: #4051b5;
    border: 1px solid #4051b5;
}

.banner.warning {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #e65100;
}

.banner.error {
    background-color: #ffebee;
    color: #b71c1c;
    border: 1px solid #b71c1c;
}

.banner p {
    font-size: 18px;
    margin: 0; /* Remove default margins */
    white-space: pre-wrap; /* Preserve whitespace and line breaks */
}

.banner p.important {
    font-size: 22px;
    font-weight: bold;
    color: #d32f2f; /* Highlighted color for important announcements */
    margin: 0; /* Remove default margins */
    white-space: pre-wrap; /* Preserve whitespace and line breaks */
}

.banner p.subtle {
    font-size: 16px;
    color: #757575; /* Subtle color for less critical announcements */
    margin: 0; /* Remove default margins */
    white-space: pre-wrap; /* Preserve whitespace and line breaks */
}

.banner .close-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: inherit;
    cursor: pointer;
}

.banner .close-btn:hover {
    color: #000;
}

/* Dark mode banner styles */
body[data-md-color-scheme="slate"] .banner.info {
    background-color: #1E272E;
    color: #ffebee;
    border: 1px solid #a7ffeb;
}

body[data-md-color-scheme="slate"] .banner.warning {
    background-color: #2b4155;
    color: #ffebee;
    border: 1px solid #ffccbc;
}

body[data-md-color-scheme="slate"] .banner.error {
    background-color: #005b94;
    color: #ffebee;
    border: 1px solid #ffebee;
}

/* Adjust text emphasis in dark mode */
body[data-md-color-scheme="slate"] .banner p.important {
    color: #e94560;
}

body[data-md-color-scheme="slate"] .banner p.subtle {
    color: #546c83;
}

/* Ensure close button is visible in dark mode */
body[data-md-color-scheme="slate"] .banner .close-btn {
    color: #ffffff;
}

body[data-md-color-scheme="slate"] .banner .close-btn:hover {
    color: #ffccbc;
}

@media (max-width: 768px) {
    .banner {
        font-size: 16px; /* Slightly smaller font on smaller screens */
        padding: 10px; /* Reduce padding for better fit */
        margin: 0; /* Remove default margins */
        white-space: pre-wrap; /* Preserve whitespace and line breaks */
    }

    .banner p.important {
        font-size: 18px;
        margin: 0; /* Remove default margins */
        white-space: pre-wrap; /* Preserve whitespace and line breaks */
    }

    .banner p.subtle {
        font-size: 14px;
        margin: 0; /* Remove default margins */
        white-space: pre-wrap; /* Preserve whitespace and line breaks */
    }
}

.banner:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add a shadow on hover */
    cursor: pointer; /* Indicate interactivity */
}

#announcement-banner {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Add spacing between banners */
}
