/* ======================
   Live Page (Viewer)
   ====================== */

.live-page {
    min-height: 100vh;
}

.live-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--space-4);
    color: var(--text-secondary);
}

/* ========================
   Header Hero (calligraphy) — same style as Forum
   ======================== */

.live-header-hero {
    text-align: center;
    margin-bottom: var(--space-8);
    padding-top: var(--space-2);
}

.live-header__calligraphy {
    font-family: var(--font-arabic);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    color: var(--accent-primary);
    margin-bottom: var(--space-2);
    text-shadow:
        0 0 40px var(--accent-glow),
        0 2px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 0;
    line-height: 1.2;
    animation: liveCalligraphyGlow 4s ease-in-out infinite;
}

@keyframes liveCalligraphyGlow {
    0%, 100% { text-shadow: 0 0 40px var(--accent-glow), 0 2px 20px rgba(0, 0, 0, 0.3); }
    50% { text-shadow: 0 0 60px var(--accent-glow), 0 2px 30px rgba(0, 0, 0, 0.4); }
}

.live-header__ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin: var(--space-4) auto;
    max-width: 400px;
}

.live-header__ornament-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-primary) 50%,
        transparent 100%);
}

.live-header__ornament-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
    animation: liveOrnamentSpin 30s linear infinite;
}

@keyframes liveOrnamentSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.live-header__title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.live-header__subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

/* ========================
   Live Watching Layout (Join + Chat)
   ======================== */

.live-page-watching {
    display: grid;
    grid-template-columns: 1fr 340px;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.live-join-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-info-bar {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}

.live-info-bar h1 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.live-badge-pulse {
    background: var(--danger);
    color: #fff;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 1px;
    animation: live-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.live-description {
    padding: var(--space-2) var(--space-6);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.live-join-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.live-join-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
}

.live-join-card {
    text-align: center;
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.live-join-card svg {
    stroke: var(--accent-primary);
}

.live-join-card p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 400px;
}

.live-join-btn {
    font-size: var(--text-lg) !important;
    padding: 16px 40px !important;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.live-join-hint {
    font-size: var(--text-xs) !important;
    color: var(--text-tertiary) !important;
}

.live-player-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: var(--space-4);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-align: center;
    padding: var(--space-8);
}

/* ========================
   Chat Section (viewer)
   ======================== */

.live-chat-section {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-default);
    background: var(--bg-card);
    height: 100%;
    overflow: hidden;
}

.live-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}

.live-chat-header h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.live-chat-count {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-xs);
}

.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
    min-height: 0;
}

.chat-msg {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    position: relative;
    font-size: var(--text-sm);
    line-height: 1.4;
}

.chat-msg:hover {
    background: var(--bg-card-hover);
}

.chat-msg-name {
    font-weight: 600;
    color: var(--accent-primary);
    margin-right: 6px;
}

.chat-msg-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-right: 6px;
}

.chat-msg-text {
    color: var(--text-primary);
}

.live-chat-input {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--border-default);
    flex-shrink: 0;
}

.live-chat-input input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: inherit;
}

.live-chat-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.live-chat-send {
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s;
}

.live-chat-send:hover {
    opacity: 0.9;
}

/* ========================
   Schedule View
   ======================== */

.live-page-schedule {
    padding: var(--space-8) var(--space-6);
    max-width: 700px;
    margin: 0 auto;
}

/* Countdown */

.live-countdown-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    margin-bottom: var(--space-8);
}

.live-countdown-card h2 {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    margin-bottom: var(--space-2);
}

.live-countdown-card h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.live-countdown-card > p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-6);
}

.live-countdown {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.countdown-unit span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.countdown-unit small {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-live {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--danger);
    animation: live-pulse 1s ease-in-out infinite;
}

.live-countdown-date {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* Upcoming list */

.live-upcoming-list {
    margin-bottom: var(--space-8);
}

.live-upcoming-list h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.live-schedule-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-6);
    margin-bottom: var(--space-3);
    transition: border-color var(--duration-normal) var(--ease-default);
}

.live-schedule-card:hover {
    border-color: var(--accent-primary);
}

.live-schedule-card-date {
    font-size: var(--text-xs);
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.live-schedule-card h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.live-schedule-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* No schedule */

.live-no-schedule {
    text-align: center;
    padding: var(--space-8) 0;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.live-no-schedule svg {
    stroke: var(--text-tertiary);
}

/* Live ended message */

.live-ended-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--space-4);
    text-align: center;
    color: var(--text-secondary);
}

.live-ended-msg svg {
    stroke: var(--text-tertiary);
}

.live-ended-msg h2 {
    font-size: var(--text-xl);
    color: var(--text-primary);
}

/* Pulse animation (shared with admin) */

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================
   Responsive
   ======================== */

@media (max-width: 768px) {
    .live-page-watching {
        grid-template-columns: 1fr;
        height: auto;
        overflow: auto;
    }

    .live-info-bar {
        padding: var(--space-2) var(--space-4);
    }

    .live-join-area {
        min-height: 200px;
    }

    .live-chat-section {
        border-left: none;
        border-top: 1px solid var(--border-default);
        height: 50vh;
        max-height: 400px;
    }

    .live-page-schedule {
        padding: var(--space-6) var(--space-4);
    }

    .live-header__calligraphy {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .countdown-unit span {
        font-size: 1.5rem;
    }
}
