@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   DESIGN SYSTEM - TV TROPICANA STREAMING PANEL
   ============================================================ */

:root {
  /* Core Palette */
  --bg-base: #030712;
  --bg-elevated: #0d1117;
  --bg-surface: #111827;
  --bg-overlay: #1a2332;
  --bg-hover: #1e2d3d;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-accent: rgba(99, 102, 241, 0.5);

  /* Brand Accent — Indigo/Violet */
  --accent-500: #6366f1;
  --accent-600: #4f46e5;
  --accent-400: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);

  /* Semantic Colors */
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --info: #3b82f6;

  /* Typography */
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;

  /* Effects */
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5), 0 10px 10px -5px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px var(--accent-glow);
  flex-shrink: 0;
}

.brand-icon svg { width: 20px; height: 20px; color: #fff; }

.brand-text { display: flex; flex-direction: column; }
.brand-title { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.brand-subtitle { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }

/* Status dot */
.live-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
  margin-left: auto;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Nav items */
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px;
  margin-top: 8px;
}

.nav-item { display: block; margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-400);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--accent-500);
  border-radius: 0 4px 4px 0;
}

.nav-link .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-link.active .nav-icon { opacity: 1; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-subtle);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  width: 30px; height: 30px;
  border: 1px solid var(--border-default);
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-glow); }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0; z-index: 50;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.topbar-breadcrumb .crumb-sep { color: var(--text-muted); }
.topbar-breadcrumb .crumb-active { color: var(--text-primary); font-weight: 500; }
.topbar-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--text-primary); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}

.status-badge.online {
  color: var(--success);
  border-color: rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.08);
}

/* Page content */
.page-content { padding: 36px 32px; flex: 1; }

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header { margin-bottom: 32px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.stat-card:hover { border-color: var(--border-default); transform: translateY(-2px); }

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 var(--radius-lg) 0 100%;
  opacity: 0.08;
}

.stat-card.accent::after { background: var(--accent-500); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

.stat-icon.accent { background: rgba(99,102,241,0.15); color: var(--accent-400); }
.stat-icon.success { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,0.15); color: var(--warning); }

.stat-value { font-size: 32px; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.card-body { padding: 24px; }

/* ============================================================
   TABLE
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); color: var(--text-primary); }

.cell-primary { font-weight: 500; color: var(--text-primary) !important; }

/* Key code display */
.key-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--accent-400);
  max-width: 220px;
  overflow: hidden;
}

.key-display span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-success {
  background: rgba(16,185,129,0.12);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
}

.badge-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.25);
}

.badge-muted {
  background: rgba(107,114,128,0.12);
  color: #6b7280;
  border: 1px solid rgba(107,114,128,0.2);
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-500);
  color: #fff;
  border-color: var(--accent-500);
}
.btn-primary:hover { background: var(--accent-600); border-color: var(--accent-600); box-shadow: 0 0 20px var(--accent-glow); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-default); }

.btn-danger-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-danger-ghost:hover { background: var(--danger-glow); color: var(--danger); border-color: rgba(239,68,68,0.25); }

.btn-success-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-success-ghost:hover { background: var(--success-glow); color: var(--success); border-color: rgba(16,185,129,0.25); }

.btn-warning-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-warning-ghost:hover { background: var(--warning-glow); color: var(--warning); border-color: rgba(245,158,11,0.25); }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
}

.btn-lg { padding: 12px 24px; font-size: 14px; font-weight: 600; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-overlay);
}

.input-prefix {
  display: flex;
  align-items: center;
  position: relative;
}

.input-prefix .prefix-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.input-prefix .form-input { padding-left: 42px; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: slideUp 0.25s cubic-bezier(0.4,0,0.2,1) forwards;
  margin: 20px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid;
  margin-bottom: 24px;
}

.alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.25); color: #34d399; }
.alert-danger { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #f87171; }

.alert-icon { flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ============================================================
   INFO LIST
   ============================================================ */
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.info-row-label { font-size: 13px; color: var(--text-muted); }
.info-row-value { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.code-tag { background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 3px 8px; border-radius: 4px; font-family: monospace; font-size: 12px; color: var(--accent-400); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-icon { font-size: 40px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 15px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.empty-desc { font-size: 13px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-right {
  width: 480px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 52px;
}

/* Decorative side */
.login-hero {
  max-width: 420px;
  text-align: center;
}

.hero-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--accent-500), #8b5cf6, #ec4899);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 32px;
  box-shadow: 0 0 60px rgba(99,102,241,0.4), 0 0 100px rgba(139,92,246,0.2);
}

.hero-logo svg { width: 36px; height: 36px; color: #fff; }

.hero-tagline {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero-tagline span {
  background: linear-gradient(135deg, var(--accent-400), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 40px; }

.hero-features { display: flex; flex-direction: column; gap: 14px; text-align: left; }

.hero-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.feature-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.feature-icon.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.feature-icon.green { background: rgba(16,185,129,0.15); color: var(--success); }
.feature-icon.blue { background: rgba(59,130,246,0.15); color: var(--info); }

.feature-text { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.feature-desc { font-size: 12px; color: var(--text-muted); }

/* Login form side */
.login-form-wrapper { width: 100%; max-width: 340px; }

.login-form-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; }
.login-form-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }

.divider { height: 1px; background: var(--border-subtle); margin: 28px 0; }

/* ============================================================
   COPY BUTTON
   ============================================================ */
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--accent-400); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .login-right { width: 100%; }
  .login-left { display: none; }
  .page-content { padding: 24px 16px; }
}

/* Chat Widget Global */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 450px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid var(--border-default);
}

.chat-widget.minimized {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    border: none;
    box-shadow: var(--shadow-glow);
}

.chat-widget-header {
    background: var(--accent-500);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.chat-widget-header:hover {
    background: var(--accent-600);
}

.chat-widget-yt {
    right: 100px; /* Default when local chat is closed */
}

.chat-widget-yt .chat-widget-header {
    background: #ef4444;
}

.chat-widget-yt .chat-widget-header:hover {
    background: #dc2626;
}

/* Move out of the way when local chat is opened */
body.local-chat-open .chat-widget-yt {
    right: 360px;
}

.chat-widget.minimized .chat-widget-header {
    height: 100%;
    justify-content: center;
    padding: 0;
    border-radius: 30px;
}

.chat-widget.minimized .chat-widget-header strong,
.chat-widget.minimized .chat-widget-header #chat-toggle-icon,
.chat-widget.minimized .chat-widget-header #btn-clear-chat-panel {
    display: none;
}

.chat-widget.minimized .chat-widget-header i[data-feather="message-square"] {
    width: 24px !important;
    height: 24px !important;
}

.chat-widget.notify-blink .chat-widget-header {
    animation: chatBlink 1.5s infinite;
}

@keyframes chatBlink {
    0% { background: var(--accent-500); }
    50% { background: var(--danger); }
    100% { background: var(--accent-500); }
}

.chat-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Badge positioning when minimized */
.chat-widget.minimized .chat-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    padding: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-base);
    color: transparent;
}

.chat-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    background: var(--bg-overlay);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-size: 15px; /* Aumentado de 13px para 15px */
    position: relative;
    color: var(--text-primary);
}

.chat-msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px; /* Aumentado de 11px para 13px */
}

.chat-msg-author {
    font-weight: 600;
    color: var(--accent-400);
}

.chat-msg-time {
    color: var(--text-secondary);
}

.chat-msg-content {
    color: var(--text-primary);
    word-break: break-word;
}

.chat-msg-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.chat-msg-delete:hover {
    transform: scale(1.1);
}

.chat-msg:hover .chat-msg-delete {
    opacity: 1;
}

/* Chat Input Footer */
.chat-widget-footer {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    gap: 8px;
}

#chat-input-text {
    flex: 1;
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input-text:focus {
    border-color: var(--accent-500);
}

#chat-send-btn {
    background: var(--accent-500);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

#chat-send-btn:hover {
    background: var(--accent-600);
    transform: scale(1.05);
}

/* Custom Scrollbar for Chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}
