/* ==========================================================================
   Live Classes — student portal (Arabic / RTL first)
   ========================================================================== */

.eg-lv-main {
    padding-bottom: 5rem;
}

.eg-lv-hero-badge {
    background: linear-gradient(135deg, rgba(192, 57, 43, .16), rgba(243, 147, 24, .16)) !important;
}

/* ---------- Hero stats ---------- */
.eg-lv-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .7rem;
    margin-top: 1.4rem;
}

.eg-lv-stat {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1.05rem;
    border-radius: 999px;
    background: var(--eg-surface);
    border: 1px solid var(--eg-border);
    box-shadow: var(--eg-shadow);
    font-size: .86rem;
    font-weight: 700;
    color: var(--eg-text);
}

.eg-lv-stat i {
    color: var(--eg-primary);
}

.eg-lv-stat--live i {
    color: #c0392b;
}

.eg-lv-stat b {
    font-size: 1.05rem;
    font-weight: 900;
}

/* ---------- Next class banner ---------- */
.eg-lv-next {
    position: relative;
    overflow: hidden;
    margin: 2rem auto 1.6rem;
    padding: 1.6rem 1.8rem;
    border-radius: var(--eg-radius);
    background: linear-gradient(135deg, var(--eg-secondary) 0%, var(--eg-secondary-light) 60%, var(--eg-primary-dark) 130%);
    box-shadow: var(--eg-shadow-lg);
    color: #fff;
}

.eg-lv-next::before {
    content: "";
    position: absolute;
    inset-inline-start: -70px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(243, 147, 24, .5), transparent 70%);
    pointer-events: none;
}

.eg-lv-next-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
}

.eg-lv-next-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .06em;
    padding: .28rem .75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
}

.eg-lv-next h2 {
    margin: .65rem 0 .2rem;
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 900;
}

.eg-lv-next-when {
    font-size: .88rem;
    color: rgba(255, 255, 255, .84);
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

/* ---------- Countdown ---------- */
.eg-lv-countdown {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.eg-lv-cd-unit {
    min-width: 3.6rem;
    padding: .5rem .35rem;
    border-radius: .85rem;
    text-align: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    backdrop-filter: blur(4px);
}

.eg-lv-cd-num {
    display: block;
    font-size: 1.32rem;
    font-weight: 900;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.eg-lv-cd-lbl {
    display: block;
    font-size: .66rem;
    opacity: .8;
    margin-top: .1rem;
}

.eg-lv-livepill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: 1rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    background: #c0392b;
    font-weight: 800;
    font-size: .9rem;
    box-shadow: 0 0 0 0 rgba(192, 57, 43, .7);
    animation: eg-lv-glow 1.8s infinite;
}

@keyframes eg-lv-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(192, 57, 43, .65);
    }

    70% {
        box-shadow: 0 0 0 14px rgba(192, 57, 43, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(192, 57, 43, 0);
    }
}

/* ---------- Buttons ---------- */
.eg-lv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .68rem 1.35rem;
    font-family: var(--eg-font-display);
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, opacity .16s ease;
}

.eg-lv-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.eg-lv-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.eg-lv-btn--join {
    background: linear-gradient(135deg, #e0533f, #c0392b);
    color: #fff;
    box-shadow: 0 10px 26px rgba(192, 57, 43, .35);
}

.eg-lv-btn--primary {
    background: var(--eg-primary);
    color: #fff;
    box-shadow: 0 10px 26px rgba(243, 147, 24, .32);
}

.eg-lv-btn--ghost {
    background: transparent;
    border-color: var(--eg-border);
    color: var(--eg-text-muted);
}

.eg-lv-btn--ghost:hover:not(:disabled) {
    border-color: var(--eg-primary);
    color: var(--eg-primary-dark);
}

.eg-lv-btn--block {
    width: 100%;
}

.eg-lv-btn--sm {
    padding: .5rem 1rem;
    font-size: .84rem;
}

/* ---------- Tabs ---------- */
.eg-lv-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1.8rem 0 1.3rem;
}

.eg-lv-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--eg-border);
    background: var(--eg-surface);
    color: var(--eg-text-muted);
    font-family: var(--eg-font-display);
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s ease;
}

.eg-lv-tab:hover {
    border-color: var(--eg-primary);
    color: var(--eg-primary-dark);
}

.eg-lv-tab.is-active {
    background: var(--eg-secondary);
    border-color: var(--eg-secondary);
    color: #fff;
    box-shadow: var(--eg-shadow);
}

.eg-lv-tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: var(--eg-primary-soft);
    color: var(--eg-primary-dark);
    font-size: .74rem;
    font-weight: 900;
}

.eg-lv-tab.is-active .eg-lv-tab-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* ---------- Card grid ---------- */
.eg-lv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.2rem;
}

.eg-lv-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: var(--eg-radius);
    background: var(--eg-surface);
    border: 1px solid var(--eg-border);
    box-shadow: var(--eg-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.eg-lv-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--eg-shadow-lg);
}

.eg-lv-card-strip {
    height: 5px;
    background: var(--eg-primary);
}

.eg-lv-card--live .eg-lv-card-strip {
    background: linear-gradient(90deg, #c0392b, #ff8a65);
}

.eg-lv-card--completed .eg-lv-card-strip {
    background: linear-gradient(90deg, #2e9e5b, #7ed6a5);
}

.eg-lv-card--cancelled .eg-lv-card-strip {
    background: linear-gradient(90deg, #9b9b9b, #cfcfcf);
}

.eg-lv-card-body {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1.15rem 1.2rem 1.3rem;
    flex: 1 1 auto;
}

.eg-lv-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.eg-lv-provider {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .26rem .7rem;
    border-radius: 999px;
    background: var(--eg-primary-soft);
    color: var(--eg-primary-dark);
    font-size: .76rem;
    font-weight: 800;
}

.eg-lv-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .26rem .7rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    background: rgba(70, 30, 56, .08);
    color: var(--eg-secondary-light);
}

.eg-lv-status--live {
    background: rgba(192, 57, 43, .12);
    color: #c0392b;
}

.eg-lv-status--live .eg-lv-dot {
    animation: eg-lv-blink 1.3s infinite;
}

.eg-lv-status--completed {
    background: rgba(46, 158, 91, .13);
    color: #2e9e5b;
}

.eg-lv-status--cancelled {
    background: rgba(120, 120, 120, .14);
    color: #6b6b6b;
}

.eg-lv-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: currentColor;
}

@keyframes eg-lv-blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .25;
    }
}

.eg-lv-card h3 {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 900;
    line-height: 1.45;
    color: var(--eg-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eg-lv-card-desc {
    margin: 0;
    font-size: .85rem;
    line-height: 1.75;
    color: var(--eg-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eg-lv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: auto;
}

.eg-lv-meta span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .32rem .7rem;
    border-radius: .7rem;
    background: var(--eg-parchment);
    border: 1px solid var(--eg-border);
    font-size: .78rem;
    font-weight: 600;
    color: var(--eg-text-muted);
}

.eg-lv-meta i {
    color: var(--eg-primary);
}

.eg-lv-mini-countdown {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .8rem;
    border-radius: .8rem;
    background: var(--eg-primary-soft);
    color: var(--eg-primary-dark);
    font-size: .82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ---------- Empty state ---------- */
.eg-lv-empty {
    display: grid;
    place-items: center;
    gap: .55rem;
    padding: 3.5rem 1.5rem;
    text-align: center;
    border-radius: var(--eg-radius);
    border: 1px dashed var(--eg-border);
    background: var(--eg-surface);
}

.eg-lv-empty-icon {
    display: grid;
    place-items: center;
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 50%;
    background: var(--eg-primary-soft);
    color: var(--eg-primary);
    font-size: 1.8rem;
}

.eg-lv-empty h4 {
    margin: .4rem 0 0;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--eg-text);
}

.eg-lv-empty p {
    margin: 0;
    font-size: .88rem;
    color: var(--eg-text-muted);
    max-width: 42ch;
}

/* ---------- Error banner ---------- */
.eg-lv-error {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.1rem;
    margin-bottom: 1.2rem;
    border-radius: var(--eg-radius-sm);
    background: rgba(192, 57, 43, .1);
    border: 1px solid rgba(192, 57, 43, .28);
    color: #a5321f;
    font-size: .88rem;
    font-weight: 600;
}

.eg-lv-error--info {
    background: rgba(37, 99, 235, .1);
    border-color: rgba(37, 99, 235, .28);
    color: #1d4ed8;
}

/* ---------- Join modal ---------- */
.eg-lv-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(26, 12, 22, .62);
    backdrop-filter: blur(6px);
    animation: eg-lv-fade .2s ease;
}

@keyframes eg-lv-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.eg-lv-panel {
    width: min(960px, 100%);
    max-height: 92vh;
    overflow: auto;
    border-radius: var(--eg-radius);
    background: var(--eg-surface);
    box-shadow: var(--eg-shadow-lg);
    animation: eg-lv-rise .24s ease;
}

@keyframes eg-lv-rise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.eg-lv-panel-head {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid var(--eg-border);
}

.eg-lv-panel-head h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 900;
    color: var(--eg-text);
}

.eg-lv-panel-icon {
    display: grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: .9rem;
    background: var(--eg-primary-soft);
    color: var(--eg-primary-dark);
    font-size: 1.15rem;
}

.eg-lv-panel-close {
    margin-inline-start: auto;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid var(--eg-border);
    background: transparent;
    color: var(--eg-text-muted);
    cursor: pointer;
}

.eg-lv-panel-close:hover {
    color: #c0392b;
    border-color: #c0392b;
}

.eg-lv-panel-body {
    padding: 1.2rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.eg-lv-note {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .8rem 1rem;
    border-radius: var(--eg-radius-sm);
    background: var(--eg-primary-soft);
    color: var(--eg-text);
    font-size: .86rem;
    line-height: 1.7;
}

.eg-lv-note i {
    color: var(--eg-primary-dark);
    margin-top: .15rem;
}

.eg-lv-creds {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.eg-lv-cred {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    border-radius: .8rem;
    background: var(--eg-parchment);
    border: 1px solid var(--eg-border);
    font-size: .85rem;
}

.eg-lv-cred small {
    color: var(--eg-text-muted);
    font-weight: 700;
}

.eg-lv-cred b {
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

.eg-lv-embed {
    width: 100%;
    min-height: 460px;
    border: 0;
    border-radius: var(--eg-radius-sm);
    background: #000;
}

.eg-lv-panel-foot {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    padding: 1rem 1.3rem 1.3rem;
    border-top: 1px solid var(--eg-border);
}

@media (max-width: 640px) {
    .eg-lv-next {
        padding: 1.3rem;
    }

    .eg-lv-grid {
        grid-template-columns: 1fr;
    }

    .eg-lv-btn {
        width: 100%;
    }

    .eg-lv-panel-foot .eg-lv-btn {
        width: 100%;
    }
}
