/* ---------- Light Theme ---------- */
:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-light: #6b7280;
    --accent: #0d6efd;
    --accent-hover: #0b5ed7;
    --success: #22c55e;
    --shadow: 0 8px 24px rgba(0,0,0,.06);
    --radius: 12px;
    --transition: 0.15s ease-in-out;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    padding: 24px;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* Top Bar — make it as wide as the main stage */
.topbar {
    /* was max-width:1200px; */
    max-width: 1800px; /* match .container */
    width: 100%;
    margin: 0 auto 12px auto;
    padding: 0 8px; /* small side padding */
    display: flex;
    align-items: center;
    justify-content: space-between; /* bubble hard-left, buttons hard-right */
    gap: 12px;
}

/* Profile Icon (unchanged) */
.profile-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    user-select: none;
    box-shadow: var(--shadow);
}

/* Right-side actions: keep them tight to the right edge */
.topbar-actions {
    margin-left: auto; /* push all the way right */
    display: flex;
    gap: 10px;
}

/* Pill buttons: no underline + never wrap */
.btn-pill,
.btn-pill:link,
.btn-pill:visited,
.btn-pill:hover,
.btn-pill:focus,
.btn-pill:active {
    text-decoration: none; /* remove underline on <a> */
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    padding: 10px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--border);
    font-weight: 400; /* <-- Normal weight */
    color: var(--accent-hover);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
}

.btn-pill:hover {
    background: #e9f2ff;
    border-color: var(--accent);
}

.btn-pill.copied {
    background: var(--success) !important;
    color: #fff !important;
    border-color: var(--success) !important;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover)
}

/* "Copied!" state */
.btn.copied {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}

/* Main Centered Layout */
.container {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    gap: 32px;
    align-items: flex-start;
    justify-content: center;
}

#player {
    flex: 0 1 2000px;
    width: min(100%, 20000px);
    height: auto;
    border-radius: var(--radius);
    position: relative;
    background: #000;
    overflow: hidden;
    box-shadow: var(--shadow);
}
/* Maintain 16:9 ratio no matter what */
#player::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16/9 ratio */
}
/* Force iframe to fill container 100% */
#player iframe {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    border: none;
}

/* Notes Panel */


.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notes-header h3 {
    margin: 0;
    font-size: 18px;
}

.notes-header .muted {
    font-size: 12px;
    color: var(--text-light)
}

/* =========================
   NOTES + REPLIES (CLEANED)
   ========================= */

/* header row inside each note */
.note-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.note-body{ margin-top: 6px; }

/* Reply button (consistent size everywhere) */
.note-btn{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  flex: 0 0 auto;
}
.note-btn:hover{
  background: #f2f6ff;
  border-color: #cfe0ff;
}

/* Reply composer */
.reply-box{
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.reply-box textarea{
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}
.reply-actions{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  margin-top: 8px;
}

/* Scrollable Notes (grey box) */
#note-list {
    flex: 1 1 auto;
    height: 520px;
    margin-top: 10px;
    overflow-y: auto;
    background: #fafafa;
    border: 1px dashed var(--border);
    border-radius: 10px;

    /* IMPORTANT: allow notes to be nearly full width of this box */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
}

/* Individual Note bubble — nearly full width of grey box */
.note {
    width: 100%;
    max-width: none;
    background: #fff;
    border: 1px solid var(--border);
    margin: 10px 0;          /* no side margins so it can be wide */
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.note:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 14px rgba(0,0,0,.05);
}

.note.active {
    border-color: #ffd24d;
    box-shadow: 0 6px 16px rgba(255,210,77,.25);
}

/* Thread wrapper (requires your JS wrapper: .note-thread + sibling .replies) */
.note-thread{
  margin-top: 12px;
}
.note-thread:first-child{
  margin-top: 0;
}

/* Replies area sits UNDER the bubble, not inside it */
.note-thread > .replies{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Reply bubbles: right aligned + shorter on the left */
.note.note-reply{
  margin-left: auto;
}

/* Depth-based width reduction for replies ONLY (no scaling) */
.note.note-reply[data-depth="1"]{ width: 92%; }
.note.note-reply[data-depth="2"]{ width: 88%; }
.note.note-reply[data-depth="3"]{ width: 84%; }
.note.note-reply[data-depth="4"]{ width: 80%; }
.note.note-reply[data-depth="5"],
.note.note-reply[data-depth="6"],
.note.note-reply[data-depth="7"],
.note.note-reply[data-depth="8"],
.note.note-reply[data-depth="9"]{ width: 80%; }

.muted {
    color: var(--text-light);
    font-size: 12px
}

/* Note Input + Buttons */
#note-input {
    flex: 0 0 auto;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    resize: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
}

.row {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: #f2f6ff;
    border-color: #cfe0ff;
}

.btn-share {
    padding: 6px 12px;
    max-width: 150px;
    border-radius: 8px;
}

/* Responsive stacking for smaller screens */
@media(max-width:1250px) {
    .container {
        flex-direction: column
    }

    .notes-panel {
        width: 100%;
        max-height: none
    }
}

.profile-menu {
    position: absolute;
    top: 60px;
    left: 24px;
    width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px 0;
    display: none;
    z-index: 999;
}

.menu-header {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
    color: var(--text-light);
}

#recentVideosList {
    list-style: none;
    margin: 0;
    padding: 0;
}

#recentVideosList li a {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 14px;
}

#recentVideosList li a:hover {
    background: #eef4ff;
    color: var(--accent);
}

.menu-divider {
    height: 1px;
    margin: 8px 0;
    background: var(--border);
}

.menu-logout {
    display: block;
    padding: 10px 14px;
    color: #d13232;
    text-decoration: none;
    font-weight: 600;
}

.menu-logout:hover {
    background: #ffe6e6;
}

.no-vod-message {
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 24px;
    height: 100%;
    opacity: 0.8;
}

.login-box {
    max-width: 340px;
    margin: 120px auto;
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 16px;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.error {
    color: red;
    margin-bottom: 10px;
}

/* --- Modal Popup --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
    z-index: 1000;
}
.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow);
}

.modal-content h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.modal-content input {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.modal-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary {
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.btn-cancel {
    padding: 10px 16px;
    background: #ddd;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.filters { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); z-index: 1000; }
.filters.hidden { display: none; }
.filters-card { width: min(520px, 92vw); background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.2); padding: 16px; }
.filters-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters-body .row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.filters-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn-close { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; }

.notes-panel .row {
    padding: 12px;
    margin: 10px -16px -16px; /* extend to panel edges */
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

.notes-panel #note-input {
    margin-left: 2px;
    margin-right: 2px;
}

.profile-bubble {
    border: none;
    padding: 0;
    cursor: pointer;
    overflow: hidden; /* ensures avatar stays circular */
}

.profile-avatar {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* --- Global App Bar --- */
.appbar{
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  background:#f8fafc;
  border-bottom:1px solid #e5e7eb;
  position:sticky;
  top:0;
  z-index:1000;
}

.appbar__logo{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}

.appbar__logo img{
  height:36px;     /* ✅ hard cap */
  width:auto;
  display:block;
  object-fit:contain;
}

.appbar__right{
  display:flex;
  align-items:center;
  gap:10px;
}

.appbar__avatar{
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  padding:0;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
}

.appbar__avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* ===== Vodder Topbar Fix (override) ===== */
.vodder-topbar{
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

/* Force logo to be small no matter what */
.vodder-logo img{
  height: 40px !important;
  width: auto !important;
  max-height: 40px !important;
  display: block !important;
  object-fit: contain !important;
}

/* Make the avatar sit top-right and behave */
.vodder-avatar{
  width: 49px !important;
  height: 49px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.vodder-avatar img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* ===== Vodder Topbar Logo + Avatar Size Bump ===== */
.vodder-logo{
  width: 48px;          /* ⬅ was 44 */
  height: 48px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.vodder-logo img{
  width: 72%;           /* ⬅ slightly larger */
  height: 72%;
  object-fit: contain;
  display: block;
}

/* Hide Vodder logo, keep profile avatar */
.topbar .vodder-logo {
  display: none;
}

/* Topbar: force content to the far right of the viewport */
.topbar {
  max-width: none;      /* remove centering constraint */
  width: 100%;
  margin: 0;            /* kill auto-centering */
  padding-right: 24px;  /* breathing room from edge */
  justify-content: flex-end;
}

/* When logo is hidden, hard-pin avatar to the right */
.topbar.vodder-topbar{
  justify-content: flex-end !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  max-width: none !important;
  margin: 0 !important;
  width: 100% !important;
}

.profile-menu{
  position: absolute;
  top: 64px;
  right: 24px;
  width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 9999;
  overflow: hidden;
}

.profile-item{
  display: block;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.profile-item:hover{
  background: #eef4ff;
  color: var(--accent);
}

.profile-item.logout{
  color: #d13232;
}

.profile-item.logout:hover{
  background: #ffe6e6;
}

.menu-divider{
  height: 1px;
  background: var(--border);
}

.topbar{
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-wrap{
  position: relative;
}

/* --- YouTube-style profile menu --- */
.profile-menu{
  position: fixed !important;
  display: none;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
  padding: 8px 0;
  z-index: 999999;
}

/* kill any older positioning rules */
.profile-menu{ left:auto !important; right:auto !important; top:auto !important; bottom:auto !important; }
/* =========================
   Notes spacing tightening
   ========================= */

/* 1) Space between ALL notes (parent notes) */
#note-list .note {
  margin-top: 0px;           /* was ~10px */
}

/* 2) Space between parent note and its replies */
.note-thread {
  margin-top: 0px;         /* was ~12px */
}

/* 3) Space between reply bubbles */
.note-thread > .replies {
  margin-top: 0px;         /* was ~10px */
  gap: 0px;                /* was ~10px */
}

/* Optional: make replies feel a bit tucked under the parent */
.note.note-reply {
  margin-top: 0;           /* rely on gap instead */
}

.notes-panel {
    flex: 0 0 380px;
    display: flex;
    flex-direction: column;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
/* =========================
   Collapse replies toggle
   ========================= */

.note-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Small triangle button */
.reply-toggle {
  background: none;
  border: none;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--text-light);
  border-radius: 4px;
}

.reply-toggle:hover {
  background: #eef4ff;
  color: var(--accent);
}
/* Force the right-side actions to stack vertically */
.note .note-actions{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 4px !important;
}

/* Make Expand/Collapse look like a small link under Reply */
.note .reply-toggle-link{
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.note .reply-toggle-link:hover{
  color: var(--accent);
  text-decoration: underline;
}
/* Make hidden always win (your .replies { display:flex } can override otherwise) */
.replies[hidden] {
  display: none !important;
}
/* Toggle under note text */
.note-footer{
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Expand / Collapse link styling */
.reply-toggle-link{
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
    justify-content: right;

}

.reply-toggle-link:hover{
  color: var(--accent);
  text-decoration: underline;
}
