/* ==========================================
   HivePress TV Show — Premium Player Styles
   v2.2 — Final Polish with HivePress Native Grid
   ========================================== */

/* ---- BASE CONTAINER ---- */
.hp-tvshow-container {
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

/* ============= DARK THEME (default) ============= */
.hp-tvshow--dark {
    background: linear-gradient(145deg, #0d0d0d, #1a1a2e);
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hp-tvshow--dark .hp-tvshow-header {
    background: linear-gradient(90deg, #111827, #1f2937);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hp-tvshow--dark .hp-tvshow-channel-name {
    color: #e2e8f0;
}

.hp-tvshow--dark .hp-tvshow-separator {
    color: #475569;
}

.hp-tvshow--dark .hp-tvshow-program-title {
    color: #94a3b8;
}

.hp-tvshow--dark .hp-tvshow-online {
    color: #64748b;
}

.hp-tvshow--dark .hp-tvshow-player-wrapper {
    background: #000;
}

.hp-tvshow--dark .hp-tvshow-channels-wrapper {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.05);
}

.hp-tvshow--dark .hp-tvshow-channels-heading {
    color: #475569;
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

.hp-tvshow--dark .hp-tvshow-channel-item {
    border-bottom-color: rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.02);
}

.hp-tvshow--dark .hp-tvshow-channel-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.hp-tvshow--dark .hp-tvshow-channel-item.active {
    background: rgba(59, 130, 246, 0.12);
    border-left-color: #3b82f6;
}

.hp-tvshow--dark .hp-tvshow-channel-thumb {
    background: #1e293b;
}

.hp-tvshow--dark .hp-tvshow-channel-title {
    color: #e2e8f0;
}

.hp-tvshow--dark .hp-tvshow-channel-subtitle {
    color: #475569;
}

.hp-tvshow--dark .hp-tvshow-channel-item.active .hp-tvshow-channel-title {
    color: #93c5fd;
}

.hp-tvshow--dark .hp-tvshow-footer {
    color: #334155;
    border-top-color: rgba(255, 255, 255, 0.04);
}

.hp-tvshow--dark .hp-tvshow-footer a {
    color: #475569;
}

.hp-tvshow--dark .hp-tvshow-footer a:hover {
    color: #94a3b8;
}

.hp-tvshow--dark .hp-tvshow-placeholder {
    color: #475569;
}

.hp-tvshow--dark .hp-tvshow-no-thumb {
    color: #475569;
}

/* Theme toggle icon visibility */
.hp-tvshow--dark .hp-tvshow-theme-icon--dark {
    display: inline;
}

.hp-tvshow--dark .hp-tvshow-theme-icon--light {
    display: none;
}

/* ============= LIGHT THEME ============= */
.hp-tvshow--light {
    background: #fff;
    color: #1f2937;
    border: 1px solid rgba(7, 36, 86, 0.075);
    border-radius: 3px;
    box-shadow: 0 2px 4px 0 rgba(7, 36, 86, 0.075);
}

.hp-tvshow--light .hp-tvshow-header {
    background: #f8fafc;
    border-bottom: 1px solid rgba(7, 36, 86, 0.075);
}

.hp-tvshow--light .hp-tvshow-channel-name {
    color: #1f2937;
}

.hp-tvshow--light .hp-tvshow-separator {
    color: #9ca3af;
}

.hp-tvshow--light .hp-tvshow-program-title {
    color: #6b7280;
}

.hp-tvshow--light .hp-tvshow-online {
    color: #9ca3af;
}

.hp-tvshow--light .hp-tvshow-player-wrapper {
    background: #111;
}

.hp-tvshow--light .hp-tvshow-channels-wrapper {
    background: #fcfdfe;
    border-color: rgba(7, 36, 86, 0.075);
}

.hp-tvshow--light .hp-tvshow-channels-heading {
    color: #6b7280;
    border-bottom: 1px solid rgba(7, 36, 86, 0.075);
}

.hp-tvshow--light .hp-tvshow-channel-item {
    border-bottom: 1px solid rgba(7, 36, 86, 0.04);
    background: #fff;
}

.hp-tvshow--light .hp-tvshow-channel-item:hover {
    background: rgba(7, 36, 86, 0.02);
}

.hp-tvshow--light .hp-tvshow-channel-item.active {
    background: rgba(21, 116, 225, 0.05);
    border-left-color: #1574e1;
}

.hp-tvshow--light .hp-tvshow-channel-thumb {
    background: #f1f5f9;
}

.hp-tvshow--light .hp-tvshow-channel-title {
    color: #1e293b;
}

.hp-tvshow--light .hp-tvshow-channel-subtitle {
    color: #64748b;
}

.hp-tvshow--light .hp-tvshow-channel-item.active .hp-tvshow-channel-title {
    color: #1574e1;
}

.hp-tvshow--light .hp-tvshow-footer {
    color: #94a3b8;
    border-top: 1px solid rgba(7, 36, 86, 0.075);
}

.hp-tvshow--light .hp-tvshow-footer a {
    color: #1574e1;
}

.hp-tvshow--light .hp-tvshow-footer a:hover {
    color: #1d4ed8;
}

.hp-tvshow--light .hp-tvshow-placeholder {
    color: #94a3b8;
    border: 1px dashed rgba(7, 36, 86, 0.1);
}

.hp-tvshow--light .hp-tvshow-no-thumb {
    color: #cbd5e1;
}

.hp-tvshow--light .hp-tvshow-theme-icon--dark {
    display: none;
}

.hp-tvshow--light .hp-tvshow-theme-icon--light {
    display: inline;
}

/* ============= SHARED STRUCTURAL ============= */
.hp-tvshow-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hp-tvshow-now-playing {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    min-width: 0;
}

.hp-tvshow-live-badge {
    background: #ef4444;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: hp-tv-pulse 2s ease-in-out infinite;
    white-space: nowrap;
    text-transform: uppercase;
}

@keyframes hp-tv-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.hp-tvshow-channel-name {
    font-weight: 700;
    white-space: nowrap;
}

.hp-tvshow-program-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.hp-tvshow-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hp-tvshow-online {
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.hp-tvshow-online-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: hp-tv-dot-blink 2s ease-in-out infinite;
}

@keyframes hp-tv-dot-blink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 4px #22c55e;
    }

    50% {
        opacity: 0.4;
        box-shadow: none;
    }
}

/* Theme Toggle Button */
.hp-tvshow-theme-toggle {
    background: none;
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1rem;
    line-height: 1;
    transition: border-color 0.2s, transform 0.2s;
}

.hp-tvshow-theme-toggle:hover {
    border-color: rgba(128, 128, 128, 0.6);
    transform: scale(1.1);
}

/* ============= LAYOUT: COMMON MAIN ============= */
.hp-tvshow-main {
    display: flex;
    flex-direction: column;
}

.hp-tvshow-player-wrapper {
    flex: 1;
    position: relative;
    min-height: 300px;
}

@media (min-width: 992px) {
    .hp-tvshow-player-wrapper {
        min-height: 480px;
    }
}

.hp-tvshow-player-container {
    width: 100%;
    height: 100%;
    /* position: relative; */
    display: flex;
    align-items: center;
    justify-content: center;
}

.hp-tvshow-player-container iframe,
.hp-tvshow-player-container video {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    position: absolute;
    top: 0;
    left: 0;
}

/* ============= CHANNELS WRAPPER ============= */
.hp-tvshow-channels-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.hp-tvshow-channels-heading {
    padding: 16px 30px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    border-bottom: 1px solid;
    flex-shrink: 0;
}

.hp-tvshow-channels-scroll {
    overflow: visible;
    padding: 30px !important;
    /* Added premium padding */
}

/* Fix HivePress Grid edges inside the container */
.hp-tvshow-channels-scroll .hp-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.hp-tvshow-channels-scroll [class*="hp-col-"] {
    padding: 0 10px !important;
    margin-bottom: 20px;
}

/* ---- Channel Item ---- */
.hp-tvshow-channel-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    gap: 14px;
    height: 100%;
    box-shadow: 0 2px 4px rgba(7, 36, 86, 0.05);
}

.hp-tvshow-channel-item.active {
    border-left: 4px solid;
}

.hp-tvshow-channel-thumb {
    width: 72px;
    height: 44px;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hp-tvshow-channel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hp-tvshow-channel-item:hover .hp-tvshow-channel-thumb img {
    transform: scale(1.1);
}

.hp-tvshow-no-thumb {
    font-size: 1.4rem;
}

.hp-tvshow-channel-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hp-tvshow-channel-title {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-tvshow-channel-subtitle {
    font-size: 0.78rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============= LAYOUT: SIDEBAR ============= */
@media (min-width: 992px) {
    .hp-tvshow--layout-sidebar .hp-tvshow-main {
        flex-direction: row;
    }

    .hp-tvshow--layout-sidebar .hp-tvshow-channels-wrapper {
        width: 320px;
        min-width: 320px;
        border-left: 1px solid rgba(128, 128, 128, 0.1);
    }

    .hp-tvshow--layout-sidebar .hp-tvshow-channels-scroll {
        overflow-y: auto;
        max-height: 520px;
        padding: 15px !important;
    }

    .hp-tvshow--layout-sidebar .hp-tvshow-channels-scroll .hp-row {
        display: block;
        margin: 0;
    }

    .hp-tvshow--layout-sidebar .hp-tvshow-channels-scroll [class*="hp-col-"] {
        width: 100%;
        padding: 0 !important;
    }

    .hp-tvshow--layout-sidebar .hp-tvshow-channel-item {
        margin-bottom: 8px;
        border-bottom: 2px solid rgba(128, 128, 128, 0.06);
    }
}

/* ============= LAYOUT: BOTTOM (GRID) ============= */
.hp-tvshow--layout-bottom .hp-tvshow-channels-wrapper {
    border-top: 1px solid rgba(128, 128, 128, 0.1);
}

.hp-tvshow--layout-bottom .hp-tvshow-channel-item {
    margin-bottom: 0px;
    /* Spacing handled by hp-col padding */
}

/* ============= FOOTER ============= */
.hp-tvshow-footer {
    padding: 18px 20px;
    text-align: center;
    font-size: 0.75rem;
    border-top: 1px solid;
    opacity: 0.6;
}

.hp-tvshow-footer a {
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
}

/* ============= MOBILE REFINEMENT ============= */
@media (max-width: 991px) {
    .hp-tvshow-channels-scroll {
        padding: 15px !important;
    }

    .hp-tvshow-channels-scroll .hp-row {
        margin: 0 -8px !important;
    }

    .hp-tvshow-channels-scroll [class*="hp-col-"] {
        padding: 0 8px !important;
        margin-bottom: 12px;
    }

    .hp-tvshow-channel-item {
        padding: 10px 14px;
        gap: 12px;
    }

    .hp-tvshow-channel-thumb {
        width: 54px;
        height: 34px;
    }
}

/* TV Program Modal */
.hp-tvshow-program-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .hp-tvshow-program-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .hp-tvshow-program-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hp-tvshow-program-grid {
        grid-template-columns: 1fr;
    }
}

.hp-tvshow-program-channel {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.hp-tvshow-program-channel-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.hp-tvshow-program-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 60vh;
}

.hp-tvshow-program-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.hp-tvshow-program-item:hover {
    background: #f9f9f9;
}

.hp-tvshow-program-item--current {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    font-weight: 600;
}

.hp-tvshow-program-item--current:hover {
    background: #bbdefb;
}

.hp-tvshow-program-item--past {
    opacity: 0.4;
}

.hp-tvshow-program-time {
    color: #666;
    font-size: 0.85em;
    font-weight: 600;
}

.hp-tvshow-program-title {
    font-size: 0.9em;
    line-height: 1.3;
}

.hp-tvshow--dark .hp-tvshow-program-channel {
    border-color: #444;
    background: #1a1a1a;
}

.hp-tvshow--dark .hp-tvshow-program-channel-header {
    background: #2a2a2a;
    border-bottom-color: #444;
}

.hp-tvshow--dark .hp-tvshow-program-item {
    border-bottom-color: #333;
}

.hp-tvshow--dark .hp-tvshow-program-item:hover {
    background: #2a2a2a;
}

.hp-tvshow--dark .hp-tvshow-program-item--current {
    background: #1a3a52;
    border-left-color: #42a5f5;
}

.hp-tvshow--dark .hp-tvshow-program-item--current:hover {
    background: #2a4a62;
}

.hp-tvshow--dark .hp-tvshow-program-time {
    color: #aaa;
}

/* Wide modal for TV Program */
.fancybox-container .hp-modal--wide {
    max-width: 90vw !important;
    width: 90vw !important;
}

@media (max-width: 767px) {
    .fancybox-container .hp-modal--wide {
        max-width: 95vw !important;
        width: 95vw !important;
    }
}
