/* Banner styles */
.banner {
    display: none;
    background-color: #f8d32d;
    color: #333;
    text-align: center;
    padding: 10px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 14px;
    box-sizing: border-box;
}

.banner-content {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-left 20s linear infinite;
}

.banner:hover {
    background-color: #ffe056;
}

.banner:hover .banner-content {
    animation-play-state: paused;
}

.banner a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Popup styles */
#popupModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1200;
    overflow-y: auto;
}

#popupContent {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

#popupClose {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 24px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background-color: #f0f0f0;
    border-radius: 50%;
}

/* CSS fallback for banner visibility */
body.has-banner {
    padding-top: 40px; /* Adjust this value based on your banner's expected height */
}

body.has-banner .banner {
    display: block;
}

/* Adjustments for fixed elements when banner is present */
body.has-banner .fixed-top,
body.has-banner .sticky-top {
    top: 40px; /* Adjust this value to match the padding-top on body.has-banner */
}

@media (max-width: 768px) {
    .banner {
        font-size: 12px;
        padding: 8px;
        height: auto;
        max-height: 60px; /* Adjust this value as needed */
        overflow: hidden;
    }

    .banner-content {
        white-space: normal;
        animation: none;
        display: -webkit-box;
        -webkit-line-clamp: 3; /* Adjust this value to show more or fewer lines */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #popupContent {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }

    #popupClose {
        font-size: 20px;
        width: 25px;
        height: 25px;
        line-height: 25px;
    }
}