/* ============================================================
   IKHAYALAMI — MARKET INTELLIGENCE CAROUSEL
   market-intelligence.css
   
   Self-contained styles for the MI carousel widget.
   Mounted inside .ps-intel-card in psRight0 (Scene 1).
   CSS variables --mi-accent / --mi-bg / --mi-text are set
   inline by market-intelligence.js per category selection.
   ============================================================ */

/* ── Shell ─────────────────────────────────────────────────── */
.mi-shell {
    --mi-accent: #F58220;
    --mi-bg: #FFF7ED;
    --mi-text: #7C2D12;
    --mi-radius: 14px;
    --mi-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --mi-speed: 0.38s;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    border-radius: var(--mi-radius);
    background: white;
    border: 1.5px solid rgba(0,0,0,0.06);
    box-shadow: var(--mi-shadow);
    overflow: hidden;
    font-family: inherit;
}

/* ── Header ─────────────────────────────────────────────────── */
.mi-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px 10px;
    background: var(--mi-bg);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mi-header-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--mi-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.mi-header-meta {
    flex: 1;
    min-width: 0;
}

.mi-header-eyebrow {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mi-accent);
    line-height: 1;
    margin-bottom: 2px;
}

.mi-header-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1A1D20;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mi-counter-pill {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--mi-text);
    background: var(--mi-bg);
    border: 1.5px solid var(--mi-accent);
    border-radius: 20px;
    padding: 2px 8px;
    letter-spacing: 0.04em;
}

/* ── Stage & Track ──────────────────────────────────────────── */
.mi-stage {
    position: relative;
    overflow: hidden;
    min-height: 130px;
}

.mi-track {
    position: relative;
    width: 100%;
    min-height: 130px;
}

/* ── Slides ─────────────────────────────────────────────────── */
.mi-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    pointer-events: none;
    transition: opacity var(--mi-speed) cubic-bezier(0.25, 1, 0.5, 1), transform var(--mi-speed) cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateX(28px);
    will-change: opacity, transform;
}

.mi-slide--active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    pointer-events: auto;
    transform: translateX(0);
}

.mi-slide--exit-left,
.mi-slide--exit-right {
    visibility: visible;
    z-index: 1;
}

.mi-slide--enter-right {
    opacity: 0;
    transform: translateX(28px);
}

.mi-slide--enter-left {
    opacity: 0;
    transform: translateX(-28px);
}

.mi-slide--exit-left {
    opacity: 0;
    transform: translateX(-28px);
}

.mi-slide--exit-right {
    opacity: 0;
    transform: translateX(28px);
}

.mi-slide-inner {
    box-sizing: border-box;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-height: 100%;
}

/* ── Stat headline ──────────────────────────────────────────── */
.mi-stat {
    font-size: 1.08rem;
    font-weight: 900;
    color: var(--mi-accent);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

/* ── Body copy ──────────────────────────────────────────────── */
.mi-body {
    font-size: 0.77rem;
    color: #374151;
    line-height: 1.58;
    font-weight: 400;
    margin: 0;
}

    .mi-body strong {
        color: var(--mi-accent);
        font-weight: 700;
    }

/* ── Progress bar ───────────────────────────────────────────── */
.mi-progress-track {
    height: 3px;
    background: rgba(0,0,0,0.06);
    overflow: hidden;
}

.mi-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--mi-accent);
    transition: width 6s linear;
    transform-origin: left;
}

/* ── Footer: dots + controls ────────────────────────────────── */
.mi-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 10px;
    background: #FAFAFA;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Dots */
.mi-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 120px;
}

.mi-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.mi-dot--active {
    background: var(--mi-accent);
    width: 16px;
    border-radius: 3px;
}

.mi-dot:hover:not(.mi-dot--active) {
    background: rgba(0,0,0,0.3);
}

/* Controls */
.mi-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mi-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1.5px solid rgba(0,0,0,0.10);
    background: white;
    color: #4B5563;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

    .mi-btn:hover {
        background: var(--mi-bg);
        color: var(--mi-accent);
        border-color: var(--mi-accent);
        transform: scale(1.08);
    }

    .mi-btn:active {
        transform: scale(0.95);
    }

.mi-btn-play {
    background: var(--mi-accent);
    color: white;
    border-color: var(--mi-accent);
}

    .mi-btn-play:hover {
        background: var(--mi-accent);
        color: white;
        opacity: 0.88;
        border-color: var(--mi-accent);
    }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .mi-stage,
    .mi-track {
        min-height: 150px;
    }

    .mi-stat {
        font-size: 1rem;
    }

    .mi-body {
        font-size: 0.74rem;
    }

    .mi-dots {
        max-width: 80px;
    }

    .mi-dot {
        width: 5px;
        height: 5px;
    }

    .mi-dot--active {
        width: 12px;
    }
}
/* ============================================================
   CAROUSEL HEIGHT & CENTERING FIX
   Prevents text truncation and centers content dynamically.
   ============================================================ */

/* 1. Increase the track and stage height by 15px */
.mi-stage,
.mi-track {
    min-height: 145px !important;
}

/* 2. Force the inner slide to fill the height and center content vertically */
.mi-slide-inner {
    height: 100% !important;
    justify-content: center !important;
    padding-bottom: 16px !important; /* Slight padding tweak for breathing room at the bottom */
}

/* 3. Mobile height adjustment (ensure it scales up slightly for narrower screens) */
@media (max-width: 768px) {
    .mi-stage,
    .mi-track {
        min-height: 165px !important; /* Increased from 150px to 165px */
    }
}
