@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-main: #0a0a0f;
  --bg-sidebar: #101017;
  --bg-card: rgba(22, 22, 34, 0.75);
  --bg-card-hover: rgba(30, 30, 46, 0.9);
  --bg-elevated: #1a1a27;
  --bg-input: #12121c;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 0, 51, 0.4);
  --border-focus: #ff0033;
  
  --text-primary: #ffffff;
  --text-secondary: #9ea3b5;
  --text-muted: #64687a;
  
  --yt-red: #ff0033;
  --yt-red-glow: rgba(255, 0, 51, 0.25);
  --yt-red-gradient: linear-gradient(135deg, #ff0033 0%, #cc0000 100%);
  
  --accent-green: #00e676;
  --accent-green-bg: rgba(0, 230, 118, 0.12);
  --accent-blue: #00b0ff;
  --accent-blue-bg: rgba(0, 176, 255, 0.12);
  --accent-purple: #9d4edd;
  --accent-gold: #ffb703;
  --accent-gold-bg: rgba(255, 183, 3, 0.12);
  --accent-red-bg: rgba(255, 0, 51, 0.12);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px var(--yt-red-glow);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--yt-red);
}

/* Typography & Global Utility */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

.mono {
  font-family: var(--font-mono);
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--transition);
  user-select: none;
}

.btn-primary {
  background: var(--yt-red-gradient);
  color: white;
  box-shadow: 0 4px 15px var(--yt-red-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 51, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: var(--accent-green);
  color: #000;
  font-weight: 700;
}

.btn-success:hover {
  background: #00c853;
  transform: translateY(-2px);
}

.btn-danger {
  background: #d32f2f;
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green, .badge-active, .badge-monetize, .badge-paid {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.badge-red, .badge-blocked, .badge-rejected, .badge-urgent {
  background: var(--accent-red-bg);
  color: #ff334b;
  border: 1px solid rgba(255, 51, 75, 0.3);
}

.badge-gold, .badge-pending, .badge-disputed, .badge-processing {
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 183, 3, 0.3);
}

.badge-blue, .badge-linked, .badge-admin {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 176, 255, 0.3);
}

.badge-gray, .badge-track, .badge-released {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Inputs & Form Groups */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 15px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--yt-red);
  background: #161624;
  outline: none;
  box-shadow: 0 0 0 3px var(--yt-red-glow);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ea3b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* Application Layout (Dashboard) */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 100;
}

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

.logo-badge {
  background: var(--yt-red);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px var(--yt-red-glow);
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text span {
  font-size: 0.65rem;
  color: var(--accent-gold);
  background: var(--accent-gold-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 12px 14px 6px 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(255, 0, 51, 0.12);
  border-left: 3px solid var(--yt-red);
}

.nav-item.active i {
  color: var(--yt-red);
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--yt-red);
  color: white;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--yt-red);
}

.user-info-text {
  flex: 1;
  overflow: hidden;
}

.user-info-text h4 {
  font-size: 0.88rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-info-text p {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(255, 0, 51, 0.04) 0%, transparent 60%),
              radial-gradient(circle at bottom left, rgba(0, 176, 255, 0.03) 0%, transparent 50%),
              var(--bg-main);
}

.topbar {
  height: 72px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(16, 16, 23, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.channel-selector-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
}

.channel-selector-btn img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.icon-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--yt-red);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

.content-viewport {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Page Headers */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title h1 {
  font-size: 1.85rem;
  font-weight: 800;
}

.page-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

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

.stat-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--yt-red-gradient);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover::before {
  opacity: 1;
}

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

.stat-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.trend-up {
  color: var(--accent-green);
}

.trend-down {
  color: var(--yt-red);
}

/* Charts & Layout Rows */
.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.dashboard-row-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

@media (max-width: 1100px) {
  .dashboard-row, .dashboard-row-equal {
    grid-template-columns: 1fr;
  }
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title-bar h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.card-body {
  padding: 24px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 18px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.data-table td {
  padding: 16px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.video-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.video-thumb {
  width: 80px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}

.video-info h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 3px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  background: #14141f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.3rem;
  padding: 4px 8px;
  border-radius: 8px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 28px;
}

.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: #1e1e2d;
  border-left: 4px solid var(--yt-red);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideInRight 0.3s forwards;
}

.toast-success {
  border-left-color: var(--accent-green);
}

.toast-info {
  border-left-color: var(--accent-blue);
}

.toast-warning {
  border-left-color: var(--accent-gold);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================== */
/* NETWORK RELATIONSHIPS & CONTENT MANAGER STYLES */
/* ============================================== */

/* Filter Pills Navigation */
.filter-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-pill.active {
  background: var(--yt-red);
  color: white;
  border-color: var(--yt-red);
  box-shadow: 0 2px 10px var(--yt-red-glow);
}

.filter-pill .pill-count {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
}

/* Network Relationship Badges */
.badge-oo {
  background: rgba(0, 176, 255, 0.15);
  color: #00b0ff;
  border: 1px solid rgba(0, 176, 255, 0.35);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-affiliate {
  background: rgba(157, 78, 221, 0.15);
  color: #c77dff;
  border: 1px solid rgba(157, 78, 221, 0.35);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-whitelisted {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-standard-claims {
  background: rgba(255, 183, 3, 0.12);
  color: #ffb703;
  border: 1px solid rgba(255, 183, 3, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Revenue Split Progress Mini-Bar */
.split-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
}

.split-pill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
}

.split-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

.split-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e676 0%, #00b0ff 100%);
  border-radius: 3px;
}

/* Switches & Toggles */
.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
}

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

input:checked + .slider-toggle {
  background-color: var(--accent-green);
}

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

/* Channel Row Avatar with Status Dot */
.channel-avatar-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.channel-avatar-wrapper img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.channel-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.dot-online {
  background: var(--accent-green);
}

.dot-warning {
  background: var(--accent-gold);
}

/* Channel Audit Stats Grid */
.audit-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.audit-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.audit-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-heading);
  margin-top: 4px;
}

.audit-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
