/* ============================================================
   CarsaiPlay 2.0 — Design System
   ============================================================ */

/* ---- Variáveis ---- */
:root {
  --red:          #e50914;
  --red-dark:     #b20710;
  --red-glow:     rgba(229,9,20,.25);
  --bg:           #0f0f0f;
  --bg-2:         #181818;
  --bg-3:         #222;
  --bg-card:      #1c1c1c;
  --bg-hover:     #252525;
  --border:       rgba(255,255,255,.08);
  --border-hover: rgba(255,255,255,.15);
  --text:         #e8e8e8;
  --text-muted:   #888;
  --text-dim:     #555;
  --sidebar-w:    260px;
  --topbar-h:     58px;
  --transition:   .2s ease;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --shadow:       0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.6);
}

/* Modo Claro */
[data-theme="light"] {
  --bg:       #f0f2f5;
  --bg-2:     #f8f8f8;
  --bg-3:     #fff;
  --bg-card:  #fff;
  --bg-hover: #f0f0f0;
  --border:   rgba(0,0,0,.08);
  --border-hover: rgba(0,0,0,.15);
  --text:     #111;
  --text-muted:#666;
  --text-dim: #aaa;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

/* ============================================================
   LAYOUT PRINCIPAL (público)
   ============================================================ */

/* Topbar pública — sem transparência, sempre sólida */
.cp-topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.cp-topbar-logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}
.cp-topbar-logo .accent { color: var(--red); }

.cp-topbar-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 1;
}

.cp-topbar-nav a {
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}
.cp-topbar-nav a:hover, .cp-topbar-nav a.active {
  color: var(--text);
  background: var(--bg-hover);
}

.cp-topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

/* Search bar */
.cp-search {
  position: relative;
}
.cp-search input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .4rem 1rem .4rem 2.25rem;
  color: var(--text);
  font-size: .85rem;
  width: 220px;
  transition: var(--transition);
  outline: none;
}
.cp-search input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
  width: 280px;
}
.cp-search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: .8rem;
  pointer-events: none;
}

/* Autocomplete */
.cp-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 999;
}
.cp-ac-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background var(--transition);
}
.cp-ac-item:hover, .cp-ac-item.selected { background: var(--bg-hover); }
.cp-ac-item:last-child { border-bottom: none; }
.cp-ac-item img { width: 36px; height: 52px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }

/* Icon buttons */
.cp-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.cp-icon-btn:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-hover); }

/* Notif badge */
.cp-notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--red);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Avatar dropdown */
.cp-avatar-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  cursor: pointer;
  transition: var(--transition);
}
.cp-avatar-btn:hover { border-color: var(--border-hover); }
.cp-avatar-btn img, .cp-avatar-btn .cp-avatar-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.cp-dropdown {
  position: relative;
}
.cp-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .4rem;
  display: none;
  z-index: 999;
}
.cp-dropdown-menu.open { display: block; }
.cp-dropdown-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  transition: var(--transition);
  cursor: pointer;
}
.cp-dropdown-item:hover  { background: var(--bg-hover); color: var(--text); }
.cp-dropdown-item.danger { color: #fc4444; }
.cp-dropdown-item.danger:hover { background: rgba(229,9,20,.1); }
.cp-dropdown-divider    { border: none; border-top: 1px solid var(--border); margin: .3rem 0; }
.cp-dropdown-header { font-size: .75rem; color: var(--text-dim); text-transform: uppercase; padding: .4rem .75rem .1rem; letter-spacing: .5px; }

/* ============================================================
   SIDEBAR DO UTILIZADOR (substituindo navbar user)
   ============================================================ */
.cp-user-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

.cp-user-sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

/* Cabeçalho do perfil na sidebar */
.cp-sidebar-profile {
  padding: .75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}
.cp-sidebar-profile .cp-avatar-wrap {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: .6rem;
  overflow: hidden;
}
.cp-sidebar-profile .cp-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cp-sidebar-profile .name { font-weight: 700; font-size: .95rem; }
.cp-sidebar-profile .role { font-size: .75rem; color: var(--text-muted); }
.cp-sidebar-profile .points { font-size: .75rem; color: var(--red); margin-top: .2rem; }

/* Secções da sidebar */
.cp-sidebar-section {
  margin-bottom: .25rem;
}
.cp-sidebar-section-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: .75rem 1.25rem .25rem;
}

.cp-sidebar-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem 1.25rem;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 2px solid transparent;
  position: relative;
}
.cp-sidebar-link:hover {
  color: var(--text);
  background: var(--bg-hover);
  border-left-color: var(--border-hover);
}
.cp-sidebar-link.active {
  color: var(--red);
  background: rgba(229,9,20,.08);
  border-left-color: var(--red);
}
.cp-sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.cp-sidebar-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Conteúdo principal do utilizador */
.cp-user-main {
  padding: 2rem;
  background: var(--bg);
}

@media (max-width: 900px) {
  .cp-user-layout {
    grid-template-columns: 1fr;
  }
  .cp-user-sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    width: var(--sidebar-w);
  }
  .cp-user-sidebar.open { display: block; }
  .cp-user-main { padding: 1rem; }
}

/* ============================================================
   ADMIN SIDEBAR
   ============================================================ */
.cp-admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.cp-admin-sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.cp-admin-sidebar .logo-area {
  padding: .75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}
.cp-admin-sidebar .logo-area h5 { font-weight: 800; font-size: 1.15rem; }
.cp-admin-sidebar .logo-area small { color: var(--red); font-size: .75rem; }
.cp-admin-main { padding: 1.75rem; background: var(--bg); min-height: 100vh; }
.cp-admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   CARDS DE CONTEÚDO
   ============================================================ */
.cp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: block;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .2s;
  position: relative;
}
.cp-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 12px 36px rgba(0,0,0,.55);
  border-color: rgba(229,9,20,.35);
  z-index: 2;
}

.cp-card-img {
  position: relative;
  overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 2/3;
}
.cp-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
  display: block;
}
.cp-card:hover .cp-card-img img { transform: scale(1.08); }

/* Gradiente sempre visível no fundo da imagem */
.cp-card-img::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
  pointer-events: none;
}

.cp-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 2;
}
.cp-card:hover .cp-card-overlay { opacity: 1; }

.cp-card-play {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(229,9,20,.9);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(229,9,20,.3), 0 4px 20px rgba(0,0,0,.5);
  transform: scale(.75);
  transition: transform .25s ease;
}
.cp-card:hover .cp-card-play { transform: scale(1); }

/* Badges sobre a imagem — sempre visíveis */
.cp-card-badges {
  position: absolute;
  bottom: .45rem; left: .45rem;
  display: flex; gap: .25rem; flex-wrap: wrap;
  z-index: 3;
}
.cp-card-badges .cp-badge { font-size: .6rem; padding: 2px 5px; }

/* Rating no canto superior direito */
.cp-card-rating-badge {
  position: absolute;
  top: .4rem; right: .4rem;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  display: flex; align-items: center; gap: 2px;
  z-index: 3;
}

/* Info em baixo */
.cp-card-info {
  padding: .6rem .7rem .7rem;
  background: var(--bg-card);
}
.cp-card-title {
  font-weight: 700;
  font-size: .87rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: .15rem;
}
.cp-card-meta {
  font-size: .73rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: .3rem;
}
.cp-card-sub   { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.cp-card-type  { font-size: .68rem; color: var(--text-dim); }

/* Badge no canto */
.cp-card-badge {
  position: absolute;
  top: .4rem; left: .4rem;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ============================================================
   HERO
   ============================================================ */
.cp-hero {
  position: relative;
  height: clamp(500px, 75vh, 820px);
  overflow: hidden;
}
.cp-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(.55);
  transform: scale(1.02);
  transition: transform 8s ease;
}
.cp-hero:hover .cp-hero-bg { transform: scale(1); }
.cp-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15,15,15,.6) 0%,
    rgba(15,15,15,.15) 40%,
    transparent 70%
  );
  pointer-events: none;
}
.cp-hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 2rem;
  max-width: 660px;
}
.cp-hero-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.cp-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: .6rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.cp-hero-desc {
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cp-hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ============================================================
   SECÇÕES DE CONTEÚDO
   ============================================================ */
.cp-section { padding: 1.5rem 1.5rem; }
.cp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cp-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.cp-section-title i { color: var(--red); font-size: .95rem; }
.cp-section-see-all {
  font-size: .8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.cp-section-see-all:hover { color: var(--red); }

/* Grid de cards */
.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.cp-grid-lg { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cp-grid-xl { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ============================================================
   BOTÕES
   ============================================================ */
.cp-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
}
.cp-btn-red    { background: var(--red);    color: #fff; border-color: var(--red); }
.cp-btn-red:hover { background: var(--red-dark); }
.cp-btn-ghost  { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.15); backdrop-filter: blur(8px); }
.cp-btn-ghost:hover { background: rgba(255,255,255,.18); }
.cp-btn-outline { background: transparent; color: var(--text); border-color: var(--border-hover); }
.cp-btn-outline:hover { background: var(--bg-hover); }
.cp-btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.cp-btn-lg { padding: .7rem 1.5rem; font-size: 1rem; border-radius: var(--radius); }
.cp-btn-danger  { background: rgba(220,53,69,.15); color: #fc4444; border-color: rgba(220,53,69,.3); }
.cp-btn-danger:hover { background: rgba(220,53,69,.25); }
.cp-btn-success { background: rgba(34,197,94,.12); color: #22c55e; border-color: rgba(34,197,94,.25); }
.cp-btn-success:hover { background: rgba(34,197,94,.2); }
.cp-btn-block { width: 100%; justify-content: center; }
.cp-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   BADGES
   ============================================================ */
.cp-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2px;
}
.cp-badge-red    { background: rgba(229,9,20,.15);    color: #ff4d55; }
.cp-badge-success{ background: rgba(34,197,94,.12);   color: #22c55e; }
.cp-badge-info   { background: rgba(56,189,248,.12);  color: #38bdf8; }
.cp-badge-warning{ background: rgba(251,191,36,.12);  color: #fbbf24; }
.cp-badge-muted  { background: var(--bg-hover);       color: var(--text-muted); }
.cp-badge-primary{ background: rgba(99,102,241,.15);  color: #818cf8; }
.cp-badge-orange { background: rgba(249,115,22,.12);  color: #f97316; }
.cp-badge-danger { background: rgba(220,53,69,.15);   color: #fc4444; }
.cp-badge-secondary { background: var(--bg-3); color: var(--text-muted); }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.cp-form-group { margin-bottom: 1.1rem; }
.cp-label {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: .35rem;
  letter-spacing: .2px;
}
.cp-input, .cp-select, .cp-textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .55rem .8rem;
  font-size: .875rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.cp-input:focus, .cp-select:focus, .cp-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.cp-input::placeholder, .cp-textarea::placeholder { color: var(--text-dim); }
.cp-textarea { resize: vertical; min-height: 100px; }
.cp-input-hint { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.cp-input-error { font-size: .75rem; color: #fc4444; margin-top: .3rem; }

/* Checkbox / Switch */
.cp-switch { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.cp-switch input { display: none; }
.cp-switch-track {
  width: 40px; height: 22px;
  background: var(--bg-hover);
  border-radius: 11px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.cp-switch input:checked + .cp-switch-track { background: var(--red); }
.cp-switch-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.cp-switch input:checked + .cp-switch-track::after { transform: translateX(18px); }

/* ============================================================
   ALERTS
   ============================================================ */
.cp-alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.cp-alert-danger  { background: rgba(229,9,20,.1);  border: 1px solid rgba(229,9,20,.25); color: #ff6b6b; }
.cp-alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25); color: #4ade80; }
.cp-alert-info    { background: rgba(56,189,248,.1);border: 1px solid rgba(56,189,248,.25);color: #67e8f9; }
.cp-alert-warning { background: rgba(251,191,36,.1);border: 1px solid rgba(251,191,36,.25);color: #fcd34d; }

/* ============================================================
   CARDS DE UI (dashboard, configurações, etc.)
   ============================================================ */
.cp-ui-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cp-ui-card-header {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.cp-ui-card-body { padding: 1.1rem; }

/* Stats card */
.cp-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  transition: border-color var(--transition);
}
.cp-stat-card:hover { border-color: var(--border-hover); }
.cp-stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.cp-stat-icon.red    { background: rgba(229,9,20,.12);   color: var(--red); }
.cp-stat-icon.blue   { background: rgba(99,102,241,.12); color: #818cf8; }
.cp-stat-icon.green  { background: rgba(34,197,94,.12);  color: #22c55e; }
.cp-stat-icon.yellow { background: rgba(251,191,36,.12); color: #fbbf24; }
.cp-stat-icon.cyan   { background: rgba(56,189,248,.12); color: #38bdf8; }
.cp-stat-num   { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.cp-stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }

/* ============================================================
   TABELAS
   ============================================================ */
.cp-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.cp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.cp-table th {
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cp-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.cp-table tr:last-child td { border-bottom: none; }
.cp-table tr:hover td { background: var(--bg-hover); }
.cp-table .poster-thumb {
  width: 38px; height: 54px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-3);
}

/* ============================================================
   EPISODE LIST
   ============================================================ */
.cp-ep-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .4rem;
  transition: var(--transition);
}
.cp-ep-row:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.cp-ep-num { color: var(--text-dim); font-weight: 700; font-size: .85rem; min-width: 38px; }
.cp-ep-info { flex: 1; overflow: hidden; }
.cp-ep-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-ep-meta  { font-size: .75rem; color: var(--text-muted); }
.cp-ep-actions { display: flex; gap: .4rem; }

/* ============================================================
   PAGINAÇÃO
   ============================================================ */
.cp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.cp-page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  padding: 0 .5rem;
  transition: var(--transition);
}
.cp-page-link:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-hover); }
.cp-page-link.active { background: var(--red); border-color: var(--red); color: #fff; }
.cp-page-link.disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   SCHEDULE
   ============================================================ */
.cp-schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem;
}
.cp-schedule-col { min-height: 200px; }
.cp-schedule-day {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
}
.cp-schedule-day-head {
  padding: .5rem .75rem;
  background: var(--bg-3);
  font-size: .8rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cp-schedule-day-head.today { background: var(--red); color: #fff; }
.cp-schedule-body { padding: .4rem; }
.cp-schedule-item {
  display: flex;
  gap: .4rem;
  padding: .4rem;
  border-radius: var(--radius-sm);
  margin-bottom: .25rem;
  border: 1px solid var(--border);
  font-size: .75rem;
  transition: var(--transition);
}
.cp-schedule-item:hover { background: var(--bg-hover); }
.cp-schedule-item img { width: 28px; height: 40px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }

@media (max-width: 1200px) { .cp-schedule-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .cp-schedule-grid { grid-template-columns: repeat(2, 1fr); } }

.cp-toast.out { animation: toastOut .25s ease forwards; }
.cp-toast-success { background: #1a2e1a; color: #4ade80; border-color: rgba(34,197,94,.3); }
.cp-toast-danger  { background: #2a1a1a; color: #fc4444; border-color: rgba(229,9,20,.3); }
.cp-toast-info    { background: #1a2030; color: #67e8f9; border-color: rgba(56,189,248,.3); }
.cp-toast-warning { background: #2a2010; color: #fcd34d; border-color: rgba(251,191,36,.3); }
.cp-toast-close { margin-left: auto; cursor: pointer; opacity: .6; font-size: .8rem; }
.cp-toast-close:hover { opacity: 1; }

@keyframes toastIn  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(4px); } }

/* ============================================================
   PLAYER MODAL
   ============================================================ */
.cp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.cp-modal-overlay.open { opacity: 1; pointer-events: auto; }
.cp-modal {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 1100px;
  box-shadow: 0 25px 80px rgba(0,0,0,.8);
  transform: scale(.96);
  transition: transform .25s;
}
.cp-modal-overlay.open .cp-modal { transform: scale(1); }
.cp-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem;
  background: var(--bg-2);
  font-size: .9rem; font-weight: 600;
}
.cp-modal-body .ratio { max-height: 75vh; }

/* ============================================================
   CONQUISTAS
   ============================================================ */
.cp-achievement {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: var(--transition);
}
.cp-achievement.earned {
  border-color: rgba(251,191,36,.4);
  background: linear-gradient(135deg, var(--bg-card), rgba(251,191,36,.05));
}
.cp-achievement-icon { font-size: 2rem; margin-bottom: .5rem; }
.cp-achievement-name { font-weight: 700; font-size: .875rem; margin-bottom: .25rem; }
.cp-achievement-desc { font-size: .75rem; color: var(--text-muted); margin-bottom: .6rem; }
.cp-progress-bar-wrap { height: 5px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.cp-progress-bar { height: 100%; background: var(--red); border-radius: 3px; transition: width .4s; }
.cp-achievement.earned .cp-progress-bar { background: #fbbf24; }

.cp-footer-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.6; }
.cp-footer-heading { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); margin-bottom: .75rem; }

.cp-footer-links a { font-size: .82rem; color: var(--text-muted); transition: color var(--transition); }
.cp-footer-links a:hover { color: var(--red); }

.cp-social { display: flex; gap: .5rem; }
.cp-social a {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .8rem;
  transition: var(--transition);
}
.cp-social a:hover { border-color: var(--red); color: var(--red); }

@media (max-width: 768px) {

}
@media (max-width: 480px) {  }

/* ============================================================
   OFFLINE BAR
   ============================================================ */
#offlineBar.show { transform: none; }

/* ============================================================
   MISC
   ============================================================ */
.cp-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.cp-empty {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted);
}
.cp-empty i { font-size: 2.5rem; color: var(--text-dim); margin-bottom: 1rem; display: block; }
.cp-empty p { font-size: .9rem; }

.cp-skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.cp-stars i { color: #fbbf24; font-size: .85rem; }
.cp-stars .empty { color: var(--text-dim); }

.cp-tag {
  display: inline-flex; align-items: center;
  padding: .25rem .65rem;
  border-radius: 15px;
  border: 1px solid var(--border);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.cp-tag:hover, .cp-tag.active {
  background: var(--red); border-color: var(--red); color: #fff;
}

/* Text utilities */
.text-red    { color: var(--red); }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-white  { color: #fff; }
.fw-bold     { font-weight: 700; }
.fw-black    { font-weight: 800; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: .25rem; }    .mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }    .mt-4 { margin-top: 1rem; }
.ms-auto { margin-left: auto; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Responsive */
@media (max-width: 768px) {
  .cp-topbar-nav { display: none; }
  .cp-search input { width: 160px; }
  .cp-section { padding: 1rem; }
  .cp-hero-content { padding: 1.5rem 1rem; }
  .cp-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
}
@media (max-width: 480px) {
  .cp-grid { grid-template-columns: repeat(2, 1fr); }
  .cp-hero-title { font-size: 1.4rem; }
}

/* ============================================================
   ANÚNCIOS — Ad Manager
   ============================================================ */

/* Wrapper base de anúncio */
.cp-ad {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  position: relative;
}

/* Label discreta */
.cp-ad::before {
  content: 'Publicidade';
  position: absolute;
  top: 2px; right: 4px;
  font-size: .58rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .3px;
  pointer-events: none;
  z-index: 1;
}

/* Leaderboard 728×90 */
.cp-ad-leaderboard {
  width: 100%;
  min-height: 90px;
  max-height: 120px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  margin: .75rem 0;
}

/* Rectangle 300×250 */
.cp-ad-rectangle {
  width: 300px;
  min-height: 250px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

/* Inline catalog — parece um card normal mas é anúncio */
.cp-ad-catalog-inline {
  aspect-ratio: 2/3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 140px;
  width: 100%;
}
.cp-ad-catalog-inline::before {
  top: .4rem; right: .4rem;
  font-size: .6rem;
}

/* Blog inline — largura total */
.cp-ad-inline {
  width: 100%;
  min-height: 120px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Before player — destaque */
.cp-ad-before-player {
  width: 100%;
  min-height: 100px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  margin-bottom: .5rem;
}

/* Interstitial — overlay */
.cp-ad-interstitial {
  position: fixed;
  inset: 0;
  z-index: 9990;
}
.cp-ad-interstitial-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cp-ad-interstitial-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 640px;
  width: 100%;
  position: relative;
  box-shadow: 0 25px 80px rgba(0,0,0,.8);
  text-align: center;
}
.cp-ad-interstitial-close {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
  margin-bottom: 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: .35rem .75rem;
  font-size: .8rem;
  cursor: pointer;
  transition: var(--transition);
}
.cp-ad-interstitial-close:not(:disabled):hover {
  background: var(--bg-hover);
  color: var(--text);
}
.cp-ad-interstitial-close:disabled { opacity: .5; cursor: not-allowed; }
.cp-ad-interstitial-content { min-height: 250px; }

/* Responsive — esconder leaderboard em mobile */
@media (max-width: 768px) {
  .cp-ad-leaderboard { min-height: 60px; max-height: 80px; }
  .cp-ad-rectangle   { width: 100%; min-height: 120px; }
}

/* ─── Correcções v2.1 ─── */

/* scrollTop — posição fixa correcta */
#scrollTop {
    position: fixed !important;
    bottom: 1.5rem !important;
    right: 1.5rem !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: var(--red) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 16px rgba(229,9,20,.4) !important;
    z-index: 800 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .3s, transform .2s !important;
    transform: translateY(4px) !important;
}
#scrollTop.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}
#scrollTop:hover { transform: translateY(-2px) scale(1.05) !important; }


/* Dropdown aberto */
.cp-dropdown-menu { display: none; }
.cp-dropdown-menu.open { display: block; animation: dropIn .15s ease; }
@keyframes dropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

/* Autocomplete */
.cp-autocomplete { display: none; }
.cp-ac-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .9rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.cp-ac-item:last-of-type { border-bottom: none; }
.cp-ac-item:hover, .cp-ac-item.selected { background: var(--bg-hover); }
.cp-ac-item img { width: 36px; height: 52px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.cp-ac-title { font-size: .85rem; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.cp-ac-meta  { font-size: .72rem; color: var(--text-muted); margin: .1rem 0 0; }
.cp-ac-all {
    display: block;
    text-align: center;
    padding: .5rem;
    font-size: .8rem;
    color: var(--text-muted);
    text-decoration: none;
    border-top: 1px solid var(--border);
    transition: color .15s;
}
.cp-ac-all:hover { color: var(--red); }

/* Avatar no topbar */
.cp-avatar-img {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Dropdown item ícones */
.cp-dropdown-item i { width: 18px; text-align: center; color: var(--text-muted); }

/* Like button */
.btn-like-comment { background:none; border:none; cursor:pointer; color:var(--text-muted); padding:2px 6px; border-radius:4px; display:inline-flex; align-items:center; gap:.3rem; font-size:.82rem; }
.btn-like-comment:hover { color:var(--red); }
.btn-like-comment.liked { color:var(--red); }

/* Modal overlay */
.cp-modal-overlay { display:none; }
.cp-modal-overlay.open { display:flex; }

/* User sidebar mobile */
@media (max-width: 900px) {
    #btnSidebarToggle { display:block !important; }
    .cp-user-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 200;
        display: block !important;
    }
    .cp-user-sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.5); }
    .cp-user-main { grid-column: 1; }
}

/* ─── Utilitários Bootstrap-like (sem Bootstrap) ─── */
.d-flex        { display: flex !important; }
.d-grid        { display: grid !important; }
.d-block       { display: block !important; }
.d-none        { display: none !important; }
.d-inline      { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-wrap    { flex-wrap: wrap !important; }
.flex-column  { flex-direction: column !important; }
.flex-grow-1  { flex-grow: 1 !important; }
.flex-shrink-0{ flex-shrink: 0 !important; }

.align-items-center  { align-items: center !important; }
.align-items-start   { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }

.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem  !important; }
.gap-3 { gap: .75rem !important; }
.gap-4 { gap: 1rem   !important; }

.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem  !important; }
.me-3 { margin-right: .75rem !important; }
.ms-1 { margin-left:  .25rem !important; }
.ms-2 { margin-left:  .5rem  !important; }
.ms-3 { margin-left:  .75rem !important; }
.ms-auto { margin-left: auto !important; }

.mt-1 { margin-top:    .25rem !important; }
.mt-2 { margin-top:    .5rem  !important; }
.mt-3 { margin-top:    .75rem !important; }
.mt-4 { margin-top:    1rem   !important; }
.mb-0 { margin-bottom: 0      !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem  !important; }
.mb-3 { margin-bottom: .75rem !important; }
.mb-4 { margin-bottom: 1rem   !important; }

.p-0  { padding: 0 !important; }
.p-2  { padding: .5rem  !important; }
.p-3  { padding: .75rem !important; }
.px-2 { padding-left: .5rem !important; padding-right: .5rem !important; }
.py-2 { padding-top:  .5rem !important; padding-bottom: .5rem !important; }
.py-3 { padding-top: .75rem !important; padding-bottom: .75rem !important; }
.py-4 { padding-top: 1rem   !important; padding-bottom: 1rem !important; }

.text-center  { text-align: center  !important; }
.text-end     { text-align: right   !important; }
.text-start   { text-align: left    !important; }
.text-white   { color: #fff         !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-danger  { color: #fc4444      !important; }
.text-success { color: #22c55e      !important; }
.text-warning { color: #fbbf24      !important; }
.text-info    { color: #38bdf8      !important; }

.fw-bold   { font-weight: 700  !important; }
.fw-normal { font-weight: 400  !important; }
.fs-6      { font-size: .875rem !important; }

.w-100 { width: 100%  !important; }
.h-100 { height: 100% !important; }

.overflow-hidden { overflow: hidden !important; }
.rounded         { border-radius: var(--radius) !important; }
.rounded-circle  { border-radius: 50% !important; }
.rounded-sm      { border-radius: var(--radius-sm) !important; }

.position-fixed    { position: fixed    !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }

.shadow { box-shadow: var(--shadow) !important; }

.img-fluid { max-width: 100%; height: auto; }
.small     { font-size: .82rem !important; }
.fst-italic{ font-style: italic !important; }

/* Grid */
.row   { display: flex; flex-wrap: wrap; margin: -.375rem; }
.col-12{ width: 100%; padding: .375rem; }
.col-6 { width: 50%; padding: .375rem; }
.col-4 { width: 33.333%; padding: .375rem; }
.col-3 { width: 25%; padding: .375rem; }

@media (max-width: 768px) {
  .col-md-4, .col-md-6, .col-md-8 { width: 100%; }
}

/* ─── Responsividade do header ─── */
@media (max-width: 1024px) {
    .cp-topbar-nav a { padding: .35rem .55rem; font-size: .82rem; }
    .cp-search input { width: 160px; }
    .cp-search input:focus { width: 200px; }
}

@media (max-width: 768px) {
    .cp-topbar-nav { display: none; }
    .cp-search { display: none; } /* pesquisa vai para página */
    .cp-topbar-right { gap: .35rem; }
    .cp-topbar { padding: 0 .75rem; }
}

@media (max-width: 480px) {
    .cp-topbar-logo span:not(.accent) { display: none; }
    .cp-icon-btn { width: 32px; height: 32px; font-size: .8rem; }
}

/* ─── Dropdown posição correcta ─── */
.cp-topbar-right .cp-dropdown { position: relative; }
.cp-topbar-right .cp-dropdown-menu {
    right: 0;
    left: auto;
    top: calc(100% + 8px);
    position: absolute;
}

/* ─── Search na topbar (overflow hidden fix) ─── */
.cp-topbar .cp-search {
    position: relative;
    flex: 1;
    max-width: 280px;
}
.cp-topbar .cp-autocomplete {
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 300px;
}

/* ============================================================
   TOPBAR HAMBURGER + SIDEBAR PÚBLICA
   ============================================================ */

/* Botão hamburger */
.cp-topbar-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.cp-topbar-burger:hover { background: var(--bg-hover); }
.cp-topbar-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}
/* Hamburger → X quando open */
.sidebar-open .cp-topbar-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-open .cp-topbar-burger span:nth-child(2) { opacity: 0; }
.sidebar-open .cp-topbar-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay quando sidebar aberta */
.cp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 149;
    backdrop-filter: blur(2px);
}
body.sidebar-open .cp-sidebar-overlay { display: block; }

/* Sidebar pública */
.cp-sidebar-pub {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    z-index: 150;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}
body.sidebar-open .cp-sidebar-pub { transform: translateX(0); }

.cp-sidebar-pub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.cp-sidebar-pub-nav {
    display: flex;
    flex-direction: column;
    padding: .35rem 0;
}
.cp-sidebar-pub-nav a,
.cp-sidebar-pub-btn {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.1rem;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border-left: 2px solid transparent;
}
.cp-sidebar-pub-nav a:hover,
.cp-sidebar-pub-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-left-color: var(--border-hover);
}
.cp-sidebar-pub-nav a.active {
    color: var(--red);
    background: rgba(229,9,20,.07);
    border-left-color: var(--red);
}
.cp-sidebar-pub-nav a i,
.cp-sidebar-pub-btn i { width: 18px; text-align: center; font-size: .9rem; }

/* Hamburger visível em mobile */
@media (max-width: 900px) {
    .cp-topbar-burger { display: flex; }
    .cp-topbar-nav    { display: none; }
    .cp-topbar .cp-search { display: none; }
}
/* Hamburger sempre visível (menu na sidebar) */
@media (min-width: 901px) {
    .cp-topbar-burger { display: flex; } /* sempre mostra — sidebar tem conteúdo extra */
}

/* ============================================================
   ADMIN — RESPONSIVO (PROBLEMA 7)
   ============================================================ */

@media (max-width: 1024px) {
    .cp-admin-layout { grid-template-columns: 200px 1fr; }
}

@media (max-width: 768px) {
    /* Admin: sidebar esconde, toggle com hamburger */
    .cp-admin-layout { grid-template-columns: 1fr; }
    .cp-admin-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform .28s ease;
        z-index: 200;
        width: 260px;
    }
    .cp-admin-sidebar.open { transform: translateX(0); }
    .cp-admin-main { padding: 1rem; }
    .cp-admin-topbar { flex-direction: column; align-items: flex-start; gap: .5rem; }

    /* Tabelas admin — scroll horizontal */
    .cp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .cp-table { min-width: 500px; }
    .cp-table th, .cp-table td { padding: .5rem .6rem; font-size: .78rem; }

    /* Forms admin — full width */
    .cp-admin-main .row { flex-direction: column; }
    .cp-admin-main .col-md-4,
    .cp-admin-main .col-md-6,
    .cp-admin-main .col-md-8,
    .cp-admin-main .col-lg-4,
    .cp-admin-main .col-lg-8 { width: 100%; }

    /* Stats cards — 2 colunas */
    .cp-stat-card { flex-direction: row; }

    /* Grid de conteúdo — 2 colunas */
    .cp-grid { grid-template-columns: repeat(2, 1fr); }
    .cp-grid-lg { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .cp-admin-main { padding: .75rem; }
    .cp-grid { grid-template-columns: repeat(2, 1fr); gap: .4rem; }
    .cp-hero { height: 420px; }
    .cp-hero-title { font-size: 1.3rem; }
    .cp-hero-desc { display: none; }

}

/* Admin mobile bar */
@media (max-width: 768px) {
    .cp-admin-mobile-bar { display: flex !important; }
    .cp-admin-sidebar .logo-area { display: none; }
}

/* ─── Player Embed ─── */
.cp-player-wrap { margin-bottom: 1rem; }
.cp-player-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
}
.cp-player-container iframe,
.cp-player-container > div {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}


/* ============================================================
   TOPBAR — Classes complementares (header v3)
   ============================================================ */

/* Ações direita */
.cp-topbar-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}

/* Badge de idioma */
.cp-lang-badge {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .5px;
}

/* Ponto de notificação (badge dot) */
.cp-badge-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg-2);
}

/* Dropdown header melhorado */
.cp-dropdown-header {
  padding: .6rem .85rem .4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .25rem;
}
.cp-dropdown-header strong { display: block; font-size: .88rem; color: var(--text); }
.cp-dropdown-header small  { font-size: .74rem; color: var(--text-dim); }

/* Dropdown footer (link "ver todos") */
.cp-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem;
  font-size: .78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: .25rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.cp-dropdown-footer:hover { color: var(--red); background: var(--bg-hover); }

/* Dropdown empty */
.cp-dropdown-empty {
  padding: .75rem;
  text-align: center;
  color: var(--text-dim);
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}

/* Dropdown item variantes */
.cp-dropdown-item--danger         { color: #fc4444 !important; }
.cp-dropdown-item--danger:hover   { background: rgba(229,9,20,.1) !important; }
.cp-dropdown-sep { border: none; border-top: 1px solid var(--border); margin: .3rem 0; }

/* Menu notificações */
.cp-notif-menu { min-width: 300px; }

/* Avatar melhorado */
.cp-avatar-img  { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cp-avatar-caret { font-size: .6rem; color: var(--text-dim); }

/* Flash messages */
.cp-flash-wrap { padding: .5rem 1.25rem 0; }

/* ============================================================
   SIDEBAR PÚBLICA — Classes novas
   ============================================================ */

#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 149;
  backdrop-filter: blur(2px);
}
body.sidebar-open #sidebarOverlay { display: block; }

/* Sidebar container */
.cp-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  z-index: 150;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}
body.sidebar-open .cp-sidebar { transform: translateX(0); }
.cp-sidebar::-webkit-scrollbar { width: 4px; }
.cp-sidebar::-webkit-scrollbar-thumb { background: var(--border); }

.cp-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cp-sidebar-search {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.cp-sidebar-search .cp-search-wrap {
  position: relative;
}
.cp-sidebar-search .cp-search-wrap i {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: .8rem;
  pointer-events: none;
}
.cp-sidebar-search input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .4rem .9rem .4rem 2.2rem;
  color: var(--text);
  font-size: .84rem;
  outline: none;
  transition: border-color var(--transition);
}
.cp-sidebar-search input:focus { border-color: var(--red); }
.cp-sidebar-search .cp-autocomplete {
  position: absolute;
  left: 1rem; right: 1rem;
  top: calc(100%);
  min-width: unset;
}

.cp-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: .35rem 0;
}
.cp-sidebar-link,
.cp-sidebar-btn {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .58rem 1rem;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.cp-sidebar-link i, .cp-sidebar-btn i { width: 18px; text-align: center; font-size: .87rem; flex-shrink: 0; }
.cp-sidebar-link:hover, .cp-sidebar-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-left-color: var(--border-hover);
}
.cp-sidebar-link.active {
  color: var(--red);
  background: rgba(229,9,20,.07);
  border-left-color: var(--red);
  font-weight: 600;
}
.cp-sidebar-count {
  margin-left: auto;
  font-size: .68rem;
  color: var(--text-dim);
  background: var(--bg-3);
  padding: .1rem .35rem;
  border-radius: 8px;
}
.cp-sidebar-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  font-weight: 600;
  padding: .75rem 1rem .2rem;
}

/* Hamburger corrigido (sempre mostrar) */
.cp-topbar-burger {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  padding: 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}
.cp-topbar-burger:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.cp-topbar-burger span {
  display: block;
  width: 100%; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform .25s, opacity .25s, background .15s;
}
.cp-topbar-burger:hover span { background: var(--text); }
body.sidebar-open .cp-topbar-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sidebar-open .cp-topbar-burger span:nth-child(2) { opacity: 0; }
body.sidebar-open .cp-topbar-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Logo — span sem class vira vermelho */
.cp-topbar-logo span { color: var(--red); }
.cp-topbar-logo i    { color: var(--red); font-size: 1.2rem; }

/* Modal --sm */
.cp-modal--sm { max-width: 340px; }

/* ============================================================
   FOOTER
   ============================================================ */
.cp-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.cp-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.25rem;
}

.cp-footer-brand { }
.cp-footer-logo {
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: .4rem;
  letter-spacing: -.5px;
}
.cp-footer-logo span { color: var(--red); }
.cp-footer-tagline {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  max-width: 260px;
}
.cp-footer-social { display: flex; gap: .6rem; }
.cp-footer-social a {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .85rem;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.cp-footer-social a:hover { border-color: var(--red); color: var(--red); background: rgba(229,9,20,.08); }

.cp-footer-heading {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: .85rem;
}
.cp-footer-links { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.cp-footer-links a {
  font-size: .84rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.cp-footer-links a:hover { color: var(--red); }

.cp-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: .5rem;
}

/* Toasts */
.cp-toasts {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 320px;
}
.cp-toast {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: toastIn .25s ease;
}
.cp-toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } }
@keyframes toastOut { to   { opacity:0; transform:translateX(20px); } }
.cp-toast-success { border-left: 3px solid #22c55e; }
.cp-toast-success i { color: #22c55e; }
.cp-toast-danger  { border-left: 3px solid var(--red); }
.cp-toast-danger  i { color: var(--red); }
.cp-toast-warning { border-left: 3px solid #fbbf24; }
.cp-toast-warning i { color: #fbbf24; }
.cp-toast-info    { border-left: 3px solid #38bdf8; }
.cp-toast-info    i { color: #38bdf8; }

/* Offline bar (footer version) */
#offlineBar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: .4rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

/* ── Media queries footer ── */
@media (max-width: 900px) {

  .cp-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .cp-footer-grid { grid-template-columns: 1fr; }
  .cp-footer-brand { grid-column: auto; }
}

/* ── Hero slides rotação ── */
.cp-hero-slide {
    position:absolute;
    inset:0;
    opacity:0;
    transition:opacity .8s ease;
    pointer-events:none;
    z-index:1;
}
.cp-hero-slide.active {
    opacity:1;
    pointer-events:auto;
    z-index:2;
}
.cp-hero-dots {
    position:absolute;
    bottom:1.25rem; left:50%;
    transform:translateX(-50%);
    display:flex; gap:.4rem; z-index:10;
}
.cp-hero-dot {
    width:8px; height:8px;
    border-radius:50%;
    background:rgba(255,255,255,.4);
    border:none; cursor:pointer;
    transition:background .3s, transform .3s;
}
.cp-hero-dot.active {
    background:#fff;
    transform:scale(1.3);
}
.cp-hero-arrow {
    position:absolute;
    top:50%; transform:translateY(-50%);
    z-index:10;
    width:40px; height:40px;
    border-radius:50%;
    background:rgba(0,0,0,.5);
    border:1px solid rgba(255,255,255,.2);
    color:#fff; font-size:.9rem;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
    transition:background .2s;
}
.cp-hero-arrow:hover { background:rgba(0,0,0,.8); }
.cp-hero-arrow--prev { left:1rem; }
.cp-hero-arrow--next { right:1rem; }

/* ── Comentários ── */
.cp-comment {
  display: flex; gap: .75rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
}
.cp-comment:last-child { border-bottom: none; }
.cp-comment--reply { padding: .6rem 0 .6rem 2rem; }
.cp-comment-replies { margin-top: .4rem; border-left: 2px solid var(--border); padding-left: .75rem; }
.cp-comment-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .9rem; flex-shrink: 0;
}
.cp-comment-avatar--sm { width: 28px; height: 28px; font-size: .75rem; }
.cp-comment-body { flex: 1; min-width: 0; }
.cp-comment-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; flex-wrap: wrap; }
.cp-comment-author { font-size: .88rem; }
.cp-comment-time   { font-size: .74rem; color: var(--text-muted); }
.cp-comment-text   { font-size: .87rem; color: var(--text); line-height: 1.55; word-break: break-word; }
.cp-comment-actions { display: flex; gap: .5rem; margin-top: .4rem; }
.cp-comment-btn {
  display: flex; align-items: center; gap: .3rem;
  background: none; border: none; color: var(--text-dim);
  font-size: .78rem; cursor: pointer; padding: .2rem .4rem;
  border-radius: var(--radius-sm); transition: color var(--transition), background var(--transition);
}
.cp-comment-btn:hover, .cp-comment-btn.active { color: var(--red); background: rgba(229,9,20,.07); }
.cp-comment-btn.active i { font-weight: 900; }

/* Hero título vermelho em modo claro */
[data-theme="light"] .cp-hero-title { color: var(--red) !important; text-shadow: 0 1px 6px rgba(0,0,0,.1); }
