/* public/assets/css/video/m3u-iptv-player.css */

.iptv-wrapper { padding: 32px; border-radius: var(--radius-lg); }
.iptv-header { text-align: center; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 24px; }
.iptv-title { font-size: 1.8rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.iptv-subtitle { font-size: 1rem; color: var(--text-muted); max-width: 800px; margin: 0 auto; line-height: 1.6; }

/* 顶部输入区 */
.iptv-controls-top { background: var(--bg-surface); padding: 24px; border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); margin-bottom: 24px; }
.iptv-label { font-weight: 700; color: var(--text-main); font-size: 1.05rem; display: block; margin-bottom: 12px; }
.iptv-input-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.iptv-input { flex: 1; min-width: 250px; padding: 12px 16px; border: 2px solid var(--border-color); border-radius: 10px; font-size: 1rem; background: var(--bg-body); color: var(--text-main); outline: none; transition: 0.2s; font-family: monospace; }
.iptv-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15); }
.iptv-btn-primary { background: var(--primary-color); color: #fff; border: none; padding: 12px 24px; border-radius: 10px; font-size: 1.05rem; font-weight: bold; cursor: pointer; transition: 0.3s; white-space: nowrap; }
.iptv-btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 15px rgba(var(--primary-rgb), 0.3); }
.iptv-divider { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; padding: 0 8px; }
.iptv-btn-secondary { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border-color); padding: 12px 20px; border-radius: 10px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: 0.2s; white-space: nowrap; }
.iptv-btn-secondary:hover { border-color: var(--primary-color); color: var(--primary-color); }

.iptv-test-streams { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.iptv-test-badge { padding: 4px 10px; font-size: 0.8rem; background: rgba(0, 102, 204, 0.08); color: var(--primary-color); border: 1px solid rgba(0, 102, 204, 0.15); border-radius: 6px; cursor: pointer; transition: 0.2s; font-weight: 500; }
.iptv-test-badge:hover { background: var(--primary-color); color: #fff; transform: translateY(-1px); }

/* 主工作区布局 (左侧列表，右侧视频) */
.iptv-workspace { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }

/* 侧边栏频道列表 */
.iptv-sidebar { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; display: flex; flex-direction: column; height: 600px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
.iptv-sidebar-header { padding: 16px; border-bottom: 1px solid var(--border-color); }
.iptv-search-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-body); font-size: 0.95rem; color: var(--text-main); outline: none; transition: 0.2s; box-sizing: border-box; }
.iptv-search-input:focus { border-color: var(--primary-color); }

.iptv-tabs { display: flex; border-bottom: 1px solid var(--border-color); background: var(--bg-body); }
.iptv-tab { flex: 1; padding: 12px 0; text-align: center; background: none; border: none; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: 0.2s; border-bottom: 2px solid transparent; }
.iptv-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); background: var(--bg-surface); }

.iptv-channel-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.iptv-empty-state { text-align: center; padding: 40px 20px; font-size: 0.9rem; color: #94a3b8; line-height: 1.6; }

/* 单个频道项 UI */
.iptv-channel-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; background: var(--bg-surface); }
.iptv-channel-item:hover { background: var(--bg-body); border-color: var(--border-color); }
.iptv-channel-item.playing { background: rgba(0, 102, 204, 0.08); border-color: rgba(0, 102, 204, 0.2); }
.iptv-channel-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.iptv-channel-logo { width: 32px; height: 32px; border-radius: 6px; background: #e2e8f0; object-fit: contain; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #94a3b8; overflow: hidden; }
.iptv-channel-logo img { width: 100%; height: 100%; object-fit: contain; }
.iptv-channel-text { display: flex; flex-direction: column; min-width: 0; }
.iptv-channel-name { font-weight: 600; font-size: 0.95rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iptv-channel-group { font-size: 0.75rem; color: var(--text-muted); background: var(--bg-body); padding: 2px 6px; border-radius: 4px; display: inline-block; width: fit-content; margin-top: 2px; }
.iptv-btn-fav { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #cbd5e1; transition: 0.2s; padding: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.iptv-btn-fav:hover { transform: scale(1.2); }
.iptv-btn-fav.is-fav { color: #f59e0b; }

/* 播放器区域 */
.iptv-main-player { display: flex; flex-direction: column; gap: 16px; }
.iptv-status-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); flex-wrap: wrap; gap: 12px; }
.iptv-now-playing { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.iptv-np-label { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
.iptv-np-name { font-weight: 800; color: var(--primary-color); }

.iptv-status-box { padding: 6px 12px; background: rgba(148, 163, 184, 0.1); border-radius: 20px; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border-color); }
.iptv-status-box.error { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.iptv-status-box.success { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }

.iptv-video-container { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000000; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3); border: 1px solid var(--border-color); }
.iptv-video { width: 100%; height: 100%; object-fit: contain; outline: none; }
.iptv-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b, #0f172a); z-index: 10; transition: opacity 0.3s; pointer-events: none; }
.iptv-play-icon { font-size: 4rem; color: rgba(255,255,255,0.2); }

.iptv-url-display { display: flex; align-items: center; gap: 8px; background: var(--bg-surface); padding: 12px; border-radius: 12px; border: 1px solid var(--border-color); }
.iptv-url-display input { flex: 1; border: none; background: transparent; font-family: monospace; font-size: 0.85rem; color: var(--text-muted); outline: none; }
.iptv-url-display button { background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 0.9rem; transition: 0.2s; }
.iptv-url-display button:hover { background: rgba(0,102,204,0.1); color: var(--primary-color); border-color: var(--primary-color); }

@media (max-width: 900px) {
    .iptv-workspace { grid-template-columns: 1fr; }
    .iptv-sidebar { height: 400px; order: 2; }
    .iptv-main-player { order: 1; }
}
@media (max-width: 768px) {
    .iptv-wrapper { padding: 20px 16px; }
    .iptv-input-row { flex-direction: column; align-items: stretch; }
}

/* 深色模式 */
[data-theme="dark"] .iptv-input, [data-theme="dark"] .iptv-search-input { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .iptv-controls-top, [data-theme="dark"] .iptv-sidebar, [data-theme="dark"] .iptv-status-bar, [data-theme="dark"] .iptv-url-display { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .iptv-btn-secondary { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .iptv-test-badge { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: #cbd5e1; }
[data-theme="dark"] .iptv-test-badge:hover { background: var(--primary-color); color: #fff; }
[data-theme="dark"] .iptv-channel-item { background: #1e293b; }
[data-theme="dark"] .iptv-channel-item:hover { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .iptv-channel-item.playing { background: rgba(37,99,235,0.15); border-color: rgba(37,99,235,0.3); }
[data-theme="dark"] .iptv-tabs { border-color: #334155; background: #0f172a; }
[data-theme="dark"] .iptv-tab.active { background: #1e293b; }
[data-theme="dark"] .iptv-status-box.error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
[data-theme="dark"] .iptv-status-box.success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); }

/* 悬浮字幕层 */
.iptv-sub-overlay { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); width: 90%; text-align: center; pointer-events: none; z-index: 20; display: flex; flex-direction: column; gap: 6px; }
.iptv-sub-line { display: inline-block; padding: 4px 12px; background: rgba(0, 0, 0, 0.75); color: #ffffff; border-radius: 6px; font-size: 1.1rem; font-weight: 600; line-height: 1.4; backdrop-filter: blur(4px); text-shadow: 0 1px 2px rgba(0,0,0,0.8); margin: 0 auto; width: fit-content; max-width: 100%; word-wrap: break-word; }
.iptv-sub-trans { color: #fde047; font-size: 1.2rem; }

/* 翻译控制栏 */
.iptv-trans-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; background: var(--bg-surface); padding: 12px 16px; border: 1px solid var(--border-color); border-radius: 12px; }
.iptv-trans-group { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.iptv-trans-select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-main); font-size: 0.9rem; outline: none; }
.iptv-btn-outline { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; transition: 0.2s; }
.iptv-btn-outline:hover { color: var(--primary-color); border-color: var(--primary-color); }

/* Switch Toggle UI */
.iptv-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.iptv-switch input { opacity: 0; width: 0; height: 0; }
.iptv-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 24px; }
.iptv-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.iptv-switch input:checked + .iptv-slider { background-color: var(--primary-color); }
.iptv-switch input:checked + .iptv-slider:before { transform: translateX(20px); }

[data-theme="dark"] .iptv-trans-toolbar { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .iptv-trans-select { background: #0f172a; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .iptv-btn-outline { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .iptv-slider { background-color: #475569; }