/* ==========================================================================
   TV SCHEDULE & LIVE PILL - PREMIUM DEEP BLUE DESIGN (V19 SPLIT WIDGETS)
   ========================================================================== */

:root {
    /* RESTORED PREMIUM BLUE GRADIENT - No more gray/slate */
    --tv-primary-bg: linear-gradient(135deg, #05142b 0%, #0a1f40 100%);

    /* Stronger glass effect for Blue feel */
    --tv-glass-bg: rgba(10, 31, 64, 0.4);
    --tv-glass-border: rgba(59, 130, 246, 0.2);
    /* Blue tint border */

    --tv-accent-blue: #3b82f6;
    --tv-accent-red: #ef4444;
    --tv-accent-green: #10b981;
    --tv-text-bright: #ffffff;
    --tv-text-muted: rgba(255, 255, 255, 0.7);

    /* Restore defined shadows for depth */
    --tv-shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.6);
    --tv-shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

    --tv-blur: blur(20px);
    --tv-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Container --- */
.tv-schedule-widget,
.tv-schedule-mobile-widget {
    max-width: 850px;
    /* SHORTER WIDGET WIDTH */
    margin: 40px auto;
    padding: 0;
    /* Optional: glass container or transparent */
    background: transparent;
    border-radius: 24px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--tv-text-bright);
}

.tv-schedule-widget h2,
.tv-schedule-mobile-widget h2 {
    display: none;
}

/* ==========================================================================
   DESKTOP STYLE (UPDATED V19: CARDS LAYOUT)
   ========================================================================== */

/* --- Premium Tabs --- */
.schedule-tabs {
    display: flex;
    gap: 8px;
    /* Tighter gap */
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: nowrap;
    /* FORCE SINGLE LINE */
    padding: 0;
    width: 100%;
    overflow: visible;
}

/* ULTRA-SPECIFIC PILL FIX (PC & MOBILE) */
/* ULTRA-SPECIFIC PILL FIX (PC & MOBILE) */
.tv-schedule-widget .tab-link,
.tv-schedule-widget button.tab-link,
.tv-schedule-widget .tab-link.active,
.tv-schedule-widget .tab-link:hover,
.tv-schedule-mobile-widget .mobile-tab-link,
.tv-schedule-mobile-widget .mobile-tab-link.active,
.tab-link,
.mobile-tab-link {
    border-radius: 100px !important;
    /* TOTAL PILL */
    padding: 12px 18px !important;
    /* REDUCED FOR SINGLE LINE */
    backdrop-filter: var(--tv-blur) !important;
    -webkit-backdrop-filter: var(--tv-blur) !important;
    transition: var(--tv-transition) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    /* Tighter spacing */
    cursor: pointer !important;
    font-size: 11px !important;
    /* SMALLER FOR SINGLE LINE */
    min-width: fit-content !important;
}


.tab-link {
    background: rgba(16, 43, 87, 0.5) !important;
    border: 1px solid var(--tv-glass-border) !important;
    color: var(--tv-text-muted) !important;
    font-size: 14px !important;
}

.tab-link:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: var(--tv-accent-blue) !important;
    transform: translateY(-2px) !important;
    color: #fff !important;
}

.tab-link.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    border-color: #60a5fa !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4) !important;
}

/* --- Content Wrapper --- */
.schedule-content {
    display: none !important;
    animation: tvFadeIn 0.5s ease;
}

.schedule-content.active {
    display: block !important;
}

@keyframes tvFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- NEW DESKTOP CARD LAYOUT (V19) --- */
.desktop-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Spacing between cards */
}

.desktop-program-card {
    display: flex;
    align-items: center;
    position: relative;

    /* LIQUID GLASS STYLE (User-defined) */
    background: rgba(16, 43, 87, 0.55) !important;
    backdrop-filter: blur(28px) saturate(115%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(115%) !important;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 24px rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px;
    padding: 32px 35px;
    /* INCREASED HEIGHT THROUGH PADDING */

    transition: all 0.5s ease;
    overflow: hidden;
}

.desktop-program-card:hover {
    transform: translateY(-5px);
    background: rgba(16, 53, 107, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

/* Left: Time */
.desktop-card-time {
    width: 140px;
    /* Fixed width for alignment */
    font-size: 20px;
    /* Larger */
    font-weight: 800;
    color: var(--tv-accent-blue);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

/* Center: Program Title */
.desktop-card-content {
    flex-grow: 1;
}

.desktop-program-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    padding-right: 150px;
    /* Prevent text overlap with badges */
}

/* Right: Badges (Absolute Top Right) */
.desktop-badges {
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
}

.desktop-badge {
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 30px;
    color: #fff;
    backdrop-filter: blur(10px) saturate(115%);
    -webkit-backdrop-filter: blur(10px) saturate(115%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.desktop-badge.live {
    background: rgba(239, 68, 68, 0.7) !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
}

.desktop-badge.new {
    background: rgba(16, 185, 129, 0.7) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

/* --- STATUS STYLES (PC) --- */

/* LIVE CARD */
.desktop-program-card.live-now {
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -50px 0 30px rgba(239, 68, 68, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.45) !important;
    background: linear-gradient(90deg, rgba(16, 43, 87, 0.55) 0%, rgba(16, 43, 87, 0.55) 70%, rgba(239, 68, 68, 0.15) 100%) !important;
}

.desktop-program-card.is-new {
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -50px 0 30px rgba(16, 185, 129, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.45) !important;
    background: linear-gradient(90deg, rgba(16, 43, 87, 0.55) 0%, rgba(16, 43, 87, 0.55) 70%, rgba(16, 185, 129, 0.15) 100%) !important;
}

.desktop-empty-state {
    text-align: center;
    padding: 60px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    font-style: italic;
}


/* ==========================================================================
   MOBILE EXCLUSIVE WIDGET STYLES (.tv-schedule-mobile-widget)
   ========================================================================== */

/* Tabs Horizontal Scroll */
.mobile-tabs-container {
    width: 100%;
    overflow-x: auto;
    padding: 0 0 25px 0;
    /* Adjusted padding */
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.mobile-tabs {
    display: inline-flex;
    gap: 12px;
    padding: 0 20px;
}

/* MOBILE TABS ALREADY COVERED BY AGGRESSIVE SELECTOR ABOVE */
.mobile-tab-link.active {
    background: var(--tv-accent-blue) !important;
    color: #fff !important;
    border-color: var(--tv-accent-blue) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
}

/* Mobile Content Fade In */
.mobile-day-content {
    display: none;
    animation: tvFadeIn 0.3s ease;
}

.mobile-day-content.active {
    display: block;
}

/* Mobile Card Layout - EXCLUSIVE DESIGN */
.mobile-program-card {
    display: flex;
    flex-direction: column;

    /* LIQUID GLASS STYLE (User-defined) */
    background: rgba(16, 43, 87, 0.55) !important;
    backdrop-filter: blur(28px) saturate(115%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(115%) !important;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 24px rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px;

    padding: 28px 24px;
    /* INCREASED HEIGHT */
    margin-bottom: 20px;

    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transition: all 0.3s ease;
}

.mobile-program-card.live-now {
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -30px 0 20px rgba(239, 68, 68, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.4) !important;
    background: linear-gradient(90deg, rgba(16, 43, 87, 0.55) 0%, rgba(16, 43, 87, 0.55) 60%, rgba(239, 68, 68, 0.15) 100%) !important;
}

.mobile-program-card.is-new {
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -30px 0 20px rgba(16, 185, 129, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.4) !important;
    background: linear-gradient(90deg, rgba(16, 43, 87, 0.55) 0%, rgba(16, 43, 87, 0.55) 60%, rgba(16, 185, 129, 0.15) 100%) !important;
}

.mobile-card-time {
    font-size: 14px;
    color: #60a5fa;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.mobile-program-title {
    font-size: 18px;
    /* Slightly smaller for better fit with badge */
    color: #fff;
    font-weight: 700;
    margin: 0 0 5px 0;
    /* Reduced margin */
    line-height: 1.3;
    padding-right: 60px;
    /* Space for the badge so text doesn't overlap */
}

/* BADGES: Top Right & Smaller */
.mobile-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
}

.mobile-badge {
    margin: 0 !important;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 30px;
    color: #fff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.mobile-badge.live {
    background: rgba(239, 68, 68, 0.7) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.mobile-badge.new {
    background: rgba(16, 185, 129, 0.7) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}


.mobile-empty-state {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}


/* ==========================================================================
   PILL LAYOUT (Shared but Optimized)
   ========================================================================== */
.live-program-pill-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 5px 0;
    /* Reduced from 20px - MUCH tighter outer spacing */
}

.live-program-pill {
    display: flex !important;
    align-items: center;
    gap: 8px;
    /* Reduced from 12px - Tighter inner elements */

    /* Blue Glass Pill */
    background: rgba(5, 20, 43, 0.85) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;

    border-radius: 100px;
    padding: 8px 18px !important;
    /* Reduced from 10px 20px - Slimmer pill */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: var(--tv-transition);
    cursor: pointer;
    max-width: 95%;
    /* Allowed slightly more width */
}

.live-program-pill:hover {
    transform: translateY(-3px);
    border-color: var(--tv-accent-blue) !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.2);
}

.live-program-pill .live-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--tv-accent-blue);
    /* Default Blue */
    box-shadow: 0 0 12px var(--tv-accent-blue);
    border-radius: 50%;
    transition: var(--tv-transition);
}

/* Status States for Dot */
.live-dot.status-live {
    background: var(--tv-accent-red) !important;
    box-shadow: 0 0 12px var(--tv-accent-red);
}

.live-dot.status-new {
    background: var(--tv-accent-green) !important;
    box-shadow: 0 0 12px var(--tv-accent-green);
}

.live-dot.status-onair {
    background: var(--tv-accent-blue) !important;
    box-shadow: 0 0 12px var(--tv-accent-blue);
}

.live-program-pill .live-label {
    flex-shrink: 0;
    color: var(--tv-accent-blue);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1.5px;
}

.live-program-pill .live-program {
    color: #fff;
    font-weight: 600;
    font-size: 15px;

    /* FIXED TRUNCATION */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
    display: block;
}

@media (max-width: 768px) {
    .live-program-pill {
        padding: 10px 18px !important;
        gap: 10px;
    }

    .live-program-pill .live-program {
        max-width: 160px;
        font-size: 13px;
    }
}