/* BFPlayer — HTML5 Video Player for BigFilm.tv */

.bfp-container {
    position: relative;
    width: 1000px;
    height: 480px;
    background: #000;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.bfp-container * {
    box-sizing: border-box;
}

.bfp-container:fullscreen,
.bfp-container:-webkit-full-screen,
.bfp-container:-moz-full-screen {
    width: 100% !important;
    height: 100% !important;
}

.bfp-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.bfp-video-live {
    object-fit: cover;
}

/* Click overlay for play/pause */
.bfp-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 44px);
    z-index: 2;
    cursor: pointer;
}

/* Controls bar */
.bfp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 44px;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 10;
    transition: opacity 0.3s;
}

.bfp-container.bfp-idle .bfp-controls {
    opacity: 0;
    pointer-events: none;
}

.bfp-container.bfp-idle .bfp-click-overlay {
    height: 100%;
}

.bfp-container.bfp-idle {
    cursor: none;
}

/* Buttons */
.bfp-btn {
    background: none;
    border: none;
    color: #dcdcdc;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    line-height: 1;
    outline: none;
    opacity: 0.85;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.bfp-btn:hover {
    opacity: 1;
    color: #6dcff6;
}

.bfp-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    vertical-align: middle;
}

/* Play/Pause button */
.bfp-play-btn svg {
    width: 22px;
    height: 22px;
}

/* Seek bar area */
.bfp-seek-area {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 8px;
    min-width: 0;
}

.bfp-seek-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
}

.bfp-seek-bar:hover {
    height: 8px;
}

.bfp-seek-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    pointer-events: none;
}

.bfp-seek-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #6dcff6;
    border-radius: 3px;
    pointer-events: none;
}

.bfp-seek-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #6dcff6;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.bfp-seek-bar:hover .bfp-seek-thumb {
    opacity: 1;
}

.bfp-seek-tooltip {
    position: absolute;
    bottom: 18px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #dcdcdc;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    display: none;
}

.bfp-seek-bar:hover .bfp-seek-tooltip {
    display: block;
}

/* Time display */
.bfp-time {
    color: #dcdcdc;
    font-size: 12px;
    white-space: nowrap;
    padding: 0 8px;
    flex-shrink: 0;
}

/* Live indicator */
.bfp-live-indicator {
    display: flex;
    align-items: center;
    padding: 0 10px;
    flex: 1;
}

.bfp-live-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    margin-right: 6px;
    animation: bfp-pulse 1.5s infinite;
}

@keyframes bfp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.bfp-live-text {
    color: #e74c3c;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Volume */
.bfp-volume-area {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.bfp-volume-slider {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    margin-right: 4px;
}

.bfp-volume-level {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #6dcff6;
    border-radius: 2px;
    pointer-events: none;
}

/* Menus (quality, audio, subtitles) */
.bfp-menu-btn {
    position: relative;
}

.bfp-menu {
    position: absolute;
    bottom: 44px;
    right: 0;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-width: 140px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 20;
}

.bfp-menu.bfp-menu-open {
    display: block;
}

.bfp-menu-item {
    padding: 8px 14px;
    color: #dcdcdc;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.bfp-menu-item:hover {
    background: rgba(109, 207, 246, 0.15);
    color: #6dcff6;
}

.bfp-menu-item.bfp-active {
    color: #6dcff6;
}

.bfp-menu-item.bfp-active::before {
    content: "\2713 ";
}

/* Subtitle overlay */
.bfp-subtitle-overlay {
    position: absolute;
    bottom: 54px;
    left: 10%;
    width: 80%;
    text-align: center;
    z-index: 5;
    pointer-events: none;
}

.bfp-subtitle-text {
    display: inline;
    background: rgba(0, 0, 0, 0.75);
    color: #dfdfdf;
    font-size: 22px;
    line-height: 1.4;
    padding: 4px 10px;
    border-radius: 3px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Fullscreen subtitle sizing */
.bfp-container:fullscreen .bfp-subtitle-text,
.bfp-container:-webkit-full-screen .bfp-subtitle-text,
.bfp-container:-moz-full-screen .bfp-subtitle-text {
    font-size: 28px;
}

/* Loading spinner */
.bfp-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 8;
    display: none;
}

.bfp-loading.bfp-show {
    display: block;
}

.bfp-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #6dcff6;
    border-radius: 50%;
    animation: bfp-spin 0.8s linear infinite;
}

@keyframes bfp-spin {
    to { transform: rotate(360deg); }
}

/* Error overlay */
.bfp-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 15;
    color: #dcdcdc;
    font-size: 15px;
    text-align: center;
    padding: 20px;
}

.bfp-error.bfp-show {
    display: flex;
}

.bfp-error-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.bfp-error-text {
    margin-bottom: 16px;
}

.bfp-error-retry {
    background: #6dcff6;
    color: #000;
    border: none;
    padding: 8px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.bfp-error-retry:hover {
    background: #8dddf8;
}

/* Copyright text */
.bfp-copyright {
    position: absolute;
    top: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    z-index: 3;
    pointer-events: none;
}

/* PIN overlay for 18+ */
.bfp-pin-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 25;
    color: #dcdcdc;
}

.bfp-pin-overlay.bfp-show {
    display: flex;
}

.bfp-pin-title {
    font-size: 18px;
    margin-bottom: 8px;
}

.bfp-pin-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}

.bfp-pin-input {
    width: 160px;
    padding: 10px;
    font-size: 20px;
    text-align: center;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    letter-spacing: 8px;
    outline: none;
}

.bfp-pin-input:focus {
    border-color: #6dcff6;
}

.bfp-pin-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

/* Big play button (initial state) */
.bfp-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.bfp-big-play:hover {
    background: rgba(109, 207, 246, 0.25);
    border-color: #6dcff6;
}

.bfp-big-play svg {
    width: 32px;
    height: 32px;
    fill: #fff;
    margin-left: 4px;
}

.bfp-big-play.bfp-hidden {
    display: none;
}

/* Poster */
.bfp-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.bfp-poster.bfp-hidden {
    display: none;
}

/* ===== Channel Guide ===== */

/* Guide toggle button (top-left of player) */
.bfp-guide-toggle {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: #dcdcdc;
    opacity: 0;
    transition: opacity 0.3s;
}

.bfp-container:hover .bfp-guide-toggle,
.bfp-guide-toggle:focus {
    opacity: 0.85;
}

.bfp-guide-toggle:hover {
    opacity: 1;
    color: #6dcff6;
    background: rgba(0, 0, 0, 0.7);
}

.bfp-guide-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    vertical-align: middle;
}

.bfp-container.bfp-idle .bfp-guide-toggle {
    opacity: 0;
    pointer-events: none;
}

/* Guide overlay (full player area) */
.bfp-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
}

.bfp-guide-overlay.bfp-show {
    display: flex;
}

/* Guide panel */
.bfp-guide-panel {
    width: 94%;
    height: 88%;
    background: rgba(20, 20, 25, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Guide header */
.bfp-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.bfp-guide-title {
    color: #6dcff6;
    font-size: 15px;
    font-weight: bold;
}

.bfp-guide-close {
    font-size: 22px;
    line-height: 1;
    padding: 2px 8px;
}

/* Guide body (sidebar + list) */
.bfp-guide-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar (groups) */
.bfp-guide-sidebar {
    width: 150px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 0;
}

.bfp-guide-group {
    padding: 8px 12px;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bfp-guide-group:hover {
    background: rgba(109, 207, 246, 0.1);
    color: #dcdcdc;
}

.bfp-guide-group.bfp-active {
    color: #6dcff6;
    background: rgba(109, 207, 246, 0.12);
}

/* Channel list */
.bfp-guide-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.bfp-guide-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Channel row */
.bfp-guide-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.bfp-guide-row:hover {
    background: rgba(109, 207, 246, 0.08);
}

.bfp-guide-row.bfp-guide-current {
    background: rgba(109, 207, 246, 0.15);
}

/* Channel info column */
.bfp-guide-ch-info {
    display: flex;
    align-items: center;
    width: 240px;
    flex-shrink: 0;
}

.bfp-guide-ch-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.bfp-guide-ch-name {
    color: #dcdcdc;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bfp-guide-current .bfp-guide-ch-name {
    color: #6dcff6;
    font-weight: bold;
}

/* EPG column */
.bfp-guide-epg {
    flex: 1;
    min-width: 0;
    padding-left: 12px;
}

.bfp-guide-epg-now {
    color: #ccc;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bfp-guide-epg-next {
    color: #777;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Fullscreen adjustments */
.bfp-container:fullscreen .bfp-guide-ch-icon,
.bfp-container:-webkit-full-screen .bfp-guide-ch-icon {
    width: 44px;
    height: 44px;
}

.bfp-container:fullscreen .bfp-guide-ch-name,
.bfp-container:-webkit-full-screen .bfp-guide-ch-name {
    font-size: 15px;
}

.bfp-container:fullscreen .bfp-guide-epg-now,
.bfp-container:-webkit-full-screen .bfp-guide-epg-now {
    font-size: 14px;
}

.bfp-container:fullscreen .bfp-guide-sidebar,
.bfp-container:-webkit-full-screen .bfp-guide-sidebar {
    width: 200px;
}

/* Scrollbar styling for guide */
.bfp-guide-sidebar::-webkit-scrollbar,
.bfp-guide-list::-webkit-scrollbar {
    width: 6px;
}

.bfp-guide-sidebar::-webkit-scrollbar-track,
.bfp-guide-list::-webkit-scrollbar-track {
    background: transparent;
}

.bfp-guide-sidebar::-webkit-scrollbar-thumb,
.bfp-guide-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
