:root {
  --primary: #E50914;
  --primary-hover: #b80710;
  --bg-dark: #141414;
  --bg-card: #1f1f1f;
  --bg-surface: #262626;
  --text-main: #FFFFFF;
  --text-muted: #AAAAAA;
  --border: #333333;
  --success: #2ecc71;
  --accent: #00d2d3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: #0b0b0b;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.brand span {
  color: #fff;
}

.nav-links {
  list-style: none;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-btn:hover, .nav-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.nav-btn.active {
  border-left: 4px solid var(--primary);
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 30px;
  max-width: 1300px;
}

header.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.badge {
  background: var(--bg-surface);
  color: var(--success);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #383838;
}

/* Cards & Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  padding: 22px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
}

/* Section content */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Inputs & Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}

.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #333;
}

.btn-danger {
  background: #c0392b;
}

.btn-danger:hover {
  background: #e74c3c;
}

/* Search results grid */
.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.media-poster-card {
  background: var(--bg-surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.media-poster-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background: #111;
}

.media-poster-card .info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.media-poster-card .title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.media-poster-card .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Stream Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  color: var(--text-muted);
  font-weight: 600;
}

/* Video Player Container */
.video-preview-wrapper {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  max-width: 800px;
  margin: 20px auto;
  border: 1px solid #333;
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}

/* Extractor Engine & Sandbox UI */
.chip-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: #ddd;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: #333;
  color: #fff;
  border-color: #555;
}

.timing-chip {
  background: #111;
  border: 1px solid #333;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #ccc;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.status-online {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-offline {
  background: rgba(255, 255, 255, 0.08);
  color: #888;
  border: 1px solid #333;
}

.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.pill-green {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.pill-yellow {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.provider-badge {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.quality-badge {
  background: #0984e3;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.format-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.format-m3u8 {
  background: rgba(229, 9, 20, 0.2);
  color: #e50914;
  border: 1px solid rgba(229, 9, 20, 0.4);
}

.format-mp4 {
  background: rgba(108, 92, 231, 0.2);
  color: #a29bfe;
  border: 1px solid rgba(108, 92, 231, 0.4);
}

.btn-success {
  background: #27ae60;
  color: #fff;
}

.btn-success:hover {
  background: #2ecc71;
}

/* Featured Content Engine Styles */
.mode-card {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.mode-card:hover {
  border-color: #555;
  background: #2a2a2a;
}

.mode-card.active {
  border-color: var(--primary);
  background: rgba(229, 9, 20, 0.08);
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.2);
}

.promo-badge {
  background: rgba(229, 9, 20, 0.15);
  color: #ff4757;
  border: 1px solid rgba(229, 9, 20, 0.35);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

.order-badge {
  font-weight: 800;
  color: #fffa65;
  background: #222;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.btn-icon {
  background: #262626;
  border: 1px solid #3a3a3a;
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
  margin-right: 4px;
}

.btn-icon:hover {
  background: #383838;
}

.btn-icon-danger:hover {
  background: rgba(231, 76, 60, 0.3);
  border-color: #e74c3c;
}

.mini-pin-card {
  background: #181818;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.mini-pin-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Home Sections Management Styles */
.chip-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #222;
  border: 1px solid #3a3a3a;
  color: #bbb;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.chip-select:hover {
  background: #333;
  color: #fff;
  border-color: #555;
}

.chip-select.selected {
  background: rgba(229, 9, 20, 0.2);
  color: #ff5252;
  border-color: var(--primary);
  font-weight: 600;
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2ecc71;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.section-tag {
  display: inline-block;
  background: #252525;
  border: 1px solid #383838;
  color: #ddd;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 4px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
}

.preview-item {
  background: #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #333;
}

.preview-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.preview-item-info {
  padding: 6px;
  font-size: 11px;
}



