/* General */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #181818;
  color: #f1f1f1;
}

body[data-theme="light"] {
  background: #f9f9f9;
  color: #181818;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #202020;
  border-bottom: 1px solid #333;
  position: sticky;
  top: 0;
  z-index: 100;
}

body[data-theme="light"] .navbar {
  background: white;
  border-bottom: 1px solid #ddd;
}

.navbar input {
  width: 40%;
  padding: 8px 12px;
  border: 1px solid #444;
  background: #121212;
  color: white;
  border-radius: 20px;
}

body[data-theme="light"] .navbar input {
  border: 1px solid #ccc;
  background: #f1f1f1;
  color: black;
}

.logo a {
  font-weight: bold;
  font-size: 20px;
  color: red;
}

.profile {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 50px; height: 24px; margin: 0 15px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #444; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(26px); }

/* Main layout container (Homepage) */
.container { display: flex; }

/* 🔹 Sidebar (Homepage) - UPDATED 🔹 */
.sidebar { 
  width: 240px; /* Increased width for icons */
  background: #202020; 
  height: calc(100vh - 50px); 
  padding-top: 10px; 
  position: sticky; 
  top: 50px; 
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { 
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px; 
  cursor: pointer; 
  font-size: 14px; 
  border-radius: 8px;
  margin: 0 10px 5px 10px;
}
.sidebar li:hover { background: #383838; }
.sidebar li.active {
  background: #4d4d4d;
  font-weight: bold;
}
.sidebar li.active:hover {
  background: #5a5a5a;
}
.sidebar li span {
  font-size: 24px; /* Icon size */
  width: 24px;
  text-align: center;
}
.sidebar hr {
  border: none;
  border-top: 1px solid #444;
  margin: 15px 0;
}
.sidebar li.heading {
  font-size: 16px;
  font-weight: bold;
}
.sidebar li.heading:hover {
  background: none; /* Keep heading from highlighting */
}

body[data-theme="light"] .sidebar { background: #f1f1f1; }
body[data-theme="light"] .sidebar li:hover { background: #ddd; }
body[data-theme="light"] .sidebar li.active { background: #ccc; }
body[data-theme="light"] .sidebar li.active:hover { background: #c0c0c0; }
body[data-theme="light"] .sidebar hr { border-top: 1px solid #ddd; }

/* Main content (Homepage) */
.main-content { flex: 1; padding: 20px; }

/* Video Grid (Homepage) */
.video-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 20px; 
  padding: 20px 0; 
}
.video-card img { width: 100%; border-radius: 8px; }
.video-card h3 { margin: 5px 0; font-size: 16px; color: #fff; font-weight: bold; }
.video-card p { margin: 5px 0; font-size: 14px; color: #aaa; }
body[data-theme="light"] .video-card h3 { color: #181818; }
body[data-theme="light"] .video-card p { color: #606060; }

/* 🔹 Video Page Specific Layout 🔹 */
.video-page-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  gap: 24px;
}
.main-video-content {
  flex: 1;
  max-width: 1280px;
}
.video-container video {
  border-radius: 12px;
  background: black;
}

/* 🔹 Recommended Videos Sidebar 🔹 */
.recommendations-sidebar {
  width: 400px;
}
.rec-video-card {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.rec-video-card img {
  width: 168px;
  height: 94px;
  border-radius: 8px;
  object-fit: cover;
}
.rec-video-details h4 {
  margin: 0 0 5px 0;
  font-size: 14px;
  line-height: 1.3;
}
.rec-video-details p {
  margin: 0;
  font-size: 12px;
  color: #aaa;
}
body[data-theme="light"] .rec-video-details p {
  color: #606060;
}

/* Video Details (Video Page) */
.video-details { margin-top: 10px; }
.video-main-title { font-size: 20px; }
.video-actions { display: flex; justify-content: space-between; align-items: center; }
button { margin: 5px; padding: 8px 16px; cursor: pointer; border: none; background: #333; color: white; border-radius: 18px; font-size: 14px; }
button:hover { background: #555; }
body[data-theme="light"] button { background: #e0e0e0; color: black; }
body[data-theme="light"] button:hover { background: #ccc; }

/* 🔹 Channel Info 🔹 */
.channel-info {
  display: flex;
  align-items: center;
  margin-top: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #444;
}
body[data-theme="light"] .channel-info { border-bottom: 1px solid #ddd; }
.channel-name { flex: 1; }
.channel-name h3 { margin: 0; font-size: 16px; }
.channel-name span { font-size: 12px; color: #aaa; }
body[data-theme="light"] .channel-name span { color: #606060; }
.subscribe-btn {
  background: #f1f1f1;
  color: #0f0f0f;
  font-weight: bold;
}
body[data-theme="light"] .subscribe-btn { background: #0f0f0f; color: #f1f1f1; }

/* 🔹 Comments Section 🔹 */
.comments-section { margin-top: 20px; }
.add-comment { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
#comment-box {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid #717171;
  color: #f1f1f1;
  font-size: 14px;
  padding: 8px 0;
}
#comment-box:focus { outline: none; border-bottom: 2px solid #f1f1f1; }
body[data-theme="light"] #comment-box { color: #0f0f0f; border-bottom: 1px solid #ccc; }
body[data-theme="light"] #comment-box:focus { border-bottom: 2px solid #0f0f0f; }

#comments { list-style: none; padding: 0; margin-top: 30px; }
#comments li {
    padding: 8px;
    border-bottom: 1px solid #444;
}
body[data-theme="light"] #comments li { border-bottom: 1px solid #ddd; }
.comment-content { flex: 1; }
.comment-author { font-size: 13px; font-weight: bold; margin: 0 0 4px 0; }
.comment-author span { font-weight: normal; color: #aaa; margin-left: 8px; }
body[data-theme="light"] .comment-author span { color: #606060; }
.comment-text { font-size: 14px; margin: 0; }
.comment-actions { display: flex; align-items: center; gap: 15px; margin-top: 8px; font-size: 12px; color: #aaa; }