
.font-cursive{
    font-family: 'Sofia', cursive;
}
.font-poppins{
    font-family: 'Poppins', sans-serif;
}

.announcement-modal-wrapper{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default, shown after window load between 1-3 seconds */
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.announcement-modal {
    width: clamp(200px, 800px, 90vw);
    height: clamp(150px, 500px, 80vh);
    background: white;
    border-radius: 15px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1002;
    position: relative;
    opacity: 0;
    animation: animation-slide-up 700ms ease-in-out forwards;
}

.announcement-modal img {
    height: 100%;
    border-radius: 10px;
    animation: animate-opacity 1s ease-in-out forwards;
    flex-shrink: 0;
}

/* Image Slider */
.announcement-image-slider {
    position: relative;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Desktop: keep image at sensible width beside text */
@media (min-width: 769px) {
    .announcement-image-slider {
        flex: 0 0 45%;
        max-width: 45%;
        height: auto;
        min-width: 0;
    }

    .announcement-modal-texts {
        flex: 1 1 55%;
        padding-left: 8px;
    }
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix for Safari: allow flex children to shrink and prevent overflowing */
.announcement-image-slider,
.slider-container {
    min-width: 0;
    min-height: 0;
}

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    opacity: 1;
    transform: translateX(0);
    display: block;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    -webkit-object-fit: cover;
}

/* Safari compatibility: ensure object-fit works and image doesn't overflow */
.slider-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    -webkit-object-fit: cover;
    object-fit: cover;
}

.slider-image.slide-in {
    animation: slide-in-image 0.8s ease-in-out forwards;
}

.slider-image.slide-out {
    animation: slide-out-image 0.8s ease-in-out forwards;
}

@keyframes slide-in-image {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-out-image {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
    }
}

.announcement-modal-texts {
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    flex: 1;
    padding-right: 0;
    margin-right: 0;
}

/* Custom Scrollbar - Mobile Only */
@media (max-width: 768px) {
    /* Custom Scrollbar */
    .announcement-modal-texts::-webkit-scrollbar {
        width: 6px;
    }

    .announcement-modal-texts::-webkit-scrollbar-track {
        background: transparent;
    }

    .announcement-modal-texts::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }

    .announcement-modal-texts::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    /* Firefox Scrollbar */
    .announcement-modal-texts {
        scrollbar-width: thin;
        scrollbar-color: #888 transparent;
    }
}

/* Desktop - Hide Scrollbar */
@media (min-width: 769px) {
    .announcement-modal-texts {
        scrollbar-width: none;
    }

    .announcement-modal-texts::-webkit-scrollbar {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .announcement-modal {
        flex-direction: column;
        width: 90vw;
        height: auto;
        max-height: 90vh;
        overflow: hidden;
    }

    .announcement-modal img {
        height: 350px;
        width: 100%;
        object-fit: contain;
    }

    .announcement-modal .close-modal {
        width: 30px;
        height: 30px;
    }

    .announcement-modal-texts {
        max-height: 300px;
        overflow-y: auto;
    }
}

.announcement-modal-texts .schedule {
    font-size: 14px;
    color: #525252;
}

.announcement-modal-texts .conclusion {
    font-size: 12px;
    font-style: italic;
}

.announcement-modal-texts * {
    opacity: 0;
    animation: animation-slide-up 700ms ease-in-out forwards;
}

.announcement-modal-texts *:nth-child(1) {
    animation-delay: 0ms;
}

.announcement-modal-texts *:nth-child(2) {
    animation-delay: 200ms;
}

.announcement-modal-texts *:nth-child(3) {
    animation-delay: 400ms;
}

.announcement-modal-texts *:nth-child(n+4) {
    animation-delay: 600ms;
}

.announcement-modal .close-modal {
    position: absolute;
    top: 0px;
    right: 0px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0px 0px 0px 20px;
    padding-left: 5px;
    padding-bottom: 5px;
    transition: 200ms ease;
}

.announcement-modal .close-modal:hover {
    background: #ff585820;
    color: #ff5858;
}

.announcement-text marquee {
    font-family: 'Sofia', cursive;
    color: #ad0002;
    font-size: 1.2rem;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

/* Floating open modal button */
.open-announcement-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 2000;
    font-size: 20px;
    overflow: hidden;
}

.open-announcement-btn img {
    width: 140%;
    height: 140%;
    translate: -5% -5%;
    object-fit: cover;
}

.open-announcement-btn:hover {
    transform: translateY(-2px);
}

.open-announcement-btn:focus {
    outline: 2px solid rgba(255,255,255,0.6);
}

@keyframes animation-slide-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes animate-opacity {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}