/**
 * Alert Banner Styles
 * 
 * Slim banner that appears at the top of all pages.
 * Fixed styling with WCAG AA compliant colors.
 */

:root {
    --alert-bg-color: #005971;
    --alert-text-color: #ffffff;
}

.alert-banner {
    position: relative;
    width: 100%;
    background-color: var(--alert-bg-color);
    color: var(--alert-text-color);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 14px;
    line-height: 1.5;
}

.alert-banner-container {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.alert-banner-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.alert-message {
    color: var(--alert-text-color);
    font-weight: 400;
}

.alert-link {
    color: var(--alert-text-color);
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.25s ease;
    border-radius: 2rem;
    padding: 0.5rem 0.5rem;
}

.alert-link:hover,
.alert-link:focus {
    background-color: color-mix(in srgb, var(--alert-bg-color) 85%, var(--alert-text-color) 15%);
    color: var(--alert-text-color);
    opacity: 0.95;
    text-decoration: underline;
}

.alert-link:focus {
    outline: none;
}

.alert-arrow-icon {
    width: 1.2em;
    height: 1.2em;
    margin-left: 4px;
    display: inline-flex;
    transition: all 0.25s ease;
}

.alert-arrow-icon path {
    stroke: currentColor;
}

.alert-link:focus .alert-arrow-icon,
.alert-link:hover .alert-arrow-icon {
    margin-left: 8px;
    transition: all 0.25s ease;
}

.alert-close-icon {
    width: 1.2em;
    height: 1.2em;
    display: inline-flex;
}

.alert-close-icon path {
    stroke: currentColor;
}

.alert-dismiss {
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--alert-text-color);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.alert-dismiss:hover {
    background-color: color-mix(in srgb, var(--alert-bg-color) 85%, var(--alert-text-color) 15%);
}

.alert-dismiss:focus {
    outline: 2px solid var(--alert-text-color);
    outline-offset: 2px;
    background-color: color-mix(in srgb, var(--alert-bg-color) 90%, var(--alert-text-color) 10%);
}

.alert-dismiss:active {
    transform: scale(0.95);
}

.alert-dismiss span {
    display: block;
    line-height: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .alert-banner {
        padding: 10px 16px;
        font-size: 13px;
    }

    .alert-banner-container {
        gap: 12px;
    }

    .alert-banner-content {
        gap: 12px;
    }

    .alert-dismiss {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}

/* Animation for alert appearance */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-banner {
    animation: slideDown 0.3s ease-out;
}

/* Animation for alert dismissal */
@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
        max-height: 200px;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
        max-height: 0;
    }
}

.alert-banner.dismissing {
    animation: slideUp 0.3s ease-out forwards;
    overflow: hidden;
}