/* ========================================
   LIVE STREAM ANALYTICS STYLES
   Multi-stream support (up to 10+)
   ======================================== */

/* Dashboard Widget */
#liveAnalyticsWidget {
    display: none;
    margin-bottom: 20px;
}

.live-widget {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    padding: 20px;
    color: white;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 68, 68, 0.3);
    animation: livePulse 3s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        border-color: rgba(255, 68, 68, 0.3);
    }

    50% {
        border-color: rgba(255, 68, 68, 0.7);
    }
}

.live-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.live-badge {
    background: #ff4444;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    animation: liveBlink 1.5s ease-in-out infinite;
}

@keyframes liveBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.live-uptime {
    color: #a0aec0;
    font-size: 13px;
    margin-left: auto;
}

/* Aggregated Totals Row */
.live-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.live-stat {
    text-align: center;
    padding: 10px 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.live-stat-val {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.live-stat-lbl {
    font-size: 11px;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* === Multi-Stream Grid === */
.live-streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* Individual Stream Card */
.live-stream-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s;
}

.live-stream-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 68, 68, 0.3);
}

.live-sc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.live-sc-badge {
    font-size: 10px;
    animation: liveBlink 1.5s ease-in-out infinite;
}

.live-sc-title {
    font-weight: 600;
    font-size: 13px;
    color: #e0e0e0;
}

.live-sc-uptime {
    font-size: 11px;
    color: #a0aec0;
    margin-left: auto;
}

.live-sc-detail {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.live-sc-detail:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.live-sc-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #ccc;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.live-sc-stats span {
    white-space: nowrap;
}

.live-sc-chart {
    height: 40px;
    border-radius: 5px;
    overflow: hidden;
}

/* ==============================
   Detail Modal
   ============================== */
.live-detail-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.live-detail-content {
    background: #1a1a2e;
    color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 720px;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    animation: liveSlideIn 0.3s ease-out;
}

@keyframes liveSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.live-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    border-radius: 15px 15px 0 0;
}

.live-detail-header h2 {
    margin: 0;
    font-size: 18px;
    color: white;
}

.live-detail-close {
    font-size: 28px;
    cursor: pointer;
    color: white;
    transition: transform 0.3s;
}

.live-detail-close:hover {
    transform: rotate(90deg);
}

.live-detail-body {
    padding: 20px 25px;
}

/* Detail Stats Grid */
.live-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.live-detail-stat {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-detail-stat-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.live-detail-stat-val {
    font-size: 24px;
    font-weight: 700;
}

.live-detail-stat-lbl {
    font-size: 11px;
    color: #a0aec0;
    text-transform: uppercase;
    margin-top: 3px;
}

/* Detail Chart */
.live-detail-chart-wrap {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .live-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .live-streams-grid {
        grid-template-columns: 1fr;
    }

    .live-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .live-detail-content {
        width: 95%;
        margin: 3% auto;
    }

    .live-sc-stats {
        font-size: 11px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .live-widget {
        padding: 12px;
    }

    .live-stat-val {
        font-size: 18px;
    }
}