/* frontend/course-player.css */
:root {
  --wh: #ffffff;
  --gd: #dfcc8c;
  --bu: rgb(51, 142, 205);
}

/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(
    58deg,
    var(--wh) 0%,
    var(--gd) 5%,
    var(--bu) 100%
  );
  background-attachment: fixed;
  color: #333;
  overflow-x: hidden;
  transition: all 0.3s ease;
  cursor: url("pointer (4).png") 16 16, auto;
}

/* Night Mode */
body.dark-mode {
  background: #121212;
  color: #ddd;
}
body.dark-mode .video-player {
  background: #1e1e1e;
}
body.dark-mode .sidebar {
  background: rgba(50, 50, 50, 0.3);
  color: #ddd;
}
body.dark-mode .lecture-item {
  background: rgba(80, 80, 80, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
body.dark-mode .video-overlay {
  background: rgba(0, 0, 0, 0.85);
}

/* Background overlay */
.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(223, 204, 140, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(51, 142, 205, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: -1;
}

/* Home button left */
.home-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bu);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 1000;
}
.home-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Night mode toggle right */
#toggle-theme {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

/* Course layout */
.course-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 4rem auto 2rem;
  padding: 2rem;
  position: relative;
  z-index: 1;
}
.video-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Progress Circle */
.progress-circle-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}
.progress-circle-container svg {
  transform: rotate(-90deg);
}
#progress-text-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 1rem;
  color: var(--bu);
}

/* Video Player */
.video-player {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.1),
    0 8px 30px rgba(0, 0, 0, 0.2);
  background: var(--wh);
  transition: all 0.4s ease;
  position: relative;
}

.video-player iframe.locked,
.video-player .yt-player-container.locked {
  filter: blur(10px) grayscale(100%);
  pointer-events: none;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 2rem;
  z-index: 10;
  border-radius: 20px;
  animation: fadeIn 0.5s ease;
}

.video-overlay i {
  font-size: 3rem;
  color: var(--gd);
  margin-bottom: 1rem;
}

.video-overlay h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: white;
}

.video-overlay p {
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.video-player:hover {
  box-shadow: inset 0 6px 15px rgba(0, 0, 0, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.3);
}
.video-player iframe,
.video-player .yt-player-container {
  width: 100%;
  height: 450px;
  border: none;
}

.overlay-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.overlay-btn {
  background: var(--bu);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.overlay-btn:hover {
  background: #2e8bc0;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.overlay-btn.login {
  background: var(--gd);
  color: #333;
}

.overlay-btn.login:hover {
  background: #d4b864;
}

.overlay-btn.register {
  background: #ff4757;
}

.overlay-btn.register:hover {
  background: #ff3742;
}

/* Navigation buttons */
.navigation {
  display: flex;
  justify-content: center;
  gap: 2rem;
}
.neumorphic-btn {
  background: linear-gradient(145deg, var(--wh), #e6e6e6);
  box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.1),
    -8px -8px 16px rgba(255, 255, 255, 0.9);
  border: none;
  padding: 1rem 2rem;
  border-radius: 15px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #333;
}
.neumorphic-btn:hover {
  box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.15),
    -12px -12px 24px rgba(255, 255, 255, 1);
  transform: translateY(-3px);
}
.neumorphic-btn:active {
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.1),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
  transform: translateY(0);
}
.neumorphic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Sidebar */
.sidebar {
  padding: 2rem;
  border-radius: 20px;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bu) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--bu);
  border-radius: 10px;
}
.glassmorphic {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.sidebar h2 {
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Lecture items */
#lecture-list {
  list-style: none;
}
.lecture-item {
  display: flex;
  align-items: center;
  padding: 1.2rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}
.lecture-item:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.lecture-item.active {
  background: var(--bu);
  color: var(--wh);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.2);
}
.lecture-icon {
  margin-right: 1rem;
  font-size: 1.2rem;
}
.lecture-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.lecture-title {
  font-weight: 600;
  font-size: 1rem;
}
.lecture-duration {
  font-size: 0.9rem;
  opacity: 0.8;
}
.lecture-check {
  margin-left: 1rem;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lecture-item[data-completed="true"] .lecture-check {
  opacity: 1;
  color: var(--gd);
}
.lecture-item[data-completed="true"] .lecture-icon {
  display: none;
}

.lecture-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.lecture-item.locked:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.lecture-item.locked::after {
  content: "🔒";
  position: absolute;
  right: 15px;
  font-size: 1rem;
  opacity: 0.7;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 2000;
  animation: fadeIn 0.5s ease;
}
.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--wh);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  width: 90%;
}
.modal-content h3 {
  margin-bottom: 1rem;
  color: var(--bu);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-btn.login-btn {
  background: var(--gd);
  color: #333;
}

.modal-btn.cancel-btn {
  background: #666;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.modal-btn {
  background: var(--bu);
  color: var(--wh);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.modal-btn:hover {
  background: #2e8bc0;
  transform: scale(1.05);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .course-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
    margin-top: 6rem;
  }
  .video-player iframe,
  .video-player .yt-player-container {
    height: 300px;
  }
  .sidebar {
    order: -1;
    max-height: 50vh;
  }
  .navigation {
    gap: 1rem;
  }
  .neumorphic-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  .home-btn {
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
  }
  #toggle-theme {
    top: 10px;
    right: 10px;
  }
}
