/* WP IPTV Player - Frontend */

.wpiptv-player {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    color: #e2e8f0;
    -webkit-font-smoothing: antialiased;
}

/* Category Tabs */
.wpiptv-categories {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: #0f172a;
    border-radius: 14px 14px 0 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.wpiptv-categories::-webkit-scrollbar { display: none; }
.wpiptv-cat-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 20px;
    background: #1e293b;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}
.wpiptv-cat-btn:hover { background: #334155; color: #e2e8f0; }
.wpiptv-cat-btn.active {
    background: var(--wpiptv-primary, #6366f1);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,0.4);
}

/* Main Layout */
.wpiptv-main {
    display: grid;
    background: #0f172a;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
}
.wpiptv-layout-sidebar .wpiptv-main {
    grid-template-columns: 1fr 320px;
}
.wpiptv-layout-bottom .wpiptv-main {
    grid-template-columns: 1fr;
}

/* Player Area */
.wpiptv-player-area { background: #000; }
.wpiptv-video-wrap {
    position: relative;
    width: 100%;
    height: var(--wpiptv-height, 480px);
    background: #000;
}
.wpiptv-video-wrap video {
    width: 100%;
    height: 100%;
    background: #000;
}
.wpiptv-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #475569;
    gap: 12px;
}
.wpiptv-placeholder p { margin: 0; font-size: 14px; }
.wpiptv-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.7);
}
.wpiptv-spinner {
    width: 40px; height: 40px;
    border: 3px solid #334155;
    border-top-color: var(--wpiptv-primary, #6366f1);
    border-radius: 50%;
    animation: wpiptv-spin 0.7s linear infinite;
}
@keyframes wpiptv-spin { to { transform: rotate(360deg); } }
.wpiptv-error {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.85); color: #ef4444; gap: 8px;
}
.wpiptv-error p { margin: 0; font-size: 14px; }
.wpiptv-retry-btn {
    margin-top: 8px; padding: 8px 20px;
    background: var(--wpiptv-primary, #6366f1); color: #fff;
    border: none; border-radius: 8px; cursor: pointer; font-size: 13px;
}

/* Now Playing Bar */
.wpiptv-now-playing {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; background: #1e293b;
}
.wpiptv-now-playing img {
    width: 28px; height: 28px; object-fit: contain; border-radius: 4px;
}
.wpiptv-now-info { display: flex; align-items: center; gap: 8px; }
.wpiptv-live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444; animation: wpiptv-pulse 1.5s infinite;
}
@keyframes wpiptv-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.wpiptv-now-info strong { font-size: 14px; color: #f1f5f9; }
.wpiptv-now-cat { font-size: 12px; color: #64748b; }

/* Channel List */
.wpiptv-channel-list {
    display: flex; flex-direction: column;
    background: #0f172a; border-left: 1px solid #1e293b;
    max-height: calc(var(--wpiptv-height, 480px) + 48px);
}
.wpiptv-layout-bottom .wpiptv-channel-list {
    border-left: none; border-top: 1px solid #1e293b;
    max-height: 300px;
}
.wpiptv-search-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; background: #1e293b; flex-shrink: 0;
}
.wpiptv-search-bar svg { color: #64748b; flex-shrink: 0; }
.wpiptv-search-bar input {
    flex: 1; background: none; border: none; color: #e2e8f0;
    font-size: 13px; outline: none; font-family: inherit;
}
.wpiptv-search-bar input::placeholder { color: #475569; }

.wpiptv-channels {
    flex: 1; overflow-y: auto; padding: 4px;
}
.wpiptv-channels::-webkit-scrollbar { width: 4px; }
.wpiptv-channels::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }
.wpiptv-channels-loading { text-align: center; padding: 30px; color: #475569; font-size: 13px; }

.wpiptv-channel {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px; cursor: pointer;
    transition: background 0.12s; border: none; background: none;
    width: 100%; text-align: left; color: #cbd5e1; font-family: inherit;
}
.wpiptv-channel:hover { background: #1e293b; }
.wpiptv-channel.active {
    background: var(--wpiptv-primary, #6366f1);
    color: #fff;
}
.wpiptv-channel-logo {
    width: 32px; height: 32px; object-fit: contain;
    border-radius: 4px; background: #1e293b; flex-shrink: 0;
}
.wpiptv-channel-no-logo {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: #1e293b; border-radius: 4px; font-size: 16px; flex-shrink: 0;
}
.wpiptv-channel-name {
    flex: 1; font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wpiptv-channel-type {
    font-size: 10px; padding: 2px 6px; border-radius: 4px;
    background: rgba(255,255,255,0.1); color: #94a3b8; flex-shrink: 0;
}

/* Pagination */
.wpiptv-pagination {
    display: flex; justify-content: center; gap: 4px;
    padding: 8px; flex-shrink: 0;
}
.wpiptv-page-btn {
    padding: 4px 10px; border: none; border-radius: 6px;
    background: #1e293b; color: #94a3b8; font-size: 12px;
    cursor: pointer; transition: all 0.1s;
}
.wpiptv-page-btn:hover { background: #334155; }
.wpiptv-page-btn.active {
    background: var(--wpiptv-primary, #6366f1); color: #fff;
}

/* No channels */
.wpiptv-no-channels {
    text-align: center; padding: 40px 20px; color: #475569; font-size: 14px;
}

/* Mobile */
@media (max-width: 768px) {
    .wpiptv-layout-sidebar .wpiptv-main { grid-template-columns: 1fr; }
    .wpiptv-channel-list {
        border-left: none; border-top: 1px solid #1e293b;
        max-height: 250px;
    }
    .wpiptv-video-wrap { height: 240px; }
}
