/* CigarsChannel.tv — dark theme, red accent */
:root {
  --bg: #0b0b0d;
  --bg-2: #141418;
  --bg-3: #1d1d22;
  --border: #2a2a31;
  --text: #f5f5f7;
  --text-dim: #9a9aa3;
  --accent: #dc2626;
  --accent-2: #ef4444;
  --accent-dim: #7f1d1d;
  --gold: #c9a84c;
  --topbar-h: 56px;
  --sidebar-w: 220px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; min-height: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--border); margin: 8px 12px; }

/* Topbar */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: rgba(11,11,13,0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); z-index: 50;
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 0 14px; max-width: 100%;
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.logo { font-size: 22px; }
.brand-text { letter-spacing: -.3px; }
.brand-accent { color: var(--accent); }
.tld { color: var(--text-dim); font-weight: 500; font-size: 14px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; background: var(--bg-3);
  border: 1px solid var(--border); transition: background .15s;
}
.icon-btn:hover { background: var(--border); }
.menu-btn { display: none; }
.search { flex: 1; max-width: 600px; display: flex; gap: 0; }
.search input { border-radius: 999px 0 0 999px; border-right: 0; }
.search-btn {
  width: 56px; border: 1px solid var(--border); border-left: 0;
  background: var(--bg-3); border-radius: 0 999px 999px 0;
}
.search-btn:hover { background: var(--border); }
.top-right { display: flex; align-items: center; gap: 10px; }
.btn-primary {
  background: var(--accent); color: white; padding: 8px 16px; border-radius: 999px;
  font-weight: 600; transition: background .15s;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost {
  background: transparent; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-3); }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--border); cursor: pointer; }
.user-pill:hover { background: var(--border); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: white; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; font-size: 32px; }

/* Sidebar */
#sidebar {
  position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: var(--sidebar-w);
  background: var(--bg); border-right: 1px solid var(--border); overflow-y: auto; padding: 12px 0; z-index: 40;
}
#sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.navlink {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px; font-size: 14px; color: var(--text);
  transition: background .12s;
}
.navlink:hover { background: var(--bg-3); }
.navlink.active { background: var(--bg-3); border-left: 3px solid var(--accent); padding-left: 15px; }
.ni { font-size: 18px; width: 22px; text-align: center; }

/* Main */
#app {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  padding: 22px 28px 80px; min-height: calc(100vh - var(--topbar-h));
}

/* Category chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 4px; }
.chip {
  background: var(--bg-3); border: 1px solid var(--border); padding: 6px 14px;
  border-radius: 999px; cursor: pointer; transition: all .15s; font-size: 13px;
}
.chip:hover { background: var(--border); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Video grid */
.grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vcard { cursor: pointer; transition: transform .15s; }
.vcard:hover { transform: translateY(-2px); }
.vthumb {
  width: 100%; aspect-ratio: 16/9; background: var(--bg-3); border-radius: 12px;
  overflow: hidden; position: relative;
  background-image: linear-gradient(135deg, #2a1a1a, #0b0b0d);
}
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vthumb .duration {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.85); color: white;
  padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600;
}
.vinfo { display: flex; gap: 10px; margin-top: 10px; }
.vinfo .avatar { width: 36px; height: 36px; flex-shrink: 0; }
.vmeta { flex: 1; min-width: 0; }
.vtitle { font-weight: 600; font-size: 15px; line-height: 1.3; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vchannel, .vstats { font-size: 13px; color: var(--text-dim); }
.vchannel:hover { color: var(--text); }

/* Watch page */
.watch { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px; }
.player-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: black; border-radius: 12px; overflow: hidden; }
.player-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.ad-overlay {
  position: absolute; right: 12px; top: 12px; background: rgba(0,0,0,.85);
  color: white; padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 600;
  display: flex; gap: 10px; align-items: center;
}
.ad-skip-btn {
  background: var(--bg-3); color: white; border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 4px; font-weight: 600;
}
.ad-skip-btn:hover { background: var(--accent); border-color: var(--accent); }
.watch h1 { font-size: 22px; margin: 14px 0 8px; }
.watch-stats { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.action-row button { background: var(--bg-3); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); transition: background .15s; }
.action-row button:hover { background: var(--border); }
.action-row button.active { background: var(--accent); border-color: var(--accent); }

.channel-row {
  display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.channel-row .meta { flex: 1; }
.channel-row .name { font-weight: 600; font-size: 16px; }
.channel-row .subs { color: var(--text-dim); font-size: 13px; }

.description {
  background: var(--bg-2); padding: 14px; border-radius: 12px; white-space: pre-wrap;
  word-break: break-word; max-height: 100px; overflow: hidden; position: relative; cursor: pointer;
}
.description.expanded { max-height: none; }
.description .more { color: var(--text-dim); display: block; margin-top: 6px; font-weight: 600; }

.related { display: flex; flex-direction: column; gap: 12px; }
.related .vcard { display: flex; gap: 8px; }
.related .vthumb { width: 168px; aspect-ratio: 16/9; flex-shrink: 0; }
.related .vmeta { padding-top: 0; }
.related .vtitle { font-size: 14px; -webkit-line-clamp: 2; }

/* Comments */
.comments h3 { margin: 22px 0 10px; }
.comment-form { display: flex; gap: 10px; margin-bottom: 18px; }
.comment-form .avatar { flex-shrink: 0; }
.comment-form textarea { resize: vertical; min-height: 60px; }
.comment { display: flex; gap: 10px; padding: 12px 0; }
.comment .body { flex: 1; }
.comment .author { font-weight: 600; font-size: 13px; }
.comment .ago { color: var(--text-dim); font-size: 12px; margin-left: 6px; }
.comment .text { margin: 4px 0; word-break: break-word; }
.comment .actions { display: flex; gap: 14px; color: var(--text-dim); font-size: 12px; }
.comment .actions button { color: inherit; }
.comment .actions button:hover { color: var(--text); }

/* Channel page */
.channel-banner {
  width: 100%; aspect-ratio: 6/1; background: linear-gradient(135deg, #2a1a1a, #0b0b0d);
  border-radius: 14px; overflow: hidden; margin-bottom: 14px; min-height: 100px;
}
.channel-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-header { display: flex; gap: 18px; align-items: flex-start; padding: 8px 0 18px; border-bottom: 1px solid var(--border); }
.channel-header .meta { flex: 1; }
.channel-header h1 { margin: 0 0 4px; font-size: 26px; }
.channel-header .handle { color: var(--text-dim); }
.channel-header .stats { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.channel-header .bio { margin-top: 10px; max-width: 800px; color: var(--text); }
.tabs { display: flex; gap: 6px; margin: 18px 0; border-bottom: 1px solid var(--border); }
.tab {
  padding: 10px 18px; border-bottom: 2px solid transparent;
  font-weight: 600; color: var(--text-dim); cursor: pointer;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* Forms */
.form { max-width: 500px; margin: 30px auto; background: var(--bg-2); padding: 28px; border-radius: 14px; border: 1px solid var(--border); }
.form h2 { margin: 0 0 18px; font-size: 22px; }
.form .row { margin-bottom: 14px; }
.form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.form .submit { width: 100%; background: var(--accent); padding: 12px; border-radius: 8px; font-weight: 600; margin-top: 10px; color: white; }
.form .submit:hover { background: var(--accent-2); }
.form .alt { text-align: center; margin-top: 14px; color: var(--text-dim); font-size: 13px; }
.form .alt a { color: var(--accent); }
.form .err { color: #fda4af; background: rgba(220,38,38,.15); padding: 10px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.form .ok { color: #86efac; background: rgba(34,197,94,.15); padding: 10px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }

/* Wide form */
.form-wide { max-width: 800px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }

/* Stepper */
.stepper { display: flex; gap: 8px; margin-bottom: 22px; }
.step { flex: 1; padding: 8px; border-radius: 8px; background: var(--bg-3); text-align: center; font-size: 12px; color: var(--text-dim); border: 1px solid var(--border); }
.step.done { background: var(--accent-dim); color: white; border-color: var(--accent); }
.step.current { background: var(--accent); color: white; border-color: var(--accent); }
.cat-cards { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.cat-card { padding: 18px; background: var(--bg-3); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .15s; }
.cat-card:hover { border-color: var(--accent); }
.cat-card.selected { border-color: var(--accent); background: rgba(220,38,38,.1); }
.cat-card .ic { font-size: 28px; margin-bottom: 6px; }
.cat-card .name { font-weight: 700; }
.cat-card .desc { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

/* Brands */
.brand-filters { display: grid; gap: 10px; grid-template-columns: 2fr 1fr 1fr 1fr; margin-bottom: 18px; }
@media (max-width: 800px) { .brand-filters { grid-template-columns: 1fr 1fr; } }
.bcard {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  cursor: pointer; transition: transform .15s, border-color .15s;
}
.bcard:hover { transform: translateY(-2px); border-color: var(--accent); }
.bcard h3 { margin: 0 0 6px; font-size: 16px; }
.bcard .country { color: var(--gold); font-size: 12px; font-weight: 600; }
.bcard .meta { color: var(--text-dim); font-size: 12px; margin-top: 6px; }
.bcard .lines { font-size: 12px; margin-top: 8px; color: var(--text); }

/* Upload zone */
.dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 50px 20px;
  text-align: center; transition: all .15s; cursor: pointer; background: var(--bg-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(220,38,38,.05); }
.dropzone .ic { font-size: 48px; margin-bottom: 8px; }
.progress { width: 100%; height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; margin: 14px 0; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .2s; }

/* Tables */
table.t { width: 100%; border-collapse: collapse; background: var(--bg-2); border-radius: 12px; overflow: hidden; }
table.t th, table.t td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
table.t th { background: var(--bg-3); font-weight: 600; color: var(--text-dim); }
table.t tr:last-child td { border-bottom: 0; }

/* Stats cards */
.stats-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: 22px; }
.stat-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.stat-card .num { font-size: 28px; font-weight: 700; }
.stat-card .lbl { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 14px; }
.modal .close { float: right; }

/* Toast */
#toastRoot { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-3); border: 1px solid var(--border); padding: 12px 18px;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.5); font-size: 13px;
  animation: slideIn .25s ease;
}
.toast.error { border-color: var(--accent); }
.toast.ok { border-color: #22c55e; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Section heading */
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.section-h h2 { margin: 0; font-size: 18px; }
.section-h a { color: var(--text-dim); font-size: 13px; }

/* Empty state */
.empty { padding: 60px 20px; text-align: center; color: var(--text-dim); }
.empty .ic { font-size: 56px; margin-bottom: 10px; }

/* Dropdown menu */
.menu {
  position: absolute; right: 14px; top: calc(var(--topbar-h) - 4px);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6); padding: 8px; min-width: 220px; z-index: 60;
}
.menu a, .menu button { display: block; width: 100%; padding: 10px 12px; border-radius: 6px; text-align: left; font-size: 14px; }
.menu a:hover, .menu button:hover { background: var(--bg-3); }
.menu hr { margin: 6px 4px; }

/* Tags */
.tag { display: inline-block; background: var(--bg-3); padding: 3px 10px; border-radius: 999px; font-size: 12px; margin: 2px; cursor: pointer; }
.tag:hover { background: var(--accent); }

/* Mobile */
@media (max-width: 900px) {
  .watch { grid-template-columns: 1fr; }
  .related .vthumb { width: 140px; }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-100%); transition: transform .25s; width: 240px; }
  #sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  #app { padding: 16px 14px 80px; }
  .form-grid { grid-template-columns: 1fr; }
  .brand-text { display: none; }
  .tld { display: none; }
}
