/**
 * News Channel Directory & StreamOTT Platform - Player Stylesheet
 * Engineered & Developed by Shaurya R Joshi.
 *
 * Cinema-style HLS video player with theatre mode, custom controls,
 * channel switcher slider, and smooth responsive design.
 *
 * @package NewsChannelDirectory
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

/* =============================================
   Player Page Base
   ============================================= */
.ncd-player-page {
    margin: 0;
    padding: 0;
    background: #06070a;
    color: #f3f4f6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.ncd-player-page *,
.ncd-player-page *::before,
.ncd-player-page *::after {
    box-sizing: border-box;
}

/* =============================================
   Cinema Subheader / Breadcrumbs
   ============================================= */
.ncd-player-subbar {
    background: rgba(14, 17, 24, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.ncd-subbar-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.ncd-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.ncd-back-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.ncd-subbar-channel-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-weight: 600;
}

.ncd-subbar-cat {
    color: #cbd5e1;
}

.ncd-subbar-res {
    color: #00e5ff;
}

.ncd-subbar-by {
    color: #e50914;
}

.ncd-subbar-sep {
    color: #334155;
}

/* =============================================
   Player Main Section
   ============================================= */
.ncd-player-main {
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 60px;
    transition: all 0.3s ease;
}

/* Theatre Mode Active State */
body.ncd-theatre-active .ncd-player-main {
    max-width: 100% !important;
    padding: 0 0 40px !important;
}

body.ncd-theatre-active .ncd-player-container {
    max-width: 100% !important;
    border-radius: 0 !important;
}

body.ncd-theatre-active .ncd-player-wrapper {
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.ncd-theatre-active .ncd-channel-info-bar,
body.ncd-theatre-active .ncd-related-section {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 28px;
    padding-right: 28px;
}

/* =============================================
   Player Container & Screen
   ============================================= */
.ncd-player-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ncd-player-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    background: #000000;
    overflow: hidden;
}

.ncd-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

/* Center Big Play Button Ripple */
.ncd-player-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(229, 9, 20, 0.88);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(229, 9, 20, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.ncd-player-center-play.ncd-play-animate {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
}

/* Overlays (Loading & Offline) */
.ncd-player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(6, 7, 10, 0.92);
    z-index: 8;
    backdrop-filter: blur(8px);
    gap: 16px;
    color: #f3f4f6;
    padding: 24px;
    text-align: center;
}

.ncd-loading-spinner {
    width: 56px;
    height: 56px;
    position: relative;
}

.ncd-spinner-circle {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: ncdSpin 0.9s linear infinite;
}

.ncd-loading-text {
    font-size: 15px;
    font-weight: 600;
    color: #cbd5e1;
}

.ncd-offline-icon svg {
    color: #ef4444;
    filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.5));
}

.ncd-offline-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
}

.ncd-offline-text {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
    max-width: 420px;
}

.ncd-retry-indicator {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.ncd-retry-progress {
    width: 0%;
    height: 100%;
    background: #e50914;
    transition: width 1s linear;
}

.ncd-btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    background: #e50914;
    color: #ffffff;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4);
    transition: all 0.2s ease;
}

.ncd-btn-retry:hover {
    background: #ff1e27;
    transform: translateY(-1px);
}

/* =============================================
   Player Controls Bar (Modern Cinema Overlay)
   ============================================= */
.ncd-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 12;
}

.ncd-player-container:hover .ncd-player-controls,
.ncd-player-container.ncd-controls-visible .ncd-player-controls {
    opacity: 1;
}

.ncd-controls-left,
.ncd-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ncd-ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ncd-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

.ncd-ctrl-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Volume Slider */
.ncd-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ncd-volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ncd-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e50914;
    cursor: pointer;
    box-shadow: 0 0 6px #e50914;
}

.ncd-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e50914;
    border: none;
    cursor: pointer;
}

/* Live Badge on Controls */
.ncd-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(229, 9, 20, 0.2);
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: #ff3b30;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.ncd-live-pulse-sm {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e50914;
    box-shadow: 0 0 8px #e50914;
    animation: ncdPulseDot 1.2s infinite;
}

.ncd-stream-res-chip {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #00e5ff;
    font-size: 11px;
    font-weight: 700;
}

/* =============================================
   Channel Detailed Info & Actions Bar
   ============================================= */
.ncd-channel-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    background: rgba(18, 22, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    flex-wrap: wrap;
}

.ncd-channel-info-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ncd-channel-info-logo-wrap {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    background: #090b10;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.ncd-channel-info-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ncd-info-badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.ncd-channel-info-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 9999px;
    background: #e50914;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.ncd-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    animation: ncdPulseWhite 1.2s infinite;
}

.ncd-res-pill {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    font-size: 11px;
    font-weight: 700;
}

.ncd-cat-pill {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
}

.ncd-channel-info-name {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.ncd-channel-info-sub {
    font-size: 13px;
    color: #94a3b8;
    margin: 4px 0 0;
}

.ncd-channel-info-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ncd-stream-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ncd-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

.ncd-btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ncd-btn-share:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

/* =============================================
   Related Channels Slider (OTT Switcher Rail)
   ============================================= */
.ncd-related-section {
    margin-top: 48px;
}

.ncd-related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.ncd-related-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ncd-related-curator {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.ncd-related-slider {
    position: relative;
    display: flex;
    align-items: center;
}

.ncd-related-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 6px 2px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.ncd-related-track::-webkit-scrollbar {
    height: 6px;
}

.ncd-related-track::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}

.ncd-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 17, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
}

.ncd-slider-btn:hover {
    background: #e50914;
    border-color: #e50914;
    transform: translateY(-50%) scale(1.1);
}

.ncd-slider-prev {
    left: -20px;
}

.ncd-slider-next {
    right: -20px;
}

.ncd-related-card {
    flex: 0 0 200px;
    background: #11141e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ncd-related-card:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.ncd-related-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #080a10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}

.ncd-related-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ncd-related-res {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #00e5ff;
    font-size: 9px;
    font-weight: 700;
}

.ncd-related-play-icon {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ncd-related-card:hover .ncd-related-play-icon {
    opacity: 1;
}

.ncd-related-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ncd-related-cat {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}

.ncd-related-name {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================================
   Toast Notification
   ============================================= */
.ncd-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 20px;
    border-radius: 9999px;
    background: #10b981;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    animation: ncdToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ncdToastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .ncd-channel-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .ncd-channel-info-name {
        font-size: 20px;
    }
    .ncd-slider-prev {
        left: -8px;
    }
    .ncd-slider-next {
        right: -8px;
    }
}

@media (max-width: 640px) {
    .ncd-subbar-inner { padding: 8px 14px; min-height: 44px; }
    .ncd-subbar-channel-meta { display: none; }
    .ncd-back-btn { min-height: 38px; padding: 6px 10px; }
    .ncd-player-main { padding: 14px 0 36px; }
    .ncd-player-container { border-radius: 0; border-left: 0; border-right: 0; }
    .ncd-channel-info-bar, .ncd-related-section { padding-left: 14px; padding-right: 14px; }
    .ncd-player-controls { height: 58px; padding: 0 10px; opacity: 1; }
    .ncd-controls-left, .ncd-controls-right { gap: 6px; }
    .ncd-ctrl-btn { width: 42px; height: 42px; }
    .ncd-volume-container, .ncd-live-indicator { display: none; }
    .ncd-player-center-play { width: 58px; height: 58px; }
    .ncd-related-card { flex-basis: 154px; }
    .ncd-slider-btn { width: 38px; height: 38px; }
    .ncd-toast { right: 14px; bottom: 14px; left: 14px; justify-content: center; text-align: center; }
}
