/* IPTV player. Full-height shell under the shared site nav. */

body.iptv-body {
    --iptv-accent: var(--accent-color);
    --iptv-panel: var(--bg-secondary);
    --iptv-line: color-mix(in srgb, var(--text-primary) 12%, transparent);
    --iptv-stage: #0b0d12;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

body.iptv-body nav {
    padding: 0.55rem 0;
}

body.iptv-body .nav-container {
    max-width: 1440px;
}

body.iptv-body .nav-links {
    gap: 1.05rem;
    font-size: 0.92rem;
}

body.iptv-body main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
}

body.iptv-body footer {
    display: none;
}

.iptv-app {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.iptv-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 16px;
    background: var(--iptv-panel);
    border-bottom: 1px solid var(--iptv-line);
}

.iptv-title {
    font-size: 1.15rem;
    letter-spacing: -0.03em;
    margin: 0;
}

.iptv-load {
    display: flex;
    flex: 1 1 280px;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.iptv-load input[type="url"] {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.95rem;
}

.iptv-load input[type="url"]:focus {
    outline: 2px solid color-mix(in srgb, var(--iptv-accent) 55%, transparent);
    border-color: var(--iptv-accent);
}

.iptv-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.iptv-btn:hover {
    border-color: var(--iptv-accent);
}

.iptv-btn.primary {
    background: var(--iptv-accent);
    border-color: var(--iptv-accent);
    color: #fff;
}

.iptv-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.iptv-file {
    position: relative;
    overflow: hidden;
}

.iptv-file input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.iptv-status {
    flex: 1 1 100%;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    min-height: 1.2em;
}

.iptv-stage {
    flex: 1;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    display: flex;
}

.iptv-list-wrap {
    width: 340px;
    flex: none;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--iptv-panel);
    border-right: 1px solid var(--iptv-line);
}

.iptv-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid var(--iptv-line);
}

.iptv-filters input,
.iptv-filters select {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.92rem;
}

.iptv-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0;
}

.iptv-window {
    position: relative;
    width: 100%;
}

.iptv-channel {
    position: absolute;
    left: 6px;
    right: 6px;
    height: 46px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font: inherit;
}

.iptv-channel:hover,
.iptv-channel:focus-visible {
    background: color-mix(in srgb, var(--iptv-accent) 12%, transparent);
    outline: none;
}

.iptv-channel.active {
    background: color-mix(in srgb, var(--iptv-accent) 18%, transparent);
}

.iptv-mark {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 8px;
    background: color-mix(in srgb, var(--iptv-accent) 80%, #111);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    overflow: hidden;
}

.iptv-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.iptv-channel-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.iptv-channel-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iptv-channel-meta {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iptv-empty-list {
    margin: 18px 12px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.iptv-watch {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--iptv-stage);
    color: #f4f4f5;
}

.iptv-screen {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iptv-screen video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    background: #000;
    object-fit: contain;
}

.iptv-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 24px;
    color: #a1a1aa;
    background: rgba(11, 13, 18, 0.55);
    pointer-events: none;
}

.iptv-placeholder[hidden] {
    display: none;
}

.iptv-placeholder strong {
    display: block;
    color: #f4f4f5;
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.iptv-now {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 10px 14px 12px;
    background: #111318;
}

.iptv-now-name {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.iptv-now-note,
.iptv-error {
    margin: 0;
    color: #a1a1aa;
    font-size: 0.85rem;
}

.iptv-error {
    color: #fda4af;
}

@media (max-width: 860px) {
    body.iptv-body nav {
        padding: 0.35rem 0;
    }

    body.iptv-body .nav-links {
        gap: 0.45rem 0.7rem;
        font-size: 0.8rem;
    }

    .iptv-load input[type="url"] {
        flex: 1 1 100%;
    }

    .iptv-stage {
        flex-direction: column;
    }

    .iptv-watch {
        order: -1;
        flex: none;
        width: 100%;
        height: 38vh;
        height: 38dvh;
    }

    .iptv-list-wrap {
        width: 100%;
        flex: 1;
        border-right: 0;
        border-top: 1px solid var(--iptv-line);
    }
}
