/**
 * Ticketa Theme — assets/css/payment.css
 *
 * RESPONSIBILITY:
 *   Styles for the Flying Carpet payment iframe modal overlay.
 *   Injected dynamically by payment.js — the DOM elements do not
 *   pre-exist in any template.
 *
 * ELEMENT TREE (created by payment.js):
 *   #rb-payment-overlay      — full-screen dark backdrop
 *     .rb-payment-panel      — white rounded modal container
 *       .rb-payment-close    — × close button (top-left in RTL)
 *       .rb-payment-loader   — spinner shown while iframe loads
 *       #rb-payment-iframe   — the actual FC payment iframe
 *
 * @package Ticketa
 * @version 1.1.0
 * @since   1.1.0
 */

/* ── Backdrop ─────────────────────────────────────────────────────────────── */

#rb-payment-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: rb-overlay-in 200ms ease both;
}

@keyframes rb-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal panel ──────────────────────────────────────────────────────────── */

.rb-payment-panel {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    animation: rb-panel-in 280ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes rb-panel-in {
    from { opacity: 0; transform: scale(0.90) translateY(20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Close button ─────────────────────────────────────────────────────────── */

.rb-payment-close {
    position: absolute;
    top: var(--space-4);
    /* RTL: close is on the left side visually (inline-start = right in RTL code, but visually left) */
    left: var(--space-4);
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.rb-payment-close:hover {
    background: rgba(0, 0, 0, 0.16);
    color: #000;
}

.rb-payment-close:focus-visible {
    outline: 3px solid var(--ticketa-orange);
    outline-offset: 2px;
}

/* ── Loader ───────────────────────────────────────────────────────────────── */

.rb-payment-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-8);
    gap: var(--space-5);
    color: #555;
    font-size: var(--text-sm);
    font-family: var(--font-body);
}

.rb-payment-loader .spinner {
    width: 32px;
    height: 32px;
    border-color: #e0e0e0;
    border-top-color: var(--ticketa-orange);
}

/* ── Iframe ───────────────────────────────────────────────────────────────── */

#rb-payment-iframe {
    width: 100%;
    /* Height fills the panel up to 80vh */
    height: 80vh;
    max-height: 680px;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity var(--transition-base);
    flex: 1;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .rb-payment-panel {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    #rb-payment-overlay {
        align-items: flex-end;
        padding: 0;
    }

    #rb-payment-iframe {
        height: 85vh;
    }
}
