/* ============================================================
 * idle-rates-board.css
 * Login page only — idle FX rates board overlay ("screensaver")
 * Verbatim port of corpweb WebV8 screensaver.css — only the
 * class names are mapped (screensaver-* → irb-*). The overlay is
 * transparent (no backdrop): the page's country video/image stays
 * visible while JS fades the page content out, exactly as WebV8.
 * OPX 6.0 — DO NOT include on any other page.
 * ============================================================ */

/* Screensaver Overlay — Card Grid Design */
#irb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
}

/* Fade in/out — emulates WebV8's jQuery fadeIn(300) / fadeOut(1500) */
#irb-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#irb-overlay.irb-visible {
    opacity: 1;
}

#irb-overlay.irb-exiting {
    opacity: 0;
    transition: opacity 1.5s ease;
}

/* Cards container — centered on screen by default, centered on video for large screens */
.irb-cards-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 720px;
}

/* 2-column grid — fixed height so position doesn't shift with fewer cards */
.irb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-content: start;
    height: 572px;
}

/* Individual rate card
   (horizontal padding balanced at 24px — WebV8 used 30px, but OPX rates such
   as 66.4973 INR can be wider; column-gap guarantees code/rate never touch) */
.irb-card {
    background: rgba(40, 40, 40, 0.80);
    border-top: 4px solid #FFBD00;
    border-radius: 0 0 32px 32px;
    padding: 2px 24px 15px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    column-gap: 12px;
    height: 190px;
    overflow: hidden;
}

.irb-card.bounce {
    opacity: 0;
}

.irb-card .flip-text {
    display: inline-block;
    overflow: hidden;
    height: 1.1em;
    vertical-align: bottom;
    position: relative;
}

.irb-card .flip-text .flip-reel {
    display: block;
}

.irb-card .flip-text .flip-reel > span {
    display: block;
    height: 1.1em;
    line-height: 1.1;
}

/* Left side — currency code + full name */
.irb-card-left {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

.irb-card-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 64px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.irb-rate-factor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1;
    position: relative;
    top: -54px;
    margin-left: 2px;
    width: 0;
    display: inline-block;
    overflow: visible;
    white-space: nowrap;
}

.irb-card-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 17px;
    font-weight: 500;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-stretch: condensed;
    margin-top: 6px;
    line-height: 1.2;
}

/* Right side — rate value, aligned to bottom of currency code.
   margin-left:auto + justify-content:flex-end pin the digits to the right
   edge so every card shares identical alignment; flex-wrap:nowrap plus the
   JS uniform-fit sizing guarantee the digits never wrap or truncate. */
.irb-card-rate {
    font-family: 'JetBrains Mono', monospace;
    font-size: 46px;
    font-weight: 600;
    color: #FFFFFF;
    text-align: right;
    white-space: nowrap;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: baseline;
    line-height: 1;
    align-self: flex-start;
    margin-top: 14px;
    margin-left: auto;
    flex-shrink: 1;
}

/* em-based so the tuck scales with the fitted font size
   (-0.17em = WebV8's -8px at the 46px design size) */
.irb-card-rate .rate-dot {
    margin-left: -0.17em;
    margin-right: -0.17em;
}

/* Note: opx6-home.css (loaded globally by _Layout) also defines a `.rate-small`
   class (dark #262626, 18px, its own font/weight/line-height). Re-assert every
   property here so the small trailing digits render white, matching WebV8. */
.irb-card-rate .rate-small {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    color: #FFFFFF;
}

.irb-card-rate .rate-call {
    font-size: 28px;
    color: #FFFFFF;
}

/* Responsive */
@media (max-width: 1023px) {
    .irb-cards-container {
        max-width: 600px;
    }

    .irb-card-code {
        font-size: 30px;
    }

    .irb-card-name {
        font-size: 10px;
    }

    .irb-card-rate {
        font-size: 28px;
    }

    .irb-card-rate .rate-small {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .irb-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .irb-cards-container {
        max-width: 90%;
    }

    .irb-card {
        min-height: 70px;
        padding: 14px 16px;
    }

    .irb-card-code {
        font-size: 24px;
    }

    .irb-card-rate {
        font-size: 22px;
    }

    .irb-card-rate .rate-small {
        font-size: 14px;
    }
}
