:root {
  --sidebar-collapsed-width: 81px;
  --sidebar-expanded-width: 272px;
  --transition-duration-expand: 300ms;
  --transition-duration-collapse: 250ms;
  --transition-curve-expand: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-curve-collapse: cubic-bezier(0.87, 0, 0.13, 1);
  --color-neutral-background: #20242a;
  --color-neutral-border: #23282c;
  --color-main-bg: #16181d;
  --color-surface: #23282c;
  --color-surface-2: #232b35;
  --color-primary: #2dbfff;
  --color-accent: #3fd8cf;
  --color-success: #FF5722;
  --color-danger: #FF5722;
  --color-danger-dark: #b02727;
  --color-btn-secondary: #282f38;
  --color-btn-secondary-txt: #97a6b9;
  --color-sidebar-head: #FFFFFF;
  --color-channel-title: #e6ebf2;
  --color-channel-meta: #a0ffe6;
  --color-channel-desc: #98acbb;
  --color-post-title: #e6ebf2;
  --color-post-meta: #9ea6b2;
  --color-post-content: #a5bdcf;
  --color-comment-author: #e8eefc;
  --color-comment-meta: #b0bad0;
  --color-comment-content: #a5bdcf;
  --color-main-txt: #e6ebf2;
  --color-main-txt-light: #c8e0f6;
  --color-main-txt-secondary: #8d8d8d;
  --shadow-main: 0 2px 12px 0 rgba(0,40,120,0.08);
  --shadow-btn: 0 1px 5px 0 rgba(30,33,38,0.05);
  --header-height: 50px;
}


.hidden {
  display: none;
}

.post-meta-dropdown {
	min-width: 100px;
    position: absolute;
    font-size: 16px;
	margin-top: 5px;
    right: 0;
    top: 100%;
    background: #2b2f38;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
	overflow: hidden;
}

.post-meta-menu-toggle {
	background: none;
	fill: var(--color-post-title);
	padding: 9px;
    border: none;
    cursor: pointer;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-meta-menu-toggle:hover {
    background: #2b2f38;
}


.post-meta-menu-item {
    padding: 10px 15px;
	font-size: 14px;
	display: flex;
	align-items: center;
    gap: 15px;
	fill: var(--color-post-title);
	color: var(--color-post-title);
	cursor: pointer;
}

.post-meta-menu-item svg{
     width: 14px;
	 height: 14px;
}

.post-meta-menu-item:hover {
    background: #373d44;
}





.yt-overlay-btn {
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 17px;
    padding: 3px 8px;
    cursor: pointer;
}


#yt-float-player {
    transition: box-shadow .2s;
    max-width: 340px;
    max-height: 210px;
}
#yt-float-player:hover {
    box-shadow: 0 8px 32px #0006;
}


input::placeholder {
  color: #6b7780; /* Light gray */
  opacity: 1;     /* Make sure it's fully visible */
}

/* For textarea too */
textarea::placeholder {
  color: #6b7780; /* Example: teal */
}

/* Reset & base */
html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  background: var(--color-main-bg);
  color: var(--color-main-txt);
  scrollbar-color: #818181 var(--color-main-bg);
}
body {
	touch-action: manipulation;
  background: var(--color-main-bg);
    overflow-y: scroll;
	-webkit-overflow-scrolling: touch;
}

a {
    color: #2196F3;
    text-decoration: none;
}

h2 {
    font-size: 20px;
    font-weight: 500;
}

iframe {
    border-radius: 10px;
}

#topbar {
  position: fixed;
  gap: 10px;
  top: 0; left: 0; right: 0;
  z-index: 999999999;
  height: var(--header-height);
  background: var(--color-main-bg);
  color: var(--color-main-txt);
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid var(--color-neutral-border);
  padding: 0 22px;
  font-size: 17px;
  box-shadow: 0 1.5px 10px 0 #10131b0c;
}
#topbar .logo {
  font-size: 21px;
  font-weight: 800;
  color: var(--color-channel-title);
  letter-spacing: 1.5px;
  margin-right: 32px;
  white-space: nowrap;
}
#topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  max-width: 450px;
  margin: auto;
}
#topbar-search input[type="text"] {
  background: var(--color-surface);
  color: var(--color-main-txt);
  border: none;
  border-radius: 50px;
  padding: 9px 18px;
  font-size: 16px;
  margin-right: 8px;
  outline: none;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.15s;
}
#topbar-search input[type="text"]:focus {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.username-icon img {
    border-radius: 50px;
	    max-width: 100%;
    height: 100%;
    object-fit: cover;
}

.username-icon {
    background: #F44336;
    border-radius: 50px;
    display: flex
;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 400;
}

#user-dropdown {
  position: relative;
}
#user-dropdown-btn {
    background: none;
    border: none;
    color: var(--color-main-txt);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border-radius: 99px;
    transition: background 0.15s;
}
#user-dropdown-btn:hover {
  background: var(--color-surface);
}
#user-dropdown-caret { font-size: 13px; }
#user-dropdown-menu {
  position: absolute;
  overflow: hidden;
  top: 38px;
  right: 0;
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: 0 5px 22px #0005;
  min-width: 120px;
  color: var(--color-main-txt);
  z-index: 99;
  display: none;
  text-align: left;
  border: 1px solid var(--color-neutral-border);
}
#user-dropdown-menu > div {
  padding: 11px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-neutral-border);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  fill: var(--color-main-txt);
}
#user-dropdown-menu > div:last-child { border-bottom: none; }
#user-dropdown-menu > div:hover {
  background: var(--color-btn-secondary);
  color: var(--color-btn-secondary-txt);
  fill: var(--color-btn-secondary-txt);
  
}

/* LAYOUT GRID */
.grid-container {
  background: var(--color-main-bg);
}
.grid-container.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) 1fr;
  transition: grid-template-columns var(--transition-duration-collapse) var(--transition-curve-collapse);
}
@media (max-width: 900px) {
  .grid-container, .grid-container.sidebar-expanded, .grid-container.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
}


/* --- Modern Dropdown Styles --- */
.post-sorting-action {
	margin-bottom: 15px;
}

.modern-dropdown {
  position: relative;
  width: 110px;                 /* Change as needed */
  font-size: 15px;
  user-select: none;
}

/* --- Selected (Button) --- */
.modern-dropdown-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0px 10px;
  color: #fff;
  border-radius: 50px;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, box-shadow 0.15s;
  -webkit-font-smoothing: antialiased;
  outline: none;
  gap: 8px;
}

/* --- Hover & Open State (background only) --- */
.modern-dropdown-selected:hover,
.modern-dropdown.is-open .modern-dropdown-selected {
  background: #23282c;
  /* DO NOT change border, padding, or font-size! */
}

/* --- Arrow Icon (SVG) --- */
.dropdown-arrow {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  fill: white;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* transition: transform 0.22s;  <-- REMOVED! */
}

/* --- Dropdown Menu --- */
.modern-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #23282c;
  color: #fff;
  border-radius: 12px;
  margin-top: 4px;
  z-index: 5;
  box-shadow: 0 8px 24px #0004;
  min-width: 100%;
  padding: 4px 0;
  display: none;
  overflow: hidden;
}

/* Open state: menu visible */
.modern-dropdown.is-open .modern-dropdown-menu {
  display: block;
  animation: dropdownFadeIn 0.18s;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px);}
  to   { opacity: 1; transform: translateY(0);}
}

.modern-dropdown-menu div {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.13s;
  white-space: nowrap;
}

.modern-dropdown-menu div:hover,
.modern-dropdown-menu div.selected {
  background: #ffffff22;
  color: #fff;
}

/* Prevent iOS text/input zoom bug (optional) */
.modern-dropdown, .modern-dropdown-menu, .modern-dropdown-selected {
  -webkit-text-size-adjust: 100%;
}

/* Optional: No outline unless focused via keyboard */
.modern-dropdown-selected:focus-visible {
  outline: 2px solid #51a7ff;
}

/* Accessibility: prevent page scroll when menu is open (optional, JS handles) */
body.dropdown-open {
  overscroll-behavior: contain;
  touch-action: none;
}





/* SIDEBAR */
.sidebar {
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent; /* Hide scrollbar color on Firefox */
  padding-bottom: var(--header-height);
  background: var(--color-main-bg);
  border-right: 1.5px solid var(--color-neutral-border);
  display: flex;
  flex-direction: column;
  min-width: var(--sidebar-expanded-width);
  max-width: var(--sidebar-expanded-width);
  width: var(--sidebar-expanded-width);
  height: calc(100vh - var(--header-height));
  box-sizing: border-box;
  position: fixed;
  z-index: 10;
  transition: min-width var(--transition-duration-expand) var(--transition-curve-expand),
              max-width var(--transition-duration-expand) var(--transition-curve-expand),
              width var(--transition-duration-expand) var(--transition-curve-expand);
}

/* Optional: Hide WebKit Scrollbar visuals */
.sidebar::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

.sidebar:hover {
  scrollbar-color: #444750 var(--color-main-bg);
}

.grid-container.sidebar-collapsed .sidebar {
  min-width: var(--sidebar-collapsed-width);
  max-width: var(--sidebar-collapsed-width);
  width: var(--sidebar-collapsed-width);
  transition: min-width var(--transition-duration-collapse) var(--transition-curve-collapse),
              max-width var(--transition-duration-collapse) var(--transition-curve-collapse),
              width var(--transition-duration-collapse) var(--transition-curve-collapse);
}

#main.sidebar-collapsed {
    margin-left: 150px;
}


#main {
  /* existing styles ... */
  transition:
    margin-left var(--transition-duration-expand) var(--transition-curve-expand);
}
.grid-container.sidebar-collapsed #main {
  transition:
    margin-left var(--transition-duration-collapse) var(--transition-curve-collapse);
}


/* Sidebar Toggle */
#sidebarToggle {
    position: absolute;
	line-height: 0;
    top: 11px;
    right: 8px;
    background: var(--color-surface);
    color: var(--color-channel-title);
    border: none;
    border-radius: 50%;
    z-index: 11;
    cursor: pointer;
    width: 32px;
    align-items: center;
    justify-content: center;
    height: 32px;
    display: flex;
    font-size: 20px;
    box-shadow: 0 2px 8px 0 rgba(30, 30, 30, 0.17);
    transition: background .2s;
}
#sidebarToggle:hover { background: #ffffff24; color: var(--color-main-bg); }

.sidebar-head {
	text-transform: uppercase;
    font-size: 13px;
    font-weight: 500;
    color: #5a636d;
    margin-bottom: 13px;
    margin-top: 36px;
    margin-left: 16px;
}

 button { margin: 0; }

/* Button Styles (rounded only!) */
.button, .button.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 99px;
  width: max-content;
  padding: 8px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background .17s;
  font-weight: 500;
  box-shadow: var(--shadow-btn);
  outline: none;
}

.button.create{
	display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #ffffff9e;
    color: #fff;
    border-radius: 99px;
    width: max-content;
    padding: 8px 18px;
    font-size: 15px;
    cursor: pointer;
    transition: background .17s;
    font-weight: 500;
    box-shadow: var(--shadow-btn);
    outline: none;
}

.button.create:hover{
	background: transparent;
    border: 1px solid #fff;
}
.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 99px;
  width: max-content;
  padding: 8px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background .17s;
  font-weight: 500;
  box-shadow: var(--shadow-btn);
  outline: none;
}
.submit-button:hover {
  background: #0054cf;
}
.button:hover { background: #0054cf; }
.button.delete { background: var(--color-btn-secondary); color:var(--color-btn-secondary-txt);}
.button.secondary.delete:hover {
  background: var(--color-danger-dark);
}
.button.secondary {
  background: var(--color-btn-secondary);
  color: var(--color-btn-secondary-txt);
      gap: 5px;
}
.button.secondary:hover {
    background: #343c47;
}
button.button.secondary.button-back {
  margin-right: 7px;
  display: flex;
  width: 34px;
  height: 34px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: var(--color-btn-secondary);
  color: var(--color-btn-secondary-txt);
}
button.button.secondary.button-back svg{
  width: 16px;
  height: 16px;
  fill: white;
}
.button:active { filter: brightness(0.98);}
.button:disabled { opacity: 0.6; cursor: default; }

/* Channel list scrolls independently */
.channel-list {
  flex: 1 1 auto;
  margin-left: 7px;
  margin-right: 8px;
}

.channel-lock-icon {
  fill: #a7b4c5;
  width: 12px;
  height: 12px;
}

.channel-list::-webkit-scrollbar { width: 7px; }
.channel-list::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 5px;}
.channel-list::-webkit-scrollbar-track { background: var(--color-neutral-border); }
.channel {
  padding: 10px 12px 10px 16px;
  border-radius: 11px;
  cursor: pointer;
  transition: box-shadow .14s, border .13s, background .13s;
  box-shadow: var(--shadow-btn);
  position: relative;
}
@media (hover: hover) and (pointer: fine) {
  .channel:hover {
    background: #1b232a;
  }
}


.channel-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-channel-title);
}

@media (min-width: 768px) {
.channel-title {
  font-size: 1.75rem;
}
}

.channel-list-sidebar {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  color: var(--color-channel-title);
}

.channel-list-title {
  flex: 1;
}

.channel-meta {
  font-size: 13px;
  color: var(--color-channel-meta);
  margin-top: 1px;
}
.channel-desc {
  color: var(--color-channel-desc);
  font-size: 13px;
  margin-top: 2px;
  margin-bottom: 15px;
}



.mobile-tabs { display:flex; gap:10px; margin-bottom:10px; }
.tab-btn {
  border:none; background:transparent; color:#a6abb6; padding:8px 16px;
  border-radius:99px; font-size:15px; cursor:pointer; font-weight:500; transition:background .18s, color .18s;
}
.tab-btn.active { background:#333a40; color:#fff; }




.channel-topic {
  color: #000;
  background: #FFF;
  padding: 4px 10px;
  width: fit-content;
  border-radius: 50px;
  font-size: 12px;

  display: flex;
  align-items: center;     /* vertical centering */
  justify-content: center; /* horizontal centering */
}

/* MAIN */
#main {
  background: var(--color-main-bg);
  height: auto;
  padding: 0;
  margin-left: 272px;
}
#main-content {
  padding: 10px 0 40px 0;
  margin: auto 20px;
  margin-top: var(--header-height);
  max-width: 1000px;
}
#main-content::-webkit-scrollbar {
  width: 8px;
  background: var(--color-neutral-border);
}
#main-content::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 7px;
}

/* HEADER/CHANNEL INFO */
.header-container {
  margin-bottom: 24px;
  border-bottom: 2px solid #252d35;
  padding: 15px 10px;
}
.header-container .channel-action-btns {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  place-content: flex-end;
}
.header-container .button {
  margin-bottom: 0;
}



/* CHANNEL SIDEBAR */
.channel-sidebar .button svg {
  width: 12px;
  height: 12px;
  fill: #b0bad0;
}

.channel-sidebar {
  position: sticky;
  top: var(--header-height);
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  background: #000000;
  border-radius: 10px;
}

@media (min-width: 768px) {
.channel-sidebar {
  width: 300px;
	}
}




/* POSTS */
.post-list { margin-top: 14px; padding-bottom: 50px;}
.post-card {
  max-width: 700px;
  border-radius: 9px;
  padding: 10px 15px 15px 15px;
  margin-bottom: 16px;
  cursor: pointer;
  position: relative;
  transition: box-shadow .15s, border .15s, background .15s;
}
.post-card:hover {
  background: #232b3594;
}
.post-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-post-title);
  margin: 0 0 8px;
}
.single-post-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-post-title);
  margin: 0 0 8px;
}
.post-meta {
  font-size: 13px;
  color: var(--color-post-meta);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-content {
  font-size: 15px;
  color: var(--color-post-content);
  margin-bottom: 9px;
  white-space: pre-line;
}

.post-content img{
  width: 100%;
}

.post-actions {
  font-size: 13px;
  display: flex;
  gap: 7px;
  margin-top: 7px;
}
.post-actions .button {
  padding: 5px 19px;
  font-size: 14px;
  border-radius: 99px;
}

/* COMMENTS */
.comments-header {
    margin-left: 15px;
    display: flex;
    gap: 20px;
    align-items: center;
}
.comment-list {
  margin: 20px 10px 5px 10px;
}
.comment-card {
  padding: 11px 16px 9px 16px;
  margin-bottom: 9px;
  font-size: 15px;
  margin-left: 0;
}
.comment-card .comment-author {
  color: var(--color-comment-author);
  font-weight: 500;
  font-size: 13px;
}
.comment-meta {
  font-size: 12px;
  color: var(--color-comment-meta);
  margin-left: 5px;
}
.comment-content {
  font-size: 15px;
  color: var(--color-comment-content);
  margin-top: 2px;
}
.comment-actions {
  display: flex;
  gap: 7px;
  margin-top: 7px;
  margin-bottom: 3px;
}
.comment-actions .button {
  padding: 4px 15px;
  font-size: 13px;
  border-radius: 99px;
}

/* FORMS */

.add-comment {
  margin-top: 22px;
  border-radius: 11px;
  padding: 16px 2px;
}

.add-comment input, .add-comment textarea, .add-comment select, .inline-reply-form textarea {
  font-size: 16px;
  padding: 8px 10px 10px 15px;
  width: 100%;
  border-radius: 20px;
  border: 1px solid #334052;
  margin-bottom: 5px;
  background: #1b2028;
  color: var(--color-main-txt-light);
  font-family: inherit;
  box-sizing: border-box;
}


.vote-box, .comment-vote-box {
    display: flex;
    align-items: center;
    background: #282f38;
    height: 32px;
    border-radius: 50px;
    padding: 0px 0px;
	transition: background 0.15s;
}



/* Highlight the whole box if you voted */
.vote-box.voted-up {
  background: #1c7ed61c;  /* subtle blue if upvoted */
}
.vote-box.voted-down {
  background: #f03e3e1a;  /* subtle red if downvoted */
}

/* Vote arrow default color */
.vote-box .upvote svg,
.vote-box .downvote svg {
  fill: #b0bad0; /* default arrow color */
  transition: fill 0.18s;
}

/* Highlight arrow if it's your vote */
.vote-box .upvote.mine svg {
  fill: #1c7ed6;
  filter: drop-shadow(0 0 2px #1c7ed6cc);
}
.vote-box .downvote.mine svg {
  fill: #f03e3e;
  filter: drop-shadow(0 0 2px #f03e3ecc);
}


.vote-box .upvote.mine svg,
.vote-box .downvote.mine svg {
  animation: voteBounce 0.25s;
}
@keyframes voteBounce {
  0%   { transform: scale(1);}
  50%  { transform: scale(1.18);}
  100% { transform: scale(1);}
}



.comment-vote-box.voted-up {
	background: #1c7ed61c;
}


.comment-vote-box.voted-down {
	background: #f03e3e1a;
}






.post-action-button {
    display: flex;
    gap: 6px;
    padding: 5px 15px;
    border-radius: 99px;
    background: var(--color-btn-secondary);
    color: white;
    border: 0;
    align-items: center;
	cursor: pointer;
}

.post-action-button:hover {
    background: #3b4551;
}

button.post-action-button.delete:hover {
    background: var(--color-danger-dark);
}

button.upvote, button.downvote, button.comment-upvote, button.comment-downvote {
    cursor: pointer;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
	justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50px;
}


button.upvote:hover, button.downvote:hover {
	background: #3b4551;
}

.add-form {
  padding: 0px;
}

.form-actions {
 display: flex; 
 gap: 12px; 
 margin-top: 15px;
 flex-wrap: wrap;
}

textarea#post-title, textarea#edit-post-title, textarea#channel-title, input#channel-title, input#edit-channel-title {
  font-size: 20px;
}

.auto-expand-textarea {
  overflow-y: hidden;
  resize: none;
  min-height: 40px;
  height: auto;
  width: 100%;
  box-sizing: border-box;
}

.add-form input, .add-form textarea, .add-form select {
  font-size: 16px;
  padding: 8px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #4e535e;
  margin-bottom: 14px;
  background: transparent;
  color: var(--color-main-txt-light);
  font-family: inherit;
  box-sizing: border-box;
}


textarea#edit-post-content {
  resize: none;
  font-size: 16px;
  padding: 8px;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
  margin-bottom: 14px;
  background: #1b2028;
  color: var(--color-main-txt-light);
  font-family: inherit;
  box-sizing: border-box;
}


/* MODAL */
.modal {
    background: rgb(0 0 0 / 20%);
	position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.modal .button {
    background: var(--color-btn-secondary);
    color: var(--color-btn-secondary-txt);
}

.modal .button.delete{
    background: #ff2e22;
    color: #ffffff;
}

.modal-title {
	color: var(--color-main-txt);
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 7px;
}

.modal-content {
    background: #1f2126;
    color: #b6d3e8;
    padding: 20px;
    border-radius: 15px;
    width: 100%;
    max-width: 350px;
    z-index: 10000;
    box-sizing: border-box;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}



input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 0px;
  height: 0px;
  border: 2px solid #334052;
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
  margin-right: 5px;
  background: transparent;
}

/* Radio button checked state */
input[type="radio"]:checked {
    background-color: #344050;
    border: 2px solid #586e8c;
}


#edit-channel-type {
    display: flex;
    flex-direction: column;
}


.avatar-btn, .user-avatar-btn {
    position: absolute;
    padding: 5px;
    top: 0px;
    left: 0px;
    background: transparent;
    border: none;
	cursor: pointer;
	z-index: 2;
}

.delete-avatar-btn, .delete-user-avatar-btn {
    position: absolute;
    padding: 5px;
    top: 0px;
    right: 0px;
    background: transparent;
    border: none;
	cursor: pointer;
	z-index: 2;
}


.icons-upload { background: #2e2e2e; border: none; border-radius: 50%; padding: 6px; cursor: pointer; display: flex; fill: #ffffff;

    width: 16px;
    height: 16px;
	}

.icons-delete { background: #ff4444; border: none; border-radius: 50%; padding: 7px; cursor: pointer; display: flex; fill: #ffffff;

    width: 12px;
    height: 12px;
	}


#avatar-preview img{	
  width: 100px;
  height: 100px;
  object-fit: cover;
  max-width: 90px;
  max-height: 90px;
}





@media (hover: none) and (pointer: coarse) {
  .post-card:hover {
    background: transparent !important;
  }
}

@media (max-width: 900px) {
	
	    #toggleSidebar {
      display: inline-block !important;
    }
	
	
	#topbar {
		    padding: 0 15px;
	}
	
	#yt-float-player {
    transition: box-shadow .2s;
    max-width: 240px;
    height: 135px;
}

  #yt-float-player iframe {
        width: 100%;
        height: 100%;
    }
	
	.post-card {
    border-radius: 9px;
    padding: 10px 10px;
	}
	
	#main {
    margin: 0;
}
	
	#main-content {
    padding: 10px 0px;
    margin: 0;
}
	
	
  .grid-container, .grid-container.sidebar-expanded, .grid-container.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  #main-content { padding: 60px 2vw 18vw 2vw;}
  .header-container { padding: 15px 10px;}
}


@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 260px;
    height: calc(100vh - var(--header-height));
    z-index: 9999;
    box-shadow: 2px 0 20px #0002;
    transform: translateX(-100%);
    transition: transform 0.15s cubic-bezier(.4,0,.2,1);
    display: block; /* always block, handle with transform */
    will-change: transform;
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* Optional: darken main area when sidebar open */
  body.sidebar-mobile-active::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.18);
    z-index: 9998;
    pointer-events: auto;
  }
}









  @media (max-width: 900px) {
  
  #topbar-search {
    display: contents;
}

  }
  
  
#channel-search-results {
  /* Set max width or width as needed, e.g.: */
  width: 340px; /* Or 100% for mobile, adjust as needed */
  max-width: 100vw;
}

.channel-result {
  display: flex;
  align-items: center;
  padding: 10px;
  margin: 0px 10px;
  border-bottom: 1px solid #37404b;
  cursor: pointer;
}

.channel-result:last-child {
  border-bottom: none;
}

.channel-result-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.channel-result-content {
  flex: 1;
  min-width: 0; /* CRITICAL for ellipsis to work inside flex container! */
}

.channel-desc-truncate {
  font-size: 13px;
  color: #9ba2b2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%; /* Will be limited by parent flexbox */
}


.channel-search-results {
    position: absolute;
    top: 44px;
    left: 0px;
    width: 100% !important;
    background: rgb(35, 40, 44);
    z-index: 1000;
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
	-webkit-overflow-scrolling: touch;
    scrollbar-color: #4a4f55 #23282c;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.133) 0px 4px 24px;
}




/* NOTIFICATION STYLE */

.notif-dropdown {
    position: absolute;
    right: 0px;
    top: 50px;
    z-index: 999;
    background: rgb(40, 47, 56);
    color: rgb(255, 255, 255);
    width: 260px;
    max-height: 360px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.133) 0px 4px 12px;
}

.notif-content {
	font-size: 16px;
    padding: 10px;
}

span.notif-user {
    color: #2dbfff;
}






#pull-indicator {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  justify-content: center;
  align-items: center;
  background: transparent;
  padding: 10px;
  border-radius: 20px;
  z-index: 9999;
  transition: transform 0.3s ease;
}

.pull-refresh-spinner {
  width: 24px;
  height: 24px;
  position: relative;
}

.pull-refresh-spinner svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transition: transform 0.2s linear;
}

.pull-refresh-spinner circle {
  fill: none;
  stroke: white;
  stroke-width: 4;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.2s;
}

/* Fast spin when loading */
.pull-refresh-spinner.spinning svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

  
  
  
  
  
/* === modal styles === */
.cmodal-overlay {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  position: fixed;
  padding: 0 20px;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgb(0 0 0 / 20%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.cmodal-container {
  background: #1b1d21;
  border-radius: 15px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  position: relative;
}
.cmodal-container h1 {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 30px 0px;
  color: #f0f0f0;
}
.cmodal-close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50px;
  top: 10px;
  right: 10px;
  background: #2c2f35;
  border: none;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
}

.cmodal-close:hover {
  background-color: #33363d;
}


.cmodal-remove-button {
    background: blueviolet;
    cursor: pointer;
    border: 0;
    padding: 7px;
    border-radius: 50px;
    color: white;
}
  
  
  
/* === Profile Layout and Structure === */
.profile-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px 10px;
}

.profile-tabs {
  margin: 0px 10px;
  display: flex;
  gap: 30px;
}

#user-tab-content {
  margin-top: 20px;
}

/* === Avatar === */
.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
}

.placeholder-avatar {
  background-color: #282f38;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
}

/* === User Info === */
.profile-username {
  margin: 0;
  font-size: 24px;
}

.profile-bio {
  color: var(--color-channel-desc);
  font-size: 13px;
}

/* === Tabs === */
.toggle-tab {
  cursor: pointer;
  padding: 8px 0px;
  font-weight: 500;
  color: var(--color-channel-title);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.active-tab {
  border-bottom: 2px solid var(--color-channel-title);
}

/* === Post & Notification Lists === */
.notif-list {
  list-style: none;
  margin: 0;
}

.notif-item {
  font-size: 16px;
  color: var(--color-channel-title);
  padding: 10px 15px;
}

.notif-item:hover {
    background: #282f38;
}

.notif-link {
  text-decoration: none;
  color: inherit;
}

.notif-time {
  color: #a5bdcf;
  font-size: 13px;
  margin-left: 5px;
}

.notif-actor {
  color: var(--color-post-meta);
  font-weight: 700;
  font-size: 13px;
}

/* === Message States === */
.loading-message,
.empty-message,
.error-message,
.not-found-message {
  padding: 2rem;
  font-size: 20px;
  text-align: center;
  color: #626f80;
}










.comment-minimal {
  border: 1px solid #4e535e;
  border-radius: 21px;
  max-width: 900px;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.comment-minimal:focus-within {
  border-color: #596a81;
}

.comment-textarea {
  width: 100%;
  min-height: 36px;
  border: none;
  resize: none;
  background: transparent;
  font-size: 1rem;
  color: #fff;
  outline: none;
  font-family: inherit;
  padding: 8px 12px;
  box-sizing: border-box;
}

.comment-actions-bottom {
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 38px;
  margin-top: 0;
  margin-bottom: 10px;
}

.action-btn {
  border: none;
  background: none;
  padding: 6px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  color: #2563eb;
  font-family: inherit;
  outline: none;
}

.send-btn {
  color: #bfc9d4;
  cursor: pointer;
  background: none;
  transition: background 0.1s;
}
.send-btn.active {
  color: #fff;
  background: #0d6efd;
}

.cancel-btn {
  color: #6b7280;
}
















.image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    user-select: none;
    -webkit-user-select: none; /* Chrome, Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
}

.image-tile {
  position: relative;
  width: 112px;
  height: 112px;
  background: #303846;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #334052;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-tile img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}
.image-tile .remove-btn {
  position: absolute;
  display: flex;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.88);
  fill: white;
  border: none;
  color: #e2445c;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  padding: 7px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.image-tile:hover .remove-btn { opacity: 1; }
.image-tile .move-handle {
  position: absolute;
  left: 4px;
  top: 4px;
  background: rgba(0,0,0,0.88);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1em;
  cursor: grab;
  opacity: 0.8;
}
#image-dropzone-modern {
    border: 2px dashed #334052;
    border-radius: 9px;
    padding: 26px 0 18px 0;
    color: #7a91a6;
    font-size: 1.06em;
    text-align: center;
    background: #1b2028;
    cursor: pointer;
    margin-bottom: 10px;
    transition: border-color .18s, background .18s;
}
#image-dropzone-modern.drag-over {
  border-color: #6c8cff;
  background: #f3f6ff;
  color: #5071d3;
}
#image-upload-count {
  color: #8a9bb5;
  font-size: 0.97em;
  margin-bottom: 7px;
  margin-top: 15px;
}