:root {
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --dark: #1e1b4b;
  --light: #f5f3ff;
  --gray: #6b7280;
  --card-bg: #ffffff;
  --body-bg: #f9fafb;
  --sidebar-width: 280px;

  /* Dark mode variables */
  --dark-primary: #a78bfa;
  --dark-primary-light: #c4b5fd;
  --dark-dark: #111827;
  --dark-light: #1f2937;
  --dark-gray: #9ca3af;
  --dark-card-bg: #1f2937;
  --dark-body-bg: #111827;
}

/* Dark mode styles */
body.dark-mode {
  --primary: var(--dark-primary);
  --primary-light: var(--dark-primary-light);
  --dark: var(--dark-dark);
  --light: var(--dark-light);
  --gray: var(--dark-gray);
  --card-bg: var(--dark-card-bg);
  --body-bg: var(--dark-body-bg);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--body-bg);
  color: var(--dark);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--card-bg);
  color: var(--dark);
  position: fixed;
  height: 100vh;
  padding: 20px 0;
  transition: all 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

body.dark-mode .sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  padding: 0 20px 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
  display: flex;
  align-items: center;
}

body.dark-mode .sidebar-header .logo {
  color: white;
}

.sidebar-header .logo i {
  margin-right: 10px;
  color: var(--primary);
}

.sidebar-menu {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
}

.sidebar-menu li {
  margin-bottom: 5px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--gray);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

body.dark-mode .sidebar-menu a {
  color: var(--dark-gray);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

body.dark-mode .sidebar-menu a:hover,
body.dark-mode .sidebar-menu a.active {
  background-color: rgba(167, 139, 250, 0.1);
}

.sidebar-menu a i {
  margin-right: 10px;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 30px;
  transition: all 0.3s ease;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  background: var(--body-bg); /* or white */
  padding: 10px 0px;
}

.header-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
}

body.dark-mode .header-title {
  color: white;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.section-title {
  color: var(--dark);
}

.dark-mode .section-title {
  color: white;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border-radius: 8px;
  border: none;
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--dark);
  transition: all 0.3s ease;
}

body.dark-mode .search-box input {
  background-color: var(--dark-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-box input::placeholder {
  color: var(--gray);
}

body.dark-mode .search-box input::placeholder {
  color: var(--dark-gray);
}

.search-box button {
  position: absolute;
  right: 5px;
  top: 5px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 7px 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-box button:hover {
  background: var(--primary-light);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: var(--card-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray);
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body.dark-mode .theme-toggle {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  color: var(--primary);
}

/* Categories */
.categories {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.category {
  background-color: var(--card-bg);
  padding: 8px 15px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  color: var(--dark);
}

body.dark-mode .category {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  color: white;
}

.category:hover,
.category.active {
  background-color: var(--primary);
  color: white;
}
.sticky-header-container {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--background); /* or white */
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.sticky-player-container {
  position: sticky;
  top: 60px; /* This should be: header height + category height */
  z-index: 89;
  background: var(--dark-bg);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

@media (max-width: 768px) {
  .sticky-player-container {
    position: static;
    top: auto;
    box-shadow: none;
  }
}

.categories {
  padding: 10px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05); /* optional */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* optional */
  background-color: inherit;
}

body.dark-mode .sticky-header-container {
  background-color: var(--dark-bg);
}

.featured-section {
  margin-bottom: 20px;
}

/* Featured Video */
/* featured-card layout side-by-side */
.featured-card {
  display: flex;
  gap: 20px;
  align-items: center;
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.featured-thumbnail-container {
  flex-shrink: 0;
  width: 240px;
  height: 135px;
  overflow: hidden;
  border-radius: 8px;
}

.featured-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.featured-section.fade-out {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.featured-video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.featured-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.featured-video-info {
  padding: 20px;
}

.featured-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark);
}

body.dark-mode .featured-title {
  color: white;
}

.featured-meta {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 15px;
}

.featured-actions {
  display: flex;
  gap: 10px;
}

.featured-btn {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.featured-btn i {
  margin-right: 6px;
}

.featured-play {
  background-color: var(--primary);
  color: white;
}

.featured-play:hover {
  background-color: var(--primary-light);
}

.featured-download {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

body.dark-mode .featured-download {
  background-color: rgba(167, 139, 250, 0.1);
}

.featured-download:hover {
  background-color: rgba(139, 92, 246, 0.2);
}

body.dark-mode .featured-download:hover {
  background-color: rgba(167, 139, 250, 0.2);
}

/* Videos Grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.video-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

body.dark-mode .video-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

body.dark-mode .video-card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
  position: relative;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

.video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
}

.video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.play-overlay-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

.video-card:hover .play-overlay-btn {
  transform: translateY(0);
}

.video-content {
  padding: 15px;
}

.video-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--dark);
}

body.dark-mode .video-title {
  color: white;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray);
}

.video-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.dark-mode .action-btn {
  background-color: rgba(167, 139, 250, 0.1);
}

.action-btn:hover {
  background-color: rgba(139, 92, 246, 0.2);
}

body.dark-mode .action-btn:hover {
  background-color: rgba(167, 139, 250, 0.2);
}

.action-btn.more-btn {
  background: none;
  color: var(--gray);
}

body.dark-mode .action-btn.more-btn {
  color: var(--dark-gray);
}

.action-btn.more-btn:hover {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

body.dark-mode .action-btn.more-btn:hover {
  background-color: rgba(167, 139, 250, 0.1);
}

.action-btn.like-btn {
  background: none;
  color: var(--gray);
}

body.dark-mode .action-btn.like-btn {
  color: var(--dark-gray);
}

.action-btn.like-btn:hover,
.action-btn.like-btn.liked {
  color: var(--primary);
  background: none;
}

/* Video Player Layout */
.video-player-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

@media (min-width: 992px) {
  .video-player-container {
    flex-direction: row;
  }
}

.video-player-column {
  flex: 1;
  min-width: 0;
}

@media (min-width: 992px) {
  .video-player-column {
    flex: 2;
  }
}

.related-videos-column {
  flex: 1;
  min-width: 0;
}

/* .player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; 
  background-color: #000;
  border-radius: 10px;
  overflow: hidden;
} */

.player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background-color: #000;
  border-radius: 10px;
  overflow: hidden;
}

@media (orientation: landscape) and (max-width: 768px) {
  .player-wrapper {
    height: 100vh;
    padding-top: 0;
  }
}

#mainVideoPlayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#mainVideoPlayer iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-info {
  margin-top: 20px;
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-mode .video-info {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#videoTitle {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--dark);
}

body.dark-mode #videoTitle {
  color: white;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

#channelTitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
}

body.dark-mode #channelTitle {
  color: white;
}

#videoStats {
  font-size: 0.8rem;
  color: var(--gray);
}

.video-actions {
  display: flex;
  gap: 10px;
}

.video-description {
  margin-top: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--dark);
}

body.dark-mode .video-description {
  color: white;
}

.description-content {
  max-height: 100px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.description-content.expanded {
  max-height: none;
}

.show-more-btn {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 10px;
  cursor: pointer;
  display: inline-block;
}

.show-more-btn:hover {
  color: var(--primary);
}

/* Comments Section */
.comments-section {
  margin-top: 30px;
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-mode .comments-section {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.comments-section h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: var(--dark);
}

body.dark-mode .comments-section h3 {
  color: white;
}

.comment-form {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.user-thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-input-container {
  flex: 1;
}

.comment-input-container input {
  width: 100%;
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: var(--body-bg);
  color: var(--dark);
  font-size: 0.9rem;
}

body.dark-mode .comment-input-container input {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: var(--dark-light);
  color: white;
}

.comment-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.cancel-comment,
.submit-comment {
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
}

.cancel-comment {
  background: none;
  color: var(--gray);
}

.submit-comment {
  background-color: var(--primary);
  color: white;
}

.submit-comment:hover {
  background-color: var(--primary-light);
}

.comments-list {
  margin-top: 20px;
}

.comment {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
  margin-bottom: 5px;
}

body.dark-mode .comment-author {
  color: white;
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--dark);
}

body.dark-mode .comment-text {
  color: white;
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.comment-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.comment-action {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 0.8rem;
  cursor: pointer;
}

.comment-action:hover {
  color: var(--primary);
}

/* Related Videos */
.related-videos-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.related-video {
  display: flex;
  gap: 10px;
  cursor: pointer;
}

.related-video-thumbnail {
  position: relative;
  flex: 0 0 120px;
  height: 68px;
  border-radius: 5px;
  overflow: hidden;
}

.related-video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-video-duration {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.7rem;
}

.related-video-info {
  flex: 1;
  min-width: 0;
}

.related-video-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--dark);
}

body.dark-mode .related-video-title {
  color: white;
}

.related-video-channel {
  font-size: 0.8rem;
  color: var(--gray);
}

.related-video-meta {
  font-size: 0.7rem;
  color: var(--gray);
}

/* Playlists */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.playlist-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

body.dark-mode .playlist-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.playlist-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

body.dark-mode .playlist-card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.playlist-thumbnail {
  position: relative;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.playlist-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-count {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
}

.playlist-content {
  padding: 15px;
}

.playlist-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--dark);
}

body.dark-mode .playlist-title {
  color: white;
}

.playlist-meta {
  font-size: 0.75rem;
  color: var(--gray);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: var(--card-bg);
  color: var(--dark);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body.dark-mode .pagination-btn {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  color: white;
}

.pagination-btn:hover {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

body.dark-mode .pagination-btn:hover {
  background-color: rgba(167, 139, 250, 0.1);
}

.pagination-btn.active {
  background-color: var(--primary);
  color: white;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--gray);
  margin: 0 15px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* Back to top button */
.back-to-top {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-to-top:hover {
  background-color: var(--primary-light);
  transform: translateY(-3px);
}

.back-to-top.visible {
  display: flex;
}

/* Loading Spinner */
.loading-spinner {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(139, 92, 246, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease;
}

body.dark-mode .modal-content {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark);
}

body.dark-mode .modal-title {
  color: white;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
}

body.dark-mode .close-modal {
  color: var(--dark-gray);
}

.share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--dark);
}

body.dark-mode .share-option {
  color: white;
}

.share-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.share-icon.facebook {
  background-color: #1877f2;
  color: white;
}

.share-icon.twitter {
  background-color: #1da1f2;
  color: white;
}

.share-icon.whatsapp {
  background-color: #25d366;
  color: white;
}

.share-icon.linkedin {
  background-color: #0077b5;
  color: white;
}

.share-icon.link {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

body.dark-mode .share-icon.link {
  background-color: rgba(167, 139, 250, 0.1);
}

.share-label {
  font-size: 0.8rem;
  text-align: center;
}

.copy-link {
  display: flex;
  margin-top: 15px;
}

.copy-link input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px 0 0 8px;
  font-size: 0.9rem;
  background-color: var(--card-bg);
  color: var(--dark);
}

body.dark-mode .copy-link input {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-link button {
  padding: 0 15px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-link button:hover {
  background-color: var(--primary-light);
}

/* Sign In Modal */
.sign-in-content {
  text-align: center;
  padding: 20px 0;
}

.sign-in-content p {
  margin-bottom: 20px;
  color: var(--dark);
}

body.dark-mode .sign-in-content p {
  color: white;
}

.sign-in-btn {
  background-color: #4285f4;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.sign-in-btn:hover {
  background-color: #3367d6;
}

.sign-in-btn i {
  font-size: 1.2rem;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

@media (max-width: 992px) {
  .main-content {
    padding: 15px;
  }

  .videos-grid,
  .playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .header-actions {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .featured-card {
    flex-direction: column;
  }

  .featured-actions {
    flex-direction: column;
  }

  .featured-btn {
    width: 100%;
  }

  .pagination {
    gap: 5px;
  }

  .pagination-btn {
    width: 35px;
    height: 35px;
  }

  .pagination-info {
    margin: 0 10px;
  }
}

@media (max-width: 576px) {
  .videos-grid,
  .playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .pagination-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .pagination-info {
    font-size: 0.8rem;
    margin: 0 5px;
  }

  .video-player-column,
  .related-videos-column {
    flex: 1 1 100%;
  }

  .video-player-container {
    flex-direction: column;
  }

  .video-actions {
    flex-wrap: wrap;
  }

  .video-actions .action-btn {
    margin-bottom: 5px;
  }
}

.video-unavailable-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(255, 0, 0, 0.8);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Truncate Long Titles with Ellipsis */
/* .related-video-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
} */

/* live-badge */
.live-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: red;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Overlay Element in HTML */
.overlay-blocker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background-color: transparent;
  display: none;
  pointer-events: all;
}

/* Upnext */
/* .up-next-overlay {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    z-index: 20;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
  }
  
  .up-next-box {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .up-next-actions {
    margin-top: 8px;
    display: flex;
    gap: 12px;
  }
  
  .up-next-actions button {
    background: #ffffff;
    color: #222;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
  }
  
  .up-next-actions button:hover {
    background: #ddd;
  }
  
  .hidden {
    display: none;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  
  .up-next-overlay {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    z-index: 20;
    text-align: center;
    width: 300px;
    animation: fadeInUp 0.3s ease-out;
  }
  
  .up-next-box {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .up-next-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
  }
  
  .up-next-text {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
  }
  
  .up-next-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
  }
  
  .up-next-actions button {
    background: #ffffff;
    color: #222;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
  }
  
  .up-next-actions button:hover {
    background: #ddd;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translate(-50%, 10px);
    }
    to {
      opacity: 1;
      transform: translate(-50%, 0);
    }
  }
   */
.up-next-overlay {
  width: 90%;
  max-width: 400px;
  bottom: 20px;
}

@media (max-width: 576px) {
  .up-next-overlay {
    width: 95%;
    padding: 12px;
  }
  .up-next-thumbnail {
    max-width: 200px;
  }
}

.theater-mode .player-wrapper {
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 992px) {
  .theater-mode .player-wrapper {
    max-width: 100%;
  }
}


.settings-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.settings-menu button {
  display: block;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: var(--dark);
  text-align: left;
}

.settings-menu button:hover {
  background: var(--primary-light);
}


.speed-menu {
  position: absolute;
  top: 50px;
  right: 10px;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.speed-menu button {
  display: block;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: var(--dark);
  text-align: left;
}

.speed-menu button:hover {
  background: var(--primary-light);
}

@media (max-width: 576px) {
  .video-player-container {
    flex-direction: column;
  }
  .related-videos-column {
    margin-top: 20px;
  }
}