:root {
  --iv-bg: #090d16;
  --iv-surface: #131b2e;
  --iv-surface-hover: #1b2640;
  --iv-border: #1f2d4a;
  --iv-red: #ef4444;
  --iv-red-hover: #dc2626;
  --iv-text: #f1f5f9;
  --iv-muted: #94a3b8;
  --iv-subtle: #475569;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--iv-bg);
  color: var(--iv-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.iv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: var(--iv-surface);
  border-bottom: 1px solid var(--iv-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.iv-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.iv-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--iv-red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iv-search-box {
  flex: 1;
  max-width: 500px;
  margin: 0 1.5rem;
  display: flex;
}
.iv-search-input {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--iv-bg);
  border: 1px solid var(--iv-border);
  border-radius: 6px 0 0 6px;
  color: var(--iv-text);
  font-size: 0.9rem;
  outline: none;
}
.iv-search-btn {
  padding: 0.5rem 1.2rem;
  background: var(--iv-border);
  border: none;
  border-radius: 0 6px 6px 0;
  color: var(--iv-text);
  cursor: pointer;
}
.iv-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.iv-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.iv-btn-primary { background: var(--iv-red); color: #fff; border: none; }
.iv-btn-primary:hover { background: var(--iv-red-hover); }
.iv-btn-secondary { background: var(--iv-surface-hover); color: var(--iv-text); border: 1px solid var(--iv-border); }
.iv-btn-secondary:hover { background: var(--iv-border); }

.iv-main-layout {
  display: flex;
  flex: 1;
}
.iv-sidebar {
  width: 240px;
  background: var(--iv-surface);
  border-right: 1px solid var(--iv-border);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.iv-side-group h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--iv-muted);
  letter-spacing: 0.05em;
  padding: 0 0.5rem 0.5rem;
}
.iv-side-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--iv-text);
  font-size: 0.9rem;
}
.iv-side-link:hover, .iv-side-link.active {
  background: var(--iv-surface-hover);
  color: #fff;
}
.iv-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
}
.iv-categories-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
.iv-cat-pill {
  padding: 0.35rem 0.85rem;
  background: var(--iv-surface);
  border: 1px solid var(--iv-border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--iv-muted);
  white-space: nowrap;
}
.iv-cat-pill.active, .iv-cat-pill:hover {
  background: var(--iv-red);
  color: #fff;
  border-color: var(--iv-red);
}
.iv-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.iv-card {
  background: var(--iv-surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--iv-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.iv-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}
.iv-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #0f172a;
}
.iv-card-thumb-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}
.iv-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.85);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.iv-card-info {
  padding: 0.85rem;
  display: flex;
  gap: 0.75rem;
}
.iv-channel-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--iv-surface-hover);
  border: 1px solid var(--iv-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.iv-meta {
  flex: 1;
}
.iv-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.iv-channel-name {
  font-size: 0.82rem;
  color: var(--iv-muted);
}
.iv-card-stats {
  font-size: 0.78rem;
  color: var(--iv-subtle);
  margin-top: 0.15rem;
}

/* Player page styles */
.iv-player-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1500px;
  margin: 0 auto;
}
.iv-stage {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.iv-player-overlay {
  text-align: center;
  padding: 2rem;
}
.iv-big-play {
  width: 72px;
  height: 72px;
  background: var(--iv-red);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 0 25px rgba(239,68,68,0.6);
  cursor: pointer;
}
.iv-player-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.iv-progress-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,0.2);
}
.iv-progress-fill {
  width: 28%;
  height: 100%;
  background: var(--iv-red);
}
.iv-video-details {
  margin-top: 1rem;
}
.iv-video-headline {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.iv-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--iv-border);
  margin-bottom: 1rem;
}
.iv-desc-card {
  background: var(--iv-surface);
  border: 1px solid var(--iv-border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5e1;
}
.iv-desc-chapters {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--iv-border);
}
.iv-dl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background: #1e293b;
  border: 1px solid var(--iv-border);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #38bdf8;
}
.iv-dl-badge:hover { background: #334155; }

/* Auth page */
.iv-auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.iv-auth-card {
  background: var(--iv-surface);
  border: 1px solid var(--iv-border);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.iv-form-group {
  margin-bottom: 1.25rem;
}
.iv-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--iv-muted);
}
.iv-form-ctrl {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--iv-bg);
  border: 1px solid var(--iv-border);
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
}

/* 404 */
.iv-error-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 3rem;
  text-align: center;
}

.iv-footer {
  background: var(--iv-surface);
  border-top: 1px solid var(--iv-border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--iv-muted);
  margin-top: auto;
}

@media (max-width: 900px) {
  .iv-sidebar { display: none; }
  .iv-player-layout { grid-template-columns: 1fr; }
  .iv-search-box { display: none; }
}
