/**
 * Global Notification Bar Styles
 * Matches Figma design: Blue notification bar with dismissable functionality
 */

.global-notification-bar {
    background-color: #005ead;
    color: #ffffff;
    padding: 12px 40px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000; /* Higher than header */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.global-notification-bar.is-visible {
    opacity: 1;
}

.global-notification-bar.is-dismissing {
    opacity: 0;
}

/* Push header down when notification is visible */
.global-notification-bar.is-visible ~ #header,
.global-notification-bar.is-visible ~ header {
    top: 42px; /* Height of notification bar (12px + 12px padding + ~18px content) */
    transition: top 0.3s ease-in-out;
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .global-notification-bar.is-visible ~ #header,
    .global-notification-bar.is-visible ~ header {
        top: auto; /* Mobile notification layout is taller, use auto or calculate */
    }
}

.global-notification-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    padding-left: 80px; /* Balance the close button on the right */
    padding-right: 80px; /* Make room for close button */
}

.global-notification-content {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Message text */
.global-notification-message {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 17.6px;
    color: #ffffff;
}

/* Learn More link */
.global-notification-link {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 17.6px;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: opacity 0.2s ease;
}

.global-notification-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2px;
    background-color: #62b9cc;
    transition: background-color 0.2s ease;
}

.global-notification-link:hover,
.global-notification-link:focus {
    color: #fff;
}

.global-notification-link:hover::after,
.global-notification-link:focus::after {
    background-color: #ffffff;
}

.global-notification-link:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Close button */
button.global-notification-close {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 10px 12px !important;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 18px;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.global-notification-close:hover {
    opacity: 0.8;
}

.global-notification-close:focus {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
    opacity: 1;
}

.global-notification-close-text {
    display: inline-block;
}

.global-notification-close-icon {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .global-notification-bar {
        padding: 12px 20px;
    }

    .global-notification-container {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding-left: 0; /* Remove left padding on mobile */
        padding-right: 0; /* Remove right padding on mobile */
        gap: 8px;
    }

    button.global-notification-close {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        align-self: flex-end;
        order: -1; /* Put button above content */
    }

    .global-notification-content {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .global-notification-bar {
        padding: 10px 16px;
    }

    .global-notification-tag,
    .global-notification-message {
        font-size: 14px;
        line-height: 16px;
    }

    .global-notification-link {
        font-size: 13px;
        line-height: 16px;
    }

    .global-notification-close {
        font-size: 13px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .global-notification-link::after {
        height: 3px;
    }

    .global-notification-close:focus,
    .global-notification-link:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .global-notification-bar,
    .global-notification-link,
    .global-notification-close {
        transition: none;
    }
}

/* Print styles */
@media print {
    .global-notification-bar {
        display: none !important;
    }
}
