/**
 * JB TopBar CSS
 */

.jb-topbar {
    position: relative;
    width: 100%;
    text-align: center;
    line-height: 1.4;
    z-index: 1000;
    overflow: hidden;
}

.jb-topbar a {
    color: inherit;
    text-decoration: underline;
}

.jb-topbar a:hover {
    opacity: 0.8;
}

/* Version statique */
.jb-topbar-static {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Version container */
.jb-topbar-container {
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Version défilante */
.jb-topbar-scroll .jb-topbar-track {
    display: flex;
    width: max-content;
}

.jb-topbar-scroll .jb-topbar-content {
    display: flex;
    animation: jb-scroll var(--scroll-speed, 20s) linear infinite;
}

.jb-topbar-scroll .jb-topbar-text {
    white-space: nowrap;
    padding-right: 100px;
}

/* Animation pause au survol */
.jb-topbar-scroll:hover .jb-topbar-content {
    animation-play-state: paused;
}

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

/* Bouton fermer */
.jb-topbar-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.jb-topbar-close:hover {
    opacity: 1;
}

/* Animation fermeture */
.jb-topbar.jb-topbar-closing {
    animation: jb-slideUp 0.3s ease-out forwards;
}

@keyframes jb-slideUp {
    from {
        max-height: 100px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Responsive */
@media (max-width: 767px) {
    .jb-topbar {
        font-size: 12px !important;
    }
    
    .jb-topbar-close {
        right: 5px;
    }
}

/* Mode sticky */
.jb-topbar-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* Placeholder pour éviter le saut de page en mode sticky */
.jb-topbar-placeholder {
    display: none;
}

.jb-topbar-sticky + .jb-topbar-placeholder {
    display: block;
}
