﻿.announcement-box {
    position: relative;
    /* Responsive width */
    width: 100%;
    max-width: 650px;
    /* Responsive height */
    min-height: clamp(140px, 25vh, 220px);
    margin: 0 auto;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    border-radius: 16px;
    overflow: hidden;
    background-image: linear-gradient( rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25) ), url('/assets/rmassets/announcements-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: attentionShake 4s infinite;
}

@keyframes attentionShake {
    /* Stay still most of the time */
    0%, 90%, 100% {
        transform: translateX(0);
    }

     
    /* Quick vibration */
    91% {
        transform: translateX(-2px);
    }

    92% {
        transform: translateX(2px);
    }

    93% {
        transform: translateX(-2px);
    }

    94% {
        transform: translateX(2px);
    }

    95% {
        transform: translateX(-1px);
    }

    96% {
        transform: translateX(1px);
    }

    97% {
        transform: translateX(0);
    }
}

.announcement-title-container {
    text-align: center;
    overflow: hidden;
}

.announcement-title {
    position: relative;
    display: inline-block;
    color: #3d6fb6;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    overflow: hidden;
}

    /* Sparkle sweep */
    .announcement-title::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 40%;
        height: 100%;
        background: linear-gradient( 90deg, transparent, rgba(255,255,255,.9), transparent );
        transform: skewX(-25deg);
        animation: sparkleSweep 2s infinite;
    }

    /* Random sparkle points */
    .announcement-title::after {
        content: '✦';
        position: absolute;
        top: -5px;
        right: -15px;
        color: gold;
        font-size: 0.8rem;
        animation: sparkleBlink 1.5s infinite;
    }

@keyframes sparkleSweep {
    0% {
        left: -100%;
    }

    100% {
        left: 120%;
    }
}

@keyframes sparkleBlink {
    0%, 100% {
        opacity: 0;
        transform: scale(.5) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg);
    }
}

.announcement-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.6;
    color: #4b5f7f; /* blue-gray */
    text-align: center;
    animation: announcementFade 1s ease;
}

@keyframes announcementFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

.announcement-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #d0d0d0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
}

    .dot:hover {
        background-color: #999;
    }

    .dot.active {
        background-color: #0d6efd;
        transform: scale(1.2);
        background: #f4d03f;
    }

/* Mobile */
@media (max-width: 768px) {
    .announcement-box {
        width: 95%;
        min-height: 140px;
        padding: 0.75rem;
        border-radius: 12px;
    }

    .announcement-title {
        letter-spacing: normal;
    }

     
    .announcement-title {
        font-size: 1rem;
    }

     
    .announcement-text {
        font-size: 0.9rem;
    }

    @keyframes titleBounce {
        0%, 100% {
            transform: translateY(0);
        }

        20% {
            transform: translateY(-5px);
        }

        40% {
            transform: translateY(0);
        }

        60% {
            transform: translateY(-2px);
        }
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .announcement-box {
        width: 70%;
        max-width: 700px;
        min-height: 220px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .announcement-box {
        width: 85%;
        min-height: 180px;
    }
}
