/* ── Power Strip (frontend) ──────────────────────────────────── */

/* Homepage only: collapse the 30px gap the theme adds (.widget:not(:last-child))
   between the tickertape widget and the Power Strip when they sit together in
   the sticky header. Scoped to the widget directly above the strip. */
body.home .widget:has(+ .mwb-power-strip) {
    margin-bottom: 0;
}

.mwb-power-strip {
    display: flex;
    width: 100%;
    height: 48px;
    overflow: visible;
    background: linear-gradient(to right, #00A69D, rgba(0, 166, 157, 0.10)), #000;
}

.mwb-power-strip__label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 14px;
    margin: 6px 8px 6px 4px;
    background: #fff;
    border-radius: 20px;
}

.mwb-power-strip__label img {
    height: 28px;
    width: auto;
    vertical-align: middle;
    position: relative;
    top: 1px;
}

.mwb-power-strip__label-mobile {
    display: none;
}

.mwb-power-strip__scroll {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.mwb-power-strip__track {
    display: flex;
    white-space: nowrap;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    align-items: center;
    will-change: transform;
    animation: mwb-strip-scroll 25s linear infinite;
}

.mwb-power-strip:hover .mwb-power-strip__track {
    animation-play-state: paused;
}

.mwb-power-strip__content {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 0 60px;
    letter-spacing: 0.07px;
}

.mwb-power-strip__content a {
    color: #fff;
    text-decoration: none;
}

.mwb-power-strip__content a:hover {
    text-decoration: underline;
}

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

/* ── Headline separator (dynamic mode) ────────────────────── */

.mwb-power-strip__separator {
    display: inline-block;
    margin: 0 24px;
    opacity: 0.4;
    font-size: 10px;
    vertical-align: middle;
}

/* ── Vertical slide-down direction ────────────────────────── */

.mwb-power-strip__track--vertical {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    white-space: normal;
    animation: none;
    transition: transform 0.5s ease;
}

.mwb-power-strip[data-direction="vertical"] .mwb-power-strip__content {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.mwb-power-strip[data-direction="vertical"] .mwb-power-strip__content a {
    display: block;
    height: 48px;
    line-height: 48px;
    padding: 0 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mwb-power-strip[data-direction="vertical"] .mwb-power-strip__separator {
    display: none;
}

.mwb-power-strip__action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    background: transparent;
    position: relative;
    overflow: visible;
}

.mwb-power-strip__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #00A69D;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.2s, width 0.3s ease;
}

.mwb-strip-slide {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mwb-strip-slide--out {
    transform: translateY(-100%);
    opacity: 0;
}

.mwb-strip-slide--in {
    transform: translateY(0);
    animation: mwb-slide-in 0.2s ease forwards;
}

@keyframes mwb-slide-in {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mwb-power-strip__btn:disabled {
    background: #888;
    opacity: 0.7;
    cursor: default;
    pointer-events: none;
}

.mwb-power-strip__btn:hover:not(:disabled) {
    background: #03bfb5;
}

.mwb-power-strip__btn svg {
    flex-shrink: 0;
}

/* ── Power Strip responsive ────────────────────────────────── */

@media (max-width: 575px) {
    .mwb-power-strip {
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
    }

    /* Scrolling text full width on top */
    .mwb-power-strip__scroll {
        order: -1;
        flex: 0 0 100%;
        height: 32px;
        position: relative;
        overflow: hidden;
    }

    .mwb-power-strip__content {
        font-size: 13px;
        padding: 0 12px;
        letter-spacing: 0.2px;
    }

    /* Logo and button side by side below scroll */
    .mwb-power-strip__label {
        flex: 0 0 auto;
        padding: 6px 12px;
        justify-content: center;
        background: none;
        border-radius: 0;
        margin: 0;
    }

    .mwb-power-strip__label-desktop {
        display: none;
    }

    .mwb-power-strip__label-mobile {
        display: block;
        height: 22px;
        width: auto;
        filter: brightness(0) invert(1);
    }

    .mwb-power-strip__action {
        flex: 1 1 0;
        padding: 6px 12px;
        justify-content: flex-end;
    }

    .mwb-power-strip__btn {
        justify-content: center;
        padding: 6px 14px;
        font-size: 12px;
    }

    /* Vertical: hide scrolling section on mobile */
    .mwb-power-strip[data-direction="vertical"] .mwb-power-strip__scroll {
        display: none;
    }
}

/* ── Loading spinner ───────────────────────────────────────── */

@keyframes mwb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mwb-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mwb-spin 0.6s linear infinite;
    vertical-align: middle;
}

.mwb-watchlist-btn .mwb-spinner {
    border-color: rgba(0, 166, 157, 0.3);
    border-top-color: #00A69D;
}

.mwb-adding {
    opacity: 0.8;
    cursor: wait !important;
    pointer-events: none;
}

/* ── Power strip dropdown (already watching) ──────────────── */

.mwb-strip-dropdown-wrap {
    position: relative;
    display: inline-flex;
}

.mwb-strip-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #1a1a2e;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    z-index: 10;
}

.mwb-strip-dropdown::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #fff;
}

.mwb-strip-dropdown:hover {
    background: #cff4e7;
    color: #00A69D;
}

.mwb-strip-dropdown-wrap:hover .mwb-strip-dropdown {
    display: block;
}

/* ── Watchlist buttons ──────────────────────────────────────── */

.mwb-watchlist-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 6px;
}

.mwb-watchlist-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #00A69D;
    margin-right: 4px;
}

.mwb-watchlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mwb-watchlist-btn:hover {
    border-color: #00A69D;
    color: #00A69D;
}

.mwb-watchlist-btn.mwb-watching {
    background: #00A69D;
    color: #fff;
    border-color: #00A69D;
}

.mwb-watchlist-btn.mwb-watching:hover {
    background: #9b001c;
    border-color: #9b001c;
}

/* ── Modal overlay ──────────────────────────────────────────── */

.mwb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: background 0.3s ease;
}

.mwb-modal-overlay.is-visible {
    background: rgba(0, 0, 0, 0.55);
}

/* ── Modal box ──────────────────────────────────────────────── */

.mwb-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.mwb-modal-overlay.is-visible .mwb-modal {
    transform: translateY(0);
    opacity: 1;
}

.mwb-modal h3 {
    margin: 0 0 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 21px;
    font-weight: 700;
    white-space: nowrap;
    color: #1a1a1a;
}

.mwb-modal p {
    margin: 0 0 22px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.mwb-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.mwb-modal-close:hover {
    color: #333;
}

/* ── Modal header icon ──────────────────────────────────────── */

.mwb-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: #cff4e7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Modal logo ──────────────────────────────────────────────── */

.mwb-modal__logo {
    text-align: center;
    margin: 0 auto 20px;
}

.mwb-modal__logo img {
    max-width: 200px;
    height: auto;
}

/* ── Modal footer text ──────────────────────────────────────── */

.mwb-modal__footer {
    margin: 20px 0 0 !important;
    font-size: 11px !important;
    color: #999 !important;
    line-height: 1.4 !important;
}

/* ── Buttons container ──────────────────────────────────────── */

.mwb-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mwb-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.mwb-modal-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* ── LinkedIn button ────────────────────────────────────────── */

.mwb-btn-linkedin {
    background: #0077b5;
    color: #fff;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 119, 181, 0.3);
}

.mwb-btn-linkedin:hover {
    background: #006097;
    color: #fff;
}

.mwb-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mwb-btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

/* ── Divider ────────────────────────────────────────────────── */

/* ── Success modal ──────────────────────────────────────────── */

.mwb-modal--success .mwb-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    background: #cff4e7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #00A69D;
    font-weight: bold;
    line-height: 1;
    border: 2px solid #cff4e7;
}

.mwb-modal--success h3 {
    color: #00A69D;
}

.mwb-btn-watchlist {
    background: #00A69D;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 166, 157, 0.3);
}

.mwb-btn-watchlist:hover {
    background: #03bfb5;
    color: #fff;
}

/* ── Already watching modal ────────────────────────────────── */

.mwb-modal--already-watching .mwb-already-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    background: #fff3cd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #e6a817;
    font-weight: bold;
    line-height: 1;
    border: 2px solid #fff3cd;
}

.mwb-modal--already-watching h3 {
    color: #e6a817;
}

/* ── Entity chooser modal (multiple companies/commodities) ──── */

.mwb-modal--chooser h3 {
    white-space: normal;
}

.mwb-chooser-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.mwb-chooser-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.mwb-chooser-item:hover {
    border-color: #00A69D;
    background: #f3fbfa;
    transform: translateY(-1px);
}

.mwb-chooser-item__name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.mwb-chooser-item__type {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #00A69D;
    background: #e6f7f5;
    padding: 3px 8px;
    border-radius: 999px;
}

/* Already-watching rows: static (non-clickable), muted, brand-coloured tag. */
.mwb-chooser-item--watching {
    cursor: default;
    background: #f6f8f9;
    border-color: #e3e6ea;
}

.mwb-chooser-item--watching:hover {
    transform: none;
    border-color: #e3e6ea;
    background: #f6f8f9;
}

.mwb-chooser-item--watching .mwb-chooser-item__name {
    color: #6b7280;
}

.mwb-chooser-item__watching {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #00A69D;
}

/* ── Modal responsive ──────────────────────────────────────── */

@media (max-width: 480px) {
    .mwb-modal-overlay {
        align-items: center;
    }

    .mwb-modal {
        width: 92%;
        max-width: 400px;
        border-radius: 12px;
        padding: 28px 20px 24px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .mwb-modal-overlay.is-visible .mwb-modal {
        transform: translateY(0);
    }

    .mwb-modal h3 {
        font-size: 18px;
    }

    .mwb-modal p {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .mwb-modal__icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .mwb-modal__icon svg {
        width: 26px;
        height: 26px;
    }

    .mwb-modal-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .mwb-modal-close {
        top: 10px;
        right: 14px;
        font-size: 24px;
    }

    .mwb-modal--success .mwb-success-icon {
        width: 52px;
        height: 52px;
        font-size: 26px;
    }
}
