/* ═══════════════════════════════════════════════════════════
   Runway Experience — Immersive Product Demo
   Three-phase fullscreen overlay:
   Phase 1: Cinematic intro (video)
   Phase 2: Industry selector (personalized)
   Phase 3: Interactive sandbox (hands-on)
   ═══════════════════════════════════════════════════════════ */

/* ── Overlay Container ── */
.rx-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: #050505;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.rx-overlay.active {
    display: flex;
    animation: rx-fadeIn 0.4s ease;
}

@keyframes rx-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Close Button ── */
.rx-close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 5010;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.rx-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ── Phase Container ── */
.rx-phase {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.rx-phase.active {
    display: flex;
    opacity: 1;
}

.rx-phase.fade-out {
    opacity: 0;
}

/* ═══════════════════════════════════════
   PHASE 1: Cinematic Intro (Split Layout)
   ═══════════════════════════════════════ */
.rx-cinema {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
}

.rx-cinema-main {
    flex: 1;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 100px 60px 60px; /* Extra padding on right to keep away from sidebar */
    z-index: 1;
}

.rx-cinema-sidebar {
    width: 300px; /* Narrower sidebar */
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center avatar vertically in sidebar */
    padding: 20px;
    z-index: 10;
    backdrop-filter: blur(20px);
}

.rx-avatar-rect {
    width: 240px;
    height: 320px; /* Vertical rectangle */
    border-radius: 0; /* Sharp corners */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #000;
    margin-bottom: 15px;
}

.rx-avatar-rect video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rx-avatar-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 10px;
}

.rx-cinema-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rx-cinema-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, #050505, transparent);
    pointer-events: none;
}

.rx-cinema-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 60px;
    z-index: 2;
}

.rx-cinema-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.rx-cinema-sub {
    font-size: 1rem;
    color: #999;
    margin-bottom: 20px;
    max-width: 500px;
}

.rx-cinema-skip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.rx-cinema-skip:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* Progress bar at bottom of video */
.rx-cinema-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 3;
}

.rx-cinema-progress-bar {
    height: 100%;
    background: #00c853;
    width: 0%;
    transition: width 0.3s linear;
    box-shadow: 0 0 10px rgba(0, 200, 83, 0.5);
}

/* ═══════════════════════════════════════
   PHASE 2: Industry Selector
   ═══════════════════════════════════════ */
.rx-selector {
    text-align: center;
    padding: 40px 24px;
}

.rx-selector-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.rx-selector h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.rx-selector p {
    color: #777;
    font-size: 1rem;
    margin-bottom: 48px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.rx-industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.rx-industry-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 28px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.rx-industry-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-4px);
}

.rx-industry-card.selected {
    border-color: #e50914;
    background: rgba(229, 9, 20, 0.06);
    box-shadow: 0 0 30px rgba(229, 9, 20, 0.1);
}

.rx-industry-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: block;
}

.rx-industry-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.rx-industry-desc {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.5;
}

/* Loading transition after industry select */
.rx-loading {
    text-align: center;
    padding: 60px;
}

.rx-loading-text {
    font-size: 1rem;
    color: #888;
    margin-top: 20px;
}

.rx-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: rx-spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes rx-spin {
    to {
        transform: rotate(360deg);
    }
}

.rx-loading-steps {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.rx-loading-step {
    font-size: 0.8rem;
    color: #444;
    transition: color 0.3s;
}

.rx-loading-step.active {
    color: #00c853;
}

.rx-loading-step.active::before {
    content: '\2713 ';
}

/* ═══════════════════════════════════════
   PHASE 3: Interactive Sandbox
   ═══════════════════════════════════════ */
.rx-sandbox {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
}

/* Sandbox top bar */
.rx-sandbox-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.rx-sandbox-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rx-sandbox-brand-logo {
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #fff;
}

.rx-sandbox-brand-tag {
    font-size: 0.65rem;
    color: #e50914;
    background: rgba(229, 9, 20, 0.1);
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.rx-sandbox-industry {
    font-size: 0.8rem;
    color: #888;
}

.rx-sandbox-cta {
    background: #00c853;
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    animation: rx-pulse 2s infinite;
}

.rx-sandbox-cta:hover {
    background: #00e676;
    transform: scale(1.02);
}

@keyframes rx-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.4);
    }

    50% {
        box-shadow: 0 0 16px 4px rgba(0, 200, 83, 0.15);
    }
}

/* Sandbox navigation tabs */
.rx-sandbox-nav {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    overflow-x: auto;
}

.rx-sandbox-tab {
    padding: 12px 24px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rx-sandbox-tab:hover {
    color: #aaa;
    background: rgba(255, 255, 255, 0.02);
}

.rx-sandbox-tab.active {
    color: #fff;
    border-bottom-color: #e50914;
    background: rgba(255, 255, 255, 0.03);
}

.rx-sandbox-tab i {
    font-size: 0.9rem;
}

/* Sandbox content area */
.rx-sandbox-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ── BI Dashboard Mock ── */
.rx-bi-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.rx-bi-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
}

.rx-bi-stat-label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.rx-bi-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.rx-bi-stat-change {
    font-size: 0.75rem;
    margin-top: 4px;
}

.rx-bi-stat-change.up {
    color: #00c853;
}

.rx-bi-stat-change.down {
    color: #ff4444;
}

.rx-bi-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.rx-bi-chart-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
}

.rx-bi-chart-title {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* SVG chart area */
.rx-chart-area {
    width: 100%;
    height: 180px;
}

/* ── POS Mock ── */
.rx-pos-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    height: calc(100vh - 180px);
}

.rx-pos-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    align-content: start;
    overflow-y: auto;
    padding-right: 8px;
}

.rx-pos-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.rx-pos-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.rx-pos-item:active {
    transform: scale(0.97);
}

.rx-pos-item-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
}

.rx-pos-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.rx-pos-item-price {
    font-size: 0.85rem;
    color: #00c853;
    font-weight: 600;
}

/* POS Cart */
.rx-pos-cart {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rx-pos-cart-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rx-pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.rx-pos-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
}

.rx-pos-cart-item-name {
    flex: 1;
}

.rx-pos-cart-item-qty {
    color: #888;
    margin: 0 12px;
    font-size: 0.75rem;
}

.rx-pos-cart-item-price {
    font-weight: 600;
    color: #00c853;
}

.rx-pos-cart-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
}

.rx-pos-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.rx-pos-charge-btn {
    width: 100%;
    background: #00c853;
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.rx-pos-charge-btn:hover {
    background: #00e676;
}

/* ── Prescriptions Mock ── */
.rx-rx-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 700px;
}

.rx-rx-card {
    background: rgba(0, 200, 83, 0.03);
    border: 1px solid rgba(0, 200, 83, 0.12);
    border-radius: 14px;
    padding: 24px;
    transition: border-color 0.3s;
}

.rx-rx-card:hover {
    border-color: rgba(0, 200, 83, 0.3);
}

.rx-rx-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.rx-rx-card-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 200, 83, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00c853;
    font-size: 1rem;
}

.rx-rx-card-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #00c853;
    font-weight: 600;
}

.rx-rx-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rx-rx-card-body {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.7;
}

.rx-rx-card-impact {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.75rem;
    color: #00c853;
    background: rgba(0, 200, 83, 0.08);
    padding: 4px 12px;
    border-radius: 10px;
    font-weight: 600;
}

/* ── Bookkeeping Mock ── */
.rx-bk-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.rx-bk-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
}

.rx-bk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.rx-bk-table th {
    text-align: left;
    padding: 12px 16px;
    color: #666;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rx-bk-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.rx-bk-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.rx-bk-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* ── Bottom CTA Bar ── */
.rx-bottom-cta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: linear-gradient(to right, rgba(229, 9, 20, 0.08), rgba(0, 200, 83, 0.08));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rx-bottom-cta-text {
    font-size: 0.85rem;
    color: #aaa;
}

.rx-bottom-cta-text strong {
    color: #fff;
}

.rx-bottom-cta-btn {
    background: #00c853;
    color: #000;
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.rx-bottom-cta-btn:hover {
    background: #00e676;
    transform: translateY(-1px);
}

/* ── Responsive ── */
@keyframes rx-zoom-in {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .rx-cinema-title {
        font-size: 1.3rem;
    }

    .rx-cinema-overlay {
        padding: 24px;
    }

    .rx-selector h1 {
        font-size: 1.5rem;
    }

    .rx-industry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .rx-pos-layout {
        grid-template-columns: 1fr;
    }

    .rx-bi-charts {
        grid-template-columns: 1fr;
    }

    .rx-sandbox-topbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .rx-sandbox-tab {
        padding: 10px 16px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .rx-industry-grid {
        grid-template-columns: 1fr;
    }

    .rx-bi-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}