body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

:root {
  --primary: #2c5cc3;
  --primary-dark: #1a3f8c;
  --light: #ffffff;
  --dark: #1e1e2d;
  --gray: #6c757d;
  --light-gray: #f5f7fb;
  --card-bg: #ffffff;
  --accent: #ff6b6b;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body {
  background-color: var(--light-gray);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background-color: var(--light);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.user-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.upload-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.user-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.user-icon:hover {
  transform: scale(1.05);
}

/* Page container */
.page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Home Page */
.page {
  display: none;
  flex-direction: column;
}

.page.active {
  display: flex;
}

/* Channel Header */
.channel-header {
  max-width: 1200px;
  margin: 40px auto;
  padding: 40px;
  background: var(--light);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 40px;
  align-items: center;
}

.channel-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.channel-info {
  flex: 1;
}

.channel-name {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark);
}

.channel-stats {
  display: flex;
  gap: 25px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 16px;
}

.stat-item i {
  color: var(--primary);
}

.channel-description {
  max-width: 700px;
  line-height: 1.7;
  margin-bottom: 25px;
  color: #555;
}

.channel-actions {
  display: flex;
  gap: 15px;
}

.subscribe-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 35px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.subscribe-btn:hover {
  background: var(--primary-dark);
}

.action-btn {
  background: var(--light-gray);
  color: var(--primary);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.action-btn:hover {
  background: #e0e5f1;
}

/* Videos Section */
.videos-section {
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title i {
  color: var(--primary);
}

.view-all {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.view-all:hover {
  gap: 12px;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.video-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: var(--shadow);
  position: relative;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.thumbnail {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-card:hover .thumbnail img {
  transform: scale(1.05);
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .play-icon {
  opacity: 1;
}

.duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.video-info {
  padding: 20px;
}

.video-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 54px;
}

.video-stats {
  display: flex;
  justify-content: space-between;
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 15px;
}

.video-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.action-btn-small {
  background: transparent;
  color: var(--gray);
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.3s;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 14px;
}

.action-btn-small:hover {
  color: var(--primary);
  background: #f0f4ff;
}

/* Upload Section */
.upload-section {
  background: var(--light);
  padding: 60px 40px;
  margin: 60px auto;
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 1200px;
}

.upload-title {
  font-size: 36px;
  margin-bottom: 20px;
  color: var(--dark);
  font-weight: 700;
}

.upload-subtitle {
  font-size: 18px;
  color: var(--gray);
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.upload-btn-large {
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px 45px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.upload-btn-large:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  width: 80%;
  max-width: 1000px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.lightbox-video {
  width: 100%;
  height: 500px;
  background: #000;
}

.video-info-modal {
  padding: 20px;
}

.video-title-modal {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark);
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Footer */
footer {
  background: var(--dark);
  padding: 60px 40px 30px;
  text-align: center;
  color: #aaa;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-logo {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
}

.footer-tagline {
  font-size: 16px;
  color: #aaa;
  max-width: 600px;
  margin: 0 auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.social-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: white;
}

.copyright {
  margin-top: 30px;
  font-size: 14px;
  color: #777;
}

/* Page-specific styles */
.page-content {
  flex: 1;
  padding: 20px;
}

.page-title {
  font-size: 36px;
  text-align: center;
  margin: 30px 0;
  color: var(--dark);
}

.playlist-grid,
.community-grid,
.about-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.playlist-card {
  background: var(--light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.playlist-header {
  background: var(--primary);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.playlist-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.community-card {
  background: var(--light);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.post-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.about-content {
  background: var(--light);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.about-section {
  margin-bottom: 40px;
}

/* Responsive */
@media (max-width: 992px) {
  .channel-header {
    flex-direction: column;
    text-align: center;
    padding: 40px 30px;
  }

  .channel-actions {
    justify-content: center;
  }

  .channel-description {
    margin: 0 auto 25px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 15px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
  }

  .section-title {
    font-size: 24px;
  }

  .upload-title {
    font-size: 28px;
  }

  .lightbox-video {
    height: 300px;
  }

  .page-title {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .channel-name {
    font-size: 28px;
  }

  .channel-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }

  .playlist-videos {
    grid-template-columns: 1fr;
  }
}
