/* MaxRepTracker Announcement Bar */

/* Global MRT Tap Highlight Reset */
[class^="mrt-"],
[class*=" mrt-"] {
    -webkit-tap-highlight-color: transparent;
}

#mrt-announcement-bar {
    width: 100%;
    padding: 5px 0;
    position: relative;
    z-index: 10;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);

    min-height: auto;
    box-sizing: border-box;
    overflow: hidden; /* Ensure sliding content doesn't break layout outside */
}

/* Fallback Fixed Position */
#mrt-announcement-bar.mrt-fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mrt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 100%; /* Fill the fixed height */
    overflow: hidden; /* Clip content within container */
}

/* Content Area */
.mrt-content {
    display: flex;
    align-items: center;
    /* justify-content: center; REMOVED to respect Gutenberg alignment */
    gap: 15px;
    /* Font styles removed to let Gutenberg handle them */
    width: 100%; /* Full width for block content */
    white-space: nowrap; /* Keep all in one line */
    transition:
        transform 0.5s ease-in-out,
        opacity 0.5s ease-in-out;
}

/* Generic Block resets for being inside a bar */
#mrt-announcement-bar .mrt-content * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0;
    line-height: normal; /* Fix for themes that set line-height */
}

#mrt-announcement-bar .mrt-content p,
#mrt-announcement-bar .mrt-content div,
#mrt-announcement-bar .mrt-content span {
    display: inline-block;
}

/* Explicit support for Gutenberg text alignment in flex container */
#mrt-announcement-bar .mrt-content .has-text-align-center {
    margin-left: auto !important;
    margin-right: auto !important;
}
#mrt-announcement-bar .mrt-content .has-text-align-right {
    margin-left: auto !important;
    margin-right: 0 !important;
}
#mrt-announcement-bar .mrt-content .has-text-align-left {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Handle Generic Buttons from Gutenberg */
.mrt-content .wp-block-button {
    margin: 0 0 0 10px;
    display: inline-block;
}

.mrt-content .wp-block-button__link {
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 50px;
}

/* Animations */
.mrt-slide-center {
    opacity: 1;
    transform: translateX(0);
}

.mrt-slide-out-left {
    opacity: 0;
    transform: translateX(-50px);
}

.mrt-slide-in-right {
    opacity: 0;
    transform: translateX(50px);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .mrt-content {
        flex-direction: row; /* Keep row even on mobile for "one line" request */
        flex-wrap: nowrap;
        overflow-x: auto; /* Allow scrolling if too long on mobile */
        justify-content: flex-start; /* Left align if scrolling */
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px; /* Space for scrollbar if visible */
    }

    /* Hide scrollbar */
    .mrt-content::-webkit-scrollbar {
        display: none;
    }

    /* Fixed bottom fallback adjustments */
    #mrt-announcement-bar.mrt-fixed-bottom {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}
