/**
 * Top Bar (Marquee) — Pure CSS
 */

/* ── Container ── */
.sh-topbar {
    background: var(--pi-primary, #007d3d);
    color: #fff;
    font-size: 0.75rem;
    position: relative;
    margin-top: -1px;
    flex-shrink: 0;
}

.sh-topbar__inner {
    display: flex;
    align-items: center;
}

/* ── Marquee Area ── */
.sh-topbar__marquee-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 0.625rem 0;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

@media (min-width: 768px) {
    .sh-topbar {
        font-size: 0.875rem;
    }
    .sh-topbar__marquee-wrap {
        padding: 0.375rem 0;
    }
}

.sh-topbar__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0 0.75rem;
    white-space: nowrap;
}

.sh-topbar__item-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ── Marquee Animation ── */
.sh-marquee-track {
    display: flex;
    overflow: hidden;
    user-select: none;
    gap: 0;
    font-weight: 500;
}

.sh-marquee-content {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-start;
    min-width: max-content;
    animation: sh-scroll-marquee 25s linear infinite;
    will-change: transform;
}

@keyframes sh-scroll-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.sh-topbar:hover .sh-marquee-content {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .sh-marquee-content { animation-duration: 60s; }
}

/* ── Right Actions (desktop) ── */
.sh-topbar__actions {
    display: none;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .sh-topbar__actions {
        display: flex;
    }
}

/* ── Search ── */
.sh-topbar__search {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    transition: all 0.2s;
    width: 10rem;
    border: 1px solid transparent;
}

@media (min-width: 1024px) {
    .sh-topbar__search {
        width: 14rem;
    }
}

.sh-topbar__search:focus-within {
    background: #fff;
}

.sh-topbar__search-input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.75rem;
    color: #fff;
    padding: 0 0.5rem;
    font-weight: 500;
}

.sh-topbar__search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.sh-topbar__search:focus-within .sh-topbar__search-input {
    color: var(--pi-text, #1e293b);
}

.sh-topbar__search:focus-within .sh-topbar__search-input::placeholder {
    color: var(--pi-text-muted, #64748b);
}

.sh-topbar__search-btn {
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.125rem;
    transition: color 0.2s;
}

.sh-topbar__search:focus-within .sh-topbar__search-btn {
    color: var(--pi-primary, #007d3d);
}

.sh-topbar__search-icon {
    width: 0.875rem;
    height: 0.875rem;
}

/* ── CTA Button ── */
.sh-topbar__cta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: #fff;
    color: var(--pi-primary, #007d3d);
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.sh-topbar__cta:hover {
    background: var(--pi-secondary, #ffb703);
    color: var(--pi-primary, #007d3d);
}

.sh-topbar__cta-icon {
    width: 0.875rem;
    height: 0.875rem;
}

/* ── Dark Mode ── */
.dark .sh-topbar {
    background: var(--pi-bg-elevated, #334155);
    border-bottom: 1px solid var(--pi-border, #334155);
    color: var(--pi-secondary, #fcd34d);
}

.dark .sh-topbar__search {
    background: var(--pi-bg-card, #1e293b);
    border-color: var(--pi-border, #334155);
}

.dark .sh-topbar__search-input {
    color: var(--pi-text-2, #cbd5e1);
}

.dark .sh-topbar__search-input::placeholder {
    color: var(--pi-text-muted, #64748b);
}

.dark .sh-topbar__search:focus-within {
    background: var(--pi-bg-elevated, #334155);
}

.dark .sh-topbar__search:focus-within .sh-topbar__search-input {
    color: var(--pi-text, #f1f5f9);
}

.dark .sh-topbar__search-btn {
    color: var(--pi-text-muted, #64748b);
}

.dark .sh-topbar__cta {
    background: var(--pi-primary, #007d3d);
    color: #fff;
}

.dark .sh-topbar__cta:hover {
    background: var(--pi-secondary, #fcd34d);
    color: var(--pi-text, #1e293b);
}
