/* ==========================================================================
   IMungro — Character Album Showcase
   Cinematic 3-column character gallery. Matches the reference design:
   navy scroll-frame nav, gold accents, magenta stat bars, cosmic starfield.
   ========================================================================== */

.im-showcase {
    /* Theming hooks (overridable via widget Style controls) */
    --im-sc-gold: #f2ca50;
    --im-sc-gold-dim: #d4af37;
    --im-sc-glow: #f2ca50;
    --im-sc-stat-a: #c026d3;
    --im-sc-stat-b: #e879f9;
    --im-sc-sky: #0a1128;
    --im-sc-panel: #0e1630;
    --im-sc-text: #e5e2e1;
    --im-sc-text-dim: #d0c5af;

    position: relative;
    display: grid;
    grid-template-columns: 300px 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
    min-height: 640px;
    padding: 0 70px;               /* room for the side arrows */
    color: var(--im-sc-text);
    font-family: 'EB Garamond', Georgia, serif;
    background:
        radial-gradient(circle at 70% 30%, rgba(80, 40, 120, 0.25), transparent 55%),
        radial-gradient(ellipse at 50% 120%, rgba(20, 40, 90, 0.5), transparent 60%),
        var(--im-sc-sky);
    overflow: hidden;
    isolation: isolate;
}

/* Shared starfield sprinkled over the whole element */
.im-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.7), transparent),
        radial-gradient(1px 1px at 28% 68%, rgba(255,255,255,.5), transparent),
        radial-gradient(1.5px 1.5px at 47% 12%, rgba(255,255,255,.8), transparent),
        radial-gradient(1px 1px at 63% 44%, rgba(255,255,255,.5), transparent),
        radial-gradient(1px 1px at 78% 82%, rgba(255,255,255,.6), transparent),
        radial-gradient(1.5px 1.5px at 88% 26%, rgba(255,255,255,.7), transparent),
        radial-gradient(1px 1px at 35% 90%, rgba(255,255,255,.4), transparent),
        radial-gradient(1px 1px at 92% 60%, rgba(255,255,255,.5), transparent);
    opacity: .8;
}

.im-showcase > * { position: relative; z-index: 1; }

/* ==========================================================================
   Side arrows (prev / next character)
   ========================================================================== */
.im-sc-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 4rem;
    line-height: 1;
    color: var(--im-sc-gold);
    text-shadow: 0 0 18px rgba(242, 202, 80, .5);
    transition: color .25s ease, transform .25s ease;
    padding: 0 .2em;
}
.im-sc-arrow:hover { color: #fff; transform: translateY(-50%) scale(1.12); }
.im-sc-prev { left: 6px; }
.im-sc-next { right: 6px; }

/* ==========================================================================
   COLUMN 1 — Navigation / scroll frame
   ========================================================================== */
.im-sc-col-nav { display: flex; justify-content: center; padding: 1.5rem 0; }

.im-sc-scrollframe {
    width: 100%;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px 1.4rem;
    border-radius: 4px 4px 90px 90px / 4px 4px 40px 40px;
    background: linear-gradient(180deg, #0c1330 0%, #0a1026 100%);
    border: 1px solid rgba(242, 202, 80, .25);
    box-shadow: inset 0 0 40px rgba(0,0,0,.5), 0 10px 40px rgba(0,0,0,.4);
}

/* Top BACK banner with scroll rods */
.im-sc-topbar {
    position: relative;
    width: calc(100% + 24px);
    margin: 0 -12px 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.im-sc-back {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    height: 40px;
    padding: 0 26px;
    text-decoration: none;
    letter-spacing: .18em;
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #1a1400;
    background: linear-gradient(180deg, #ffe9a8 0%, var(--im-sc-gold) 45%, var(--im-sc-gold-dim) 100%);
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.6);
}
.im-sc-back-label { position: relative; z-index: 2; }
/* Rod ends of the banner */
.im-sc-back-rod {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 54px;
    transform: translateY(-50%);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffe9a8, var(--im-sc-gold-dim));
    box-shadow: 0 2px 6px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.6);
}
.im-sc-back-rod-l { left: -10px; }
.im-sc-back-rod-r { right: -10px; }

.im-sc-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    color: var(--im-sc-gold);
    font-size: 26px; line-height: 1;
    text-decoration: none;
    border-radius: 50%;
    border: 1px solid rgba(242,202,80,.4);
    transition: background .2s ease, color .2s ease;
}
.im-sc-close:hover { background: var(--im-sc-gold); color: #1a1400; }

/* Circular active portrait */
.im-sc-portrait { margin-bottom: 1rem; }
.im-sc-portrait-ring {
    width: 168px; height: 168px;
    border-radius: 50%;
    padding: 4px;
    background: radial-gradient(circle at 50% 30%, #182349, #0a1026);
    border: 2px solid var(--im-sc-gold);
    box-shadow: 0 0 26px rgba(242, 202, 80, .35), inset 0 0 20px rgba(0,0,0,.6);
    overflow: hidden;
}
.im-sc-portrait-img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 50%;
    display: block;
}

/* Album identity */
.im-sc-album { text-align: center; margin-bottom: 1rem; }
.im-sc-album-icon {
    max-width: 56px; height: auto; margin: 0 auto .35rem;
    display: block;
}
.im-sc-album-name {
    font-family: 'EB Garamond', serif;
    letter-spacing: .12em;
    font-size: 1.25rem;
    color: var(--im-sc-gold);
    text-transform: uppercase;
}

/* Selector grid */
.im-sc-selector {
    width: 100%;
    display: grid;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(242,202,80,.5) transparent;
}
.im-sc-selector::-webkit-scrollbar { width: 6px; }
.im-sc-selector::-webkit-scrollbar-thumb { background: rgba(242,202,80,.5); border-radius: 3px; }

.im-sc-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid rgba(242,202,80,.25);
    border-radius: 6px;
    background: #0a1026;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.im-sc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-sc-thumb:hover { transform: translateY(-2px); border-color: rgba(242,202,80,.6); }
.im-sc-thumb.is-active {
    border-color: var(--im-sc-glow);
    box-shadow: 0 0 0 2px var(--im-sc-glow), 0 0 18px rgba(242,202,80,.5);
}
.im-sc-thumb-ph {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    color: rgba(242,202,80,.4); font-size: 1.4rem;
}

/* Lock overlay */
.im-sc-thumb.is-locked img { filter: brightness(.5) saturate(.6); }
.im-sc-lock {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6, 10, 26, .45);
}
.im-sc-lock::before {
    content: '';
    width: 26px; height: 22px;
    background: var(--im-sc-gold);
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0,0,0,.6);
    position: relative;
}
/* padlock shackle */
.im-sc-lock::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    margin-top: -16px;
    border: 3px solid var(--im-sc-gold);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}
.im-sc-thumb.is-locked { cursor: not-allowed; }
.im-showcase[data-lock="show"] .im-sc-thumb.is-locked { cursor: pointer; }

/* Bottom decorative chevron of the scroll */
.im-sc-scroll-arrow {
    width: 42px; height: 22px;
    margin-top: 1rem;
    border-left: 3px solid var(--im-sc-gold);
    border-right: 3px solid var(--im-sc-gold);
    transform: rotate(0);
    position: relative;
}
.im-sc-scroll-arrow::after {
    content: '';
    position: absolute;
    left: 50%; top: 0;
    width: 24px; height: 24px;
    border-right: 3px solid var(--im-sc-gold);
    border-bottom: 3px solid var(--im-sc-gold);
    transform: translateX(-50%) rotate(45deg);
}

/* ==========================================================================
   COLUMN 2 — Details
   ========================================================================== */
.im-sc-col-detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}
.im-sc-name {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: .01em;
    color: var(--im-sc-gold);
    text-transform: uppercase;
    margin: 0 0 1.4rem;
}
.im-sc-bio {
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--im-sc-text);
    max-width: 34ch;
    margin-bottom: 2rem;
}
.im-sc-bio p { margin: 0 0 .8rem; }

/* Stat bars — skewed magenta parallelograms */
.im-sc-stats { display: flex; flex-direction: column; gap: 1rem; max-width: 360px; }
.im-sc-stat { display: flex; align-items: center; gap: .75rem; }
.im-sc-stat-label {
    flex: 0 0 auto;
    min-width: 110px;
    text-align: right;
    font-size: 1rem;
    color: var(--im-sc-text);
}
.im-sc-stat-track {
    flex: 1 1 auto;
    height: 14px;
    background: rgba(255,255,255,.08);
    transform: skewX(-18deg);
    overflow: hidden;
    border-radius: 1px;
}
.im-sc-stat-fill {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--im-sc-stat-a), var(--im-sc-stat-b));
    box-shadow: 0 0 12px rgba(224, 64, 200, .5);
    transition: width .6s cubic-bezier(.2,.8,.2,1);
}

.im-sc-locked-msg {
    margin-top: 1.5rem;
    color: var(--im-sc-gold);
    font-style: italic;
    letter-spacing: .05em;
}

/* Swap preloader */
.im-sc-preload {
    position: absolute; inset: 0;
    z-index: 3;
    background: radial-gradient(circle, rgba(10,17,40,.6), rgba(10,17,40,.9));
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.im-sc-preload::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 34px; height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(242,202,80,.25);
    border-top-color: var(--im-sc-gold);
    border-radius: 50%;
    animation: im-sc-spin .8s linear infinite;
}
.im-showcase.is-swapping .im-sc-preload { opacity: 1; }
@keyframes im-sc-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   COLUMN 3 — Visuals
   ========================================================================== */
.im-sc-col-visual {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 560px;
    overflow: hidden;
}
.im-sc-sky {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 60% 40%, rgba(120, 60, 160, .3), transparent 60%),
        radial-gradient(ellipse at 40% 70%, rgba(30, 60, 120, .35), transparent 65%);
}

/* Stylized name plate / watermark at the top of the canvas */
.im-sc-nameplate {
    position: absolute;
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    max-width: 60%;
    text-align: center;
}
.im-sc-nameplate span {
    display: inline-block;
    padding: .4em 1.4em;
    font-family: 'EB Garamond', serif;
    letter-spacing: .12em;
    font-size: .8rem;
    text-transform: uppercase;
    color: var(--im-sc-gold);
    border-top: 1px solid rgba(242,202,80,.5);
    border-bottom: 1px solid rgba(242,202,80,.5);
    background: linear-gradient(180deg, rgba(10,17,40,.2), rgba(10,17,40,.5));
}

.im-sc-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Portal / door background asset behind the render */
.im-sc-portal {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 62%;
    height: 82%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    filter: drop-shadow(0 0 40px rgba(120,60,160,.4));
}

/* Full-body render */
.im-sc-render {
    position: relative;
    z-index: 2;
    max-height: 88%;
    max-width: 78%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,.6)) drop-shadow(0 0 30px rgba(180,140,255,.25));
    animation: im-sc-float 6s ease-in-out infinite;
}
@keyframes im-sc-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Glowing pedestal ellipse */
.im-sc-pedestal {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 40px;
    z-index: 1;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(242,202,80,.35), rgba(242,202,80,0) 70%);
    box-shadow: 0 0 60px 20px rgba(242,202,80,.15);
    border-bottom: 2px solid rgba(242,202,80,.4);
}

/* ==========================================================================
   Responsive stacking
   ========================================================================== */
.im-stack-tablet.im-showcase { }   /* prefix classes hook — actual queries below */

@media (max-width: 1024px) {
    .im-showcase {
        grid-template-columns: 260px 1fr;
        padding: 0 50px;
    }
    .im-sc-col-visual { grid-column: 1 / -1; order: 3; min-height: 480px; }
    .im-sc-arrow { font-size: 3rem; }
}

@media (max-width: 767px) {
    .im-showcase {
        grid-template-columns: 1fr;
        padding: 0 40px 2rem;
        gap: 1.5rem;
    }
    .im-sc-col-nav { order: 1; }
    .im-sc-col-detail { order: 2; text-align: center; align-items: center; }
    .im-sc-stat-label { min-width: 90px; }
    .im-sc-bio { max-width: 46ch; }
    .im-sc-col-visual { order: 3; }
    .im-sc-arrow { font-size: 2.4rem; }
    .im-sc-prev { left: 2px; }
    .im-sc-next { right: 2px; }
}

/* Editor niceties */
.elementor-editor-active .im-showcase { min-height: 560px; }

/* ==========================================================================
   Fly-in animation — Column 2 (description) and Column 3 (render image)
   animate in from Column 1's position, replayed on every character switch.
   ========================================================================== */

.im-sc-fly-left {
    animation: im-sc-fly-in-left .55s cubic-bezier(.16, .84, .44, 1) both;
}

.im-sc-fly-left-slow {
    animation: im-sc-fly-in-left-far .75s cubic-bezier(.16, .84, .44, 1) both;
}

/* Column 2 elements (name / bio / stats) — shorter distance, from the nav column edge */
@keyframes im-sc-fly-in-left {
    0%   { opacity: 0; transform: translateX(-120px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Column 3 render image — travels further, as if flying past Column 2 from Column 1 */
@keyframes im-sc-fly-in-left-far {
    0%   { opacity: 0; transform: translateX(-320px) scale(.94); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* Stagger the Column 2 elements slightly so they don't all move in lockstep */
.im-sc-name.im-sc-fly-left { animation-delay: 0s; }
.im-sc-bio.im-sc-fly-left { animation-delay: .08s; }
.im-sc-stats.im-sc-fly-left { animation-delay: .16s; }

@media (max-width: 1024px) {
    @keyframes im-sc-fly-in-left-far {
        0%   { opacity: 0; transform: translateX(-160px) scale(.94); }
        100% { opacity: 1; transform: translateX(0) scale(1); }
    }
}

@media (max-width: 767px) {
    /* Columns stack vertically on mobile — keep the motion subtle */
    .im-sc-fly-left,
    .im-sc-fly-left-slow {
        animation-duration: .4s;
    }
    @keyframes im-sc-fly-in-left {
        0%   { opacity: 0; transform: translateX(-40px); }
        100% { opacity: 1; transform: translateX(0); }
    }
    @keyframes im-sc-fly-in-left-far {
        0%   { opacity: 0; transform: translateX(-60px) scale(.97); }
        100% { opacity: 1; transform: translateX(0) scale(1); }
    }
}
