/* ==============================
   Announcement Bar
============================== */
.announcement-bar {
    display: flex;
    align-items: center;
    background: #fff3cd;
    border: 2px solid #ffcc00;
    padding: 10px 15px;
    margin: 15px 0;
    font-family: Arial, sans-serif;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    
}

/* ==============================
   Fixed label
============================== */
.announcement-label {
    font-weight: bold;
    color: #856404;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==============================
   Fixed title
============================== */
.announcement-title {
    font-weight: bold;
    color: #000;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* ==============================
   Marquee container
============================== */
.announcement-marquee {
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    min-width: 0;
    height: 26px;

    /* JS will inject actual width here */
    --marquee-width: 0px;
}

/* ==============================
   Auto-width ping-pong marquee
============================== */
.announcement-text {
    position: absolute;
    left: 0;
    white-space: nowrap;
    font-weight: 500;
    color: #333;

    animation-name: scroll-left-right;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: alternate;

    /* JS will set this */
    animation-duration: var(--marquee-duration, 10s);
}


.announcement-text a {
    color: inherit;
    text-decoration: none;
}

/* Pause animation on hover */
.announcement-marquee:hover .announcement-text {
    animation-play-state: paused;
}

/* ==============================
   Gradient fade edges
============================== */
.announcement-marquee::before,
.announcement-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.announcement-marquee::before {
    left: 0;
    background: linear-gradient(
        to right,
        #fff3cd 0%,
        rgba(255, 243, 205, 0) 100%
    );
}

.announcement-marquee::after {
    right: 0;
    background: linear-gradient(
        to left,
        #fff3cd 0%,
        rgba(255, 243, 205, 0) 100%
    );
}

/* ==============================
   TRUE auto-width animation
============================== */
@keyframes scroll-left-right {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(var(--marquee-width));
    }
}

/* ==============================
   View All Notices button
============================== */
.announcement-all {
    flex-shrink: 0;
    margin-left: 15px;
    position: relative;
    z-index: 2;
}

.announcement-all a {
    font-weight: bold;
    color: #003366;
    text-decoration: none;
    white-space: nowrap;
    padding: 5px 10px;
    border: 1px solid #003366;
    border-radius: 4px;
    background: #ffffff;
    animation: notice-pulse 2s ease-in-out infinite;
}

.announcement-all a:hover {
    background: #003366;
    color: #ffffff;
    animation: none;
}

/* ==============================
   Pulse animation
============================== */
@keyframes notice-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 51, 102, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(0, 51, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 51, 102, 0);
    }
}

/* ==============================
   Page heading animation
============================== */
.nam {
    text-align: center;
    margin: 30px 0 20px;
}

.nam p {
    font-size: 28px;
    font-weight: bold;
    color: #003366;
    position: relative;
    display: inline-block;
    animation: noticeFadeSlide 1.2s ease-out forwards;
}

.nam p::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 0;
    height: 3px;
    background: #ffcc00;
    transform: translateX(-50%);
    animation: underlineGrow 1s ease-out forwards;
    animation-delay: 0.6s;
}

@keyframes noticeFadeSlide {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes underlineGrow {
    from {
        width: 0;
    }
    to {
        width: 80%;
    }
}
