/* SD IPTV Styles */

/* CSS Variables for easy overriding */
:root {
    --sd-iptv-primary-color: #2271b1;
    --sd-iptv-primary-dark: #135e96;
    --sd-iptv-accent-color: #00a32a;
    --sd-iptv-accent-dark: #008a20;
    --sd-iptv-success-color: #0a5e2a;
    --sd-iptv-warning-color: #996b00;
    --sd-iptv-error-color: #b32d2e;
    --sd-iptv-info-color: #50575e;
    --sd-iptv-light-bg: #f6f7f7;
    --sd-iptv-white: #fff;
    --sd-iptv-border-color: #ddd;
    --sd-iptv-border-radius: 4px;
    --sd-iptv-border-radius-lg: 8px;
    --sd-iptv-text-color: #333;
    --sd-iptv-text-muted: #8c8f94;
    --sd-iptv-card-bg: #fff;
    --sd-iptv-card-logo-bg: #f8f8f8;
    --sd-iptv-card-hover-shadow: rgba(0,0,0,0.1);
    --sd-iptv-filter-bar-bg: #f6f7f7;
    --sd-iptv-filter-bar-border: #dcdcde;
    --sd-iptv-input-border: #8c8f94;
    --sd-iptv-player-bg: #000;
    --sd-iptv-player-header-bg: #1a1a1a;
    --sd-iptv-comment-bg: #fff;
    --sd-iptv-comment-reply-bg: #f0f0f1;
    --sd-iptv-section-bg: #f6f7f7;
    --sd-iptv-social-btn-border: #dcdcde;
    --sd-iptv-social-btn-hover: #2271b1;
    --sd-iptv-social-btn-active-bg: #e9f0fa;
    --sd-iptv-subscribe-color: #cc0000;
    --sd-iptv-success-bg: #d5f5e3;
    --sd-iptv-error-bg: #fde8e8;
}

/* Admin Stats */
.sd-iptv-stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:16px; margin:20px 0; }
.sd-iptv-stat-card { background:#fff; border:1px solid #ddd; border-radius:6px; padding:20px; text-align:center; }
.sd-iptv-stat-card h3 { font-size:32px; margin:8px 0; }
.sd-iptv-stat-card p { margin:0; color:#666; }
.sd-iptv-stat-card .dashicons { font-size:32px; width:32px; height:32px; color:#2271b1; }
.sd-iptv-stat-card.active .dashicons { color:#00a32a; }
.sd-iptv-stat-card.pending .dashicons { color:#dba617; }
.sd-iptv-stat-card.submissions .dashicons { color:#8c8f94; }
.sd-iptv-stat-card.pending-sub .dashicons { color:#d63638; }
.sd-iptv-actions { margin:16px 0; }
.sd-iptv-actions .button { margin-right:8px; }

/* Status badges */
.sd-iptv-status { display:inline-block; padding:2px 8px; border-radius:3px; font-size:11px; text-transform:uppercase; font-weight:600; }
.sd-iptv-status.status-active { background:#d5f5e3; color:#0a5e2a; }
.sd-iptv-status.status-pending { background:#fef7e0; color:#996b00; }
.sd-iptv-status.status-rejected { background:#fde8e8; color:#b32d2e; }
.sd-iptv-status.status-inactive { background:#f0f0f1; color:#50575e; }

/* Import Sections */
.sd-iptv-delete-all-section { margin:20px 0; padding:16px; background:#fff; border:1px solid #ddd; border-radius:4px; }
.sd-iptv-delete-all-section h2 { margin-top:0; }
.sd-iptv-delete-all-msg { margin-left:10px; display:inline-block; }
.sd-iptv-country-import-section { margin:16px 0; }
.sd-iptv-country-selector { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.sd-iptv-country-selector select { min-width:200px; }
.sd-iptv-preview-status { margin-left:8px; }

/* Preview Table Toolbar */
.sd-iptv-preview-toolbar { display:flex; gap:12px; align-items:center; flex-wrap:wrap; padding:10px 12px; background:#f0f6fc; border:1px solid #c5d9ed; border-radius:4px 4px 0 0; margin-top:12px; }
.sd-iptv-preview-toolbar .sd-iptv-preview-count { font-weight:600; color:#1d2327; margin-right:12px; }
.sd-iptv-preview-toolbar label { cursor:pointer; }
.sd-iptv-import-selected-msg { margin-left:8px; display:inline-block; }

/* Preview Table */
.sd-iptv-table-wrap { max-height:600px; overflow-y:auto; border:1px solid #c5d9ed; border-top:0; border-radius:0 0 4px 4px; }
.sd-iptv-preview-table { margin:0; }
.sd-iptv-preview-table th.cb-col { width:50px; }
.sd-iptv-preview-table th.name-col { width:260px; }
.sd-iptv-preview-table th.group-col { width:140px; }
.sd-iptv-preview-table th.status-col { width:70px; }
.sd-iptv-preview-table th.test-col { width:80px; }
.sd-iptv-preview-table td { vertical-align:middle; }
.sd-iptv-preview-table td.name-col { font-size:13px; }
.sd-iptv-preview-table td.url-col { max-width:300px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sd-iptv-preview-table td.url-col code { font-size:11px; background:transparent; }
.sd-iptv-preview-table .sd-iptv-mini-logo { width:28px; height:28px; object-fit:contain; vertical-align:middle; margin-right:6px; border-radius:3px; }

/* Stream Status Icons */
.sd-iptv-stream-status { display:inline-block; width:20px; height:20px; line-height:20px; text-align:center; border-radius:50%; font-size:10px; font-weight:700; color:#fff; }
.sd-iptv-stream-status.sd-iptv-status-live { background:#00a32a; }
.sd-iptv-stream-status.sd-iptv-status-dead { background:#d63638; }
.sd-iptv-stream-status.sd-iptv-status-unknown { background:#8c8f94; }

/* Progress Bar */
.sd-iptv-progress-bar { height:24px; background:#f0f0f1; border-radius:4px; margin-top:8px; position:relative; overflow:hidden; }
.sd-iptv-progress-fill { height:100%; background:#2271b1; border-radius:4px; transition:width .3s ease; width:0%; }
.sd-iptv-progress-text { position:absolute; top:0; left:0; right:0; bottom:0; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; color:#1d2327; }

/* Import Grid (Legacy) */
.sd-iptv-import-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:20px; margin:16px 0; }
.sd-iptv-import-card { background:#fff; border:1px solid #ddd; padding:20px; border-radius:4px; }
.sd-iptv-import-card h3 { margin-top:0; }
.sd-iptv-import-result { display:inline-block; margin-left:10px; }

/* Frontend Channel Grid */
.sd-iptv-filters { display:flex; gap:8px; flex-wrap:nowrap; align-items:center; margin-bottom:20px; padding:10px 16px; background:var(--sd-iptv-filter-bar-bg); border:1px solid var(--sd-iptv-filter-bar-border); border-radius:var(--sd-iptv-border-radius); }
.sd-iptv-filters input { flex:1; min-width:120px; padding:6px 10px; border:1px solid var(--sd-iptv-input-border); border-radius:3px; }
.sd-iptv-filters select { flex:0 0 auto; padding:6px 10px; border:1px solid var(--sd-iptv-input-border); border-radius:3px; }
.sd-iptv-filters .sd-iptv-btn, .sd-iptv-btn { flex:0 0 auto; padding:6px 16px; background:var(--sd-iptv-primary-color); color:var(--sd-iptv-white); border:none; border-radius:3px; cursor:pointer; white-space:nowrap; font-size:13px; }
.sd-iptv-filters .sd-iptv-btn:hover, .sd-iptv-btn:hover { background:var(--sd-iptv-primary-dark); }

.sd-iptv-card { background:var(--sd-iptv-card-bg); border:1px solid var(--sd-iptv-border-color); border-radius:var(--sd-iptv-border-radius-lg); overflow:hidden; transition:box-shadow .2s; }
.sd-iptv-card:hover { box-shadow:0 4px 12px var(--sd-iptv-card-hover-shadow); }
.sd-iptv-card-logo { height:100px; display:flex; align-items:center; justify-content:center; background:var(--sd-iptv-card-logo-bg); padding:12px; }
.sd-iptv-card-logo img { max-height:70px; max-width:100%; object-fit:contain; }
.sd-iptv-card-placeholder { width:50px; height:50px; border-radius:50%; background:var(--sd-iptv-primary-color); color:var(--sd-iptv-white); display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:700; }
.sd-iptv-card-body { padding:12px; }
.sd-iptv-card-body h3 { margin:0 0 8px; font-size:14px; line-height:1.3; color:var(--sd-iptv-text-color); }
.sd-iptv-card-meta { font-size:11px; color:var(--sd-iptv-text-muted); margin-bottom:8px; }
.sd-iptv-card-meta span { display:inline-block; margin-right:4px; }
.sd-iptv-watch-btn { display:inline-block; padding:6px 14px; background:var(--sd-iptv-primary-color); color:var(--sd-iptv-white); text-decoration:none; border-radius:var(--sd-iptv-border-radius); font-size:13px; border:none; cursor:pointer; }
.sd-iptv-watch-btn:hover { background:var(--sd-iptv-primary-dark); color:var(--sd-iptv-white); }
.sd-iptv-offline { color:var(--sd-iptv-text-muted); font-size:12px; }

/* Player */
.sd-iptv-player-container { width:100%; background:var(--sd-iptv-player-bg); border-radius:var(--sd-iptv-border-radius-lg); overflow:hidden; margin-bottom:16px; }
.sd-iptv-player-header { display:flex; justify-content:space-between; align-items:center; padding:8px 16px; background:var(--sd-iptv-player-header-bg); }
.sd-iptv-player-header h3 { margin:0; color:var(--sd-iptv-white); font-size:14px; }
.sd-iptv-close-player { background:none; border:none; color:var(--sd-iptv-white); font-size:24px; cursor:pointer; opacity:0.7; }
.sd-iptv-close-player:hover { opacity:1; }
#sd-iptv-player { width:100%; max-height:360px; display:block; }

/* Filter Bar */
.sd-iptv-filter-bar { margin-bottom:16px; padding:12px 16px; background:var(--sd-iptv-filter-bar-bg); border:1px solid var(--sd-iptv-filter-bar-border); border-radius:var(--sd-iptv-border-radius); }
.sd-iptv-filter-row-top { display:flex; gap:8px; flex-wrap:nowrap; align-items:center; }
.sd-iptv-search-input { flex:1; min-width:120px; padding:8px 10px; border:1px solid var(--sd-iptv-input-border); border-radius:3px; font-size:14px; background:var(--sd-iptv-white); color:var(--sd-iptv-text-color); }
.sd-iptv-category-select, .sd-iptv-country-select { flex:0 1 auto; min-width:140px; padding:8px 10px; border:1px solid var(--sd-iptv-input-border); border-radius:3px; font-size:13px; background:var(--sd-iptv-white); color:var(--sd-iptv-text-color); }
.sd-iptv-filter-row-meta { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:8px; }
.sd-iptv-meta-label { font-size:12px; color:var(--sd-iptv-text-muted); font-weight:600; }
.sd-iptv-meta-pill { padding:4px 12px; border:1px solid var(--sd-iptv-input-border); border-radius:20px; background:var(--sd-iptv-white); color:var(--sd-iptv-text-color); cursor:pointer; font-size:12px; }
.sd-iptv-meta-pill.active { background:var(--sd-iptv-primary-color); color:var(--sd-iptv-white); border-color:var(--sd-iptv-primary-color); }
.sd-iptv-clear-filters-btn { margin-left:auto; }

/* Home Sections Tabs */
.sd-iptv-home-sections { margin-bottom:20px; }
.sd-iptv-tab-bar { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:16px; border-bottom:2px solid var(--sd-iptv-filter-bar-border); padding-bottom:2px; }
.sd-iptv-home-tab { padding:8px 18px; border:1px solid transparent; border-bottom:0; border-radius:4px 4px 0 0; background:transparent; cursor:pointer; font-size:13px; font-weight:600; color:var(--sd-iptv-text-muted); }
.sd-iptv-home-tab.active { border-color:var(--sd-iptv-filter-bar-border); background:var(--sd-iptv-card-bg); color:var(--sd-iptv-primary-color); margin-bottom:-2px; border-bottom:2px solid var(--sd-iptv-card-bg); }
.sd-iptv-home-tab:hover { color:var(--sd-iptv-primary-color); }

/* Accordion */
.sd-iptv-accordion-item { border:1px solid var(--sd-iptv-border-color); border-radius:var(--sd-iptv-border-radius); margin-bottom:8px; overflow:hidden; }
.sd-iptv-accordion-header { padding:12px 16px; background:var(--sd-iptv-filter-bar-bg); cursor:pointer; font-weight:600; font-size:14px; display:flex; justify-content:space-between; align-items:center; color:var(--sd-iptv-text-color); }
.sd-iptv-accordion-header:hover { background:var(--sd-iptv-border-color); }
.sd-iptv-accordion-arrow { transition:transform .2s; font-size:10px; }
.sd-iptv-accordion-item.open .sd-iptv-accordion-arrow { transform:rotate(180deg); }
.sd-iptv-accordion-body { padding:12px; background:var(--sd-iptv-card-bg); }

/* Pagination */
.sd-iptv-pagination { margin:20px 0; text-align:center; }
.sd-iptv-page { display:inline-block; padding:6px 12px; margin:0 2px; background:var(--sd-iptv-light-bg); color:var(--sd-iptv-text-muted); text-decoration:none; border-radius:3px; }
.sd-iptv-page.active, .sd-iptv-page:hover { background:var(--sd-iptv-primary-color); color:var(--sd-iptv-white); }

/* Social Row */
.sd-iptv-social-row { display:flex; gap:4px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.sd-iptv-social-btn { background:none; border:1px solid var(--sd-iptv-social-btn-border); border-radius:3px; padding:3px 8px; cursor:pointer; font-size:12px; line-height:1.4; color:var(--sd-iptv-text-muted); transition:all .15s; }
.sd-iptv-social-btn:hover { border-color:var(--sd-iptv-social-btn-hover); color:var(--sd-iptv-social-btn-hover); }
.sd-iptv-social-btn.sd-iptv-active { border-color:var(--sd-iptv-social-btn-hover); background:var(--sd-iptv-social-btn-active-bg); color:var(--sd-iptv-social-btn-hover); }

.sd-iptv-subscribe-btn { border-color:var(--sd-iptv-subscribe-color); color:var(--sd-iptv-subscribe-color); font-weight:600; }
.sd-iptv-subscribe-btn:hover { background:var(--sd-iptv-subscribe-color); color:var(--sd-iptv-white); }
.sd-iptv-subscribe-btn.sd-iptv-subscribed { background:var(--sd-iptv-subscribe-color); color:var(--sd-iptv-white); border-color:var(--sd-iptv-subscribe-color); }
.sd-iptv-sub-count { margin-left:2px; opacity:0.8; }

.sd-iptv-views-count { font-size:11px; color:var(--sd-iptv-text-muted); margin-left:4px; }

/* Playlist Picker */
.sd-iptv-playlist-picker { position:absolute; background:var(--sd-iptv-card-bg); border:1px solid var(--sd-iptv-filter-bar-border); border-radius:var(--sd-iptv-border-radius); box-shadow:0 2px 8px var(--sd-iptv-card-hover-shadow); z-index:100; max-height:200px; overflow-y:auto; min-width:160px; }
.sd-iptv-playlist-option { padding:8px 14px; cursor:pointer; font-size:13px; border-bottom:1px solid var(--sd-iptv-border-color); color:var(--sd-iptv-text-color); }
.sd-iptv-playlist-option:hover { background:var(--sd-iptv-social-btn-active-bg); }
.sd-iptv-playlist-option:last-child { border-bottom:0; }
.sd-iptv-playlist-add-btn { position:relative; }

/* Comments Section */
.sd-iptv-comments-section { margin-top:24px; padding:16px; background:var(--sd-iptv-section-bg); border:1px solid var(--sd-iptv-filter-bar-border); border-radius:var(--sd-iptv-border-radius); }
.sd-iptv-comments-section h3 { margin:0 0 16px; font-size:18px; color:var(--sd-iptv-text-color); }
.sd-iptv-comments-list { margin-bottom:16px; }
.sd-iptv-comment { display:flex; gap:10px; margin-bottom:12px; padding:10px; background:var(--sd-iptv-comment-bg); border-radius:var(--sd-iptv-border-radius); }
.sd-iptv-comment-reply { margin-left:46px; background:var(--sd-iptv-comment-reply-bg); }
.sd-iptv-comment-avatar { border-radius:50%; flex-shrink:0; }
.sd-iptv-comment-body { flex:1; }
.sd-iptv-comment-body strong { font-size:13px; color:var(--sd-iptv-text-color); }
.sd-iptv-comment-time { font-size:11px; color:var(--sd-iptv-text-muted); margin-left:8px; }
.sd-iptv-comment-body p { margin:4px 0; font-size:13px; color:var(--sd-iptv-text-color); }
.sd-iptv-reply-btn { background:none; border:none; color:var(--sd-iptv-primary-color); cursor:pointer; font-size:12px; padding:2px 0; }
.sd-iptv-reply-btn:hover { text-decoration:underline; }
.sd-iptv-reply-form { margin-top:8px; }
.sd-iptv-reply-form textarea { width:100%; padding:6px; border:1px solid var(--sd-iptv-filter-bar-border); border-radius:3px; resize:vertical; background:var(--sd-iptv-card-bg); color:var(--sd-iptv-text-color); }
.sd-iptv-reply-form .sd-iptv-btn { margin-top:4px; padding:4px 12px; font-size:12px; }
.sd-iptv-comment-form { display:flex; gap:8px; flex-direction:column; }
.sd-iptv-comment-form textarea { width:100%; padding:8px; border:1px solid var(--sd-iptv-filter-bar-border); border-radius:3px; resize:vertical; background:var(--sd-iptv-card-bg); color:var(--sd-iptv-text-color); }
.sd-iptv-comment-form .sd-iptv-btn { align-self:flex-start; }
.sd-iptv-comment-msg { font-size:12px; color:var(--sd-iptv-text-color); }

/* Playlists Page */
.sd-iptv-playlists-page { max-width:800px; }
.sd-iptv-create-playlist-bar { display:flex; gap:8px; flex-direction:column; margin-bottom:20px; padding:16px; background:var(--sd-iptv-section-bg); border:1px solid var(--sd-iptv-filter-bar-border); border-radius:var(--sd-iptv-border-radius); }
.sd-iptv-create-playlist-bar input { padding:8px; border:1px solid var(--sd-iptv-input-border); border-radius:3px; background:var(--sd-iptv-card-bg); color:var(--sd-iptv-text-color); }
.sd-iptv-create-playlist-bar textarea { padding:8px; border:1px solid var(--sd-iptv-input-border); border-radius:3px; resize:vertical; min-height:40px; background:var(--sd-iptv-card-bg); color:var(--sd-iptv-text-color); }
.sd-iptv-playlists-list { display:flex; flex-direction:column; gap:12px; }
.sd-iptv-playlist-item { padding:14px; background:var(--sd-iptv-card-bg); border:1px solid var(--sd-iptv-border-color); border-radius:6px; }
.sd-iptv-playlist-header { display:flex; justify-content:space-between; align-items:center; }
.sd-iptv-playlist-header strong { font-size:15px; color:var(--sd-iptv-text-color); }
.sd-iptv-playlist-count { font-size:12px; color:var(--sd-iptv-text-muted); }
.sd-iptv-playlist-desc { margin:4px 0; font-size:12px; color:var(--sd-iptv-text-muted); }
.sd-iptv-playlist-actions { margin-top:8px; display:flex; gap:6px; }
.sd-iptv-playlist-actions .sd-iptv-btn { padding:4px 12px; font-size:12px; }

/* Submit Form */
.sd-iptv-submit-form { max-width:600px; padding:20px; background:var(--sd-iptv-section-bg); border:1px solid var(--sd-iptv-filter-bar-border); border-radius:6px; }
.sd-iptv-submit-form label { display:block; font-weight:600; margin-bottom:4px; }
.sd-iptv-submit-form .sd-iptv-btn { padding:8px 24px; background:var(--sd-iptv-primary-color); color:var(--sd-iptv-white); border:none; border-radius:4px; cursor:pointer; font-size:14px; }
.sd-iptv-submit-form .sd-iptv-btn:hover { background:var(--sd-iptv-primary-dark); }
.sd-iptv-submit-msg { margin-top:12px; padding:8px 12px; border-radius:3px; }
.sd-iptv-submit-msg.success { background:var(--sd-iptv-success-bg); color:var(--sd-iptv-success-color); }
.sd-iptv-submit-msg.error { background:var(--sd-iptv-error-bg); color:var(--sd-iptv-error-color); }

/* Responsive */
@media (max-width:768px) {
    .sd-iptv-grid { grid-template-columns:repeat(2,1fr) !important; }
    .sd-iptv-filters { flex-wrap:wrap; }
    .sd-iptv-filters input { flex:1 1 100%; }
    .sd-iptv-preview-table th, .sd-iptv-preview-table td { font-size:12px; }
    .sd-iptv-preview-table th.name-col { width:120px; }
    .sd-iptv-preview-table td.url-col { max-width:120px; }
}
@media (max-width:480px) {
    .sd-iptv-grid { grid-template-columns:1fr !important; }
}
