body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f5f7fb;
  color: #333;
  display: flex;
  flex-direction: column;
}

html, body {
  overflow-x: hidden;
  height: 100%;
}

/* HEADER */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #0A1F44;
  color: white;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
}

.logo-img {
  height: 55px;
}

.nav-links a {
  color: white;
  margin-left: 25px;
  text-decoration: none;
  font-weight: 600;
}

.nav-links a:hover {
  background-color: #ff7a00;
  padding: 15px;
  border-radius: 10px;
}

/* LAYOUT */
.layout {
  display: flex;
  flex: 1;
  width: 100%;
  margin-top: 80px; /* height of header */
}

/* SIDEBAR */
aside {
  width: 300px;
  background: white;
  padding: 20px;
  border-right: 1px solid #ddd;
  overflow-y: auto;
}

/* ACCORDION */
.lesson {
  margin-bottom: 15px;
}

.lesson-title {
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  background: #eef1f7;
  border-radius: 6px;
}

.topic-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.lesson.active .topic-list {
  max-height: 800px;
}

.topic-item {
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 4px;
}

.topic-item:hover {
  background: #f3f4f9;
}

.topic-locked {
  color: #999;
  cursor: not-allowed;
}

/* MAIN */
main {
  flex: 1;
  padding: 20px;
}

.course-header h2 {
  margin: 0;
  font-size: 24px;
}

.course-meta {
  color: #777;
  margin-top: 5px;
  font-size: 14px;
}

.video-container {
  position: relative;
  background-color: white;
}

.video-placeholder {
  background: #f3f4f8;
  border-radius: 10px;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

#videoPlayer {
  width: 100%;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

@media (min-width: 901px){
  #videoSection {
    margin-top: 20px;
  }
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
}

.video-wrapper iframe,
.video-wrapper video {
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

/* LOADER */
.video-loader {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-loader::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 5px solid #0A1F44;
  border-top: 5px solid #ff7a00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.hidden {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* PROGRESS */
.progress-wrapper {
  height: 6px;
  background: #ddd;
  margin-top: 10px;
  border-radius: 5px;
}

#progress {
  height: 100%;
  width: 0%;
  background: #ff7a00;
  transition: width 0.5s ease;
}

/* MOBILE */
@media(max-width: 900px){
  .layout {
    flex-direction: column;
  }

  aside {
    width: 100%;
    order: 2;
    border-right: none;
  }

  main {
    order: 1;
  }

  .topic-list {
    max-height: none;
  }
}

/* FOOTER */
footer {
  background: #0A1F44;
  color: white;
  padding: 20px;
  text-align: center;
  margin-top: 30px;
}

.footer-inner {
  font-size: 14px;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.active {
  display: flex;
}

.modal-box {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 340px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-box input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.login-btn {
  background: #ff7a00;
  color: white;
  border: none;
  padding: 10px;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
}

.close-btn {
  margin-top: 10px;
  background: #ddd;
  border: none;
  padding: 8px;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
}

/* BRANDED PLAYER */
.branded-player {
  position: relative;
}

.player-overlay-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  opacity: 0.85;
}

.player-overlay-logo img {
  height: 40px;
}

/* SPINNER */
.video-loader {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.video-loader::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid #0A1F44;
  border-top: 5px solid #ff7a00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ERROR */
.video-error {
  background: #f8f8f8;
  padding: 40px;
  text-align: center;
  border-radius: 10px;
  color: #555;
}

.hidden {
  display: none !important;
}

.topic-title {
  margin-top: 20px;
  font-size: 20px;
  font-weight: 600;
  color: #0A1F44;
}
.nav-links {
  display: flex;
  align-items: center;
}

#menuToggle {
  display: none; /* hide by default */
}
/* MOBILE NAV FIX */
@media (max-width: 900px){

  .nav-links {
    position: absolute;
    top: 70px;
    right: 20px;
    background: #0A1F44;
    flex-direction: column;
    width: 200px;
    padding: 15px;
    border-radius: 10px;
    display: none; /* HIDE by default */

    #videoSection {
    margin-top: 20px;
    padding: 15px;
  }

  .video-placeholder {
    aspect-ratio: 16 / 9;
  }
  }

  .nav-links.open {
    display: flex; /* SHOW when toggled */
  }

  .nav-links a {
    margin: 10px 0;
  }

#menuToggle {
    display: block;
    background: none;
    border: none;
    font-size: 26px;
    color: white;
    cursor: pointer;
  }
}

#videoSection {
  margin-top: 20px;
  padding: 15px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.topic-title {
  margin-top: 25px;
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 600;
  color: #0A1F44;
}

.progress-wrapper {
  height: 6px;
  background: #ddd;
  margin-top: 15px;
  border-radius: 5px;
}

#captions {
  margin-top: 10px;
  line-height: 1.6;
  color: #555;
}

.course-header {
  margin-bottom: 25px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  display: block;
  border-radius: 2px;
}

@media (max-width: 900px){
  .hamburger {
    display: flex;
  }
}


/* AUTH STYLING */
.auth-body {
  background: linear-gradient(-45deg, #0A1F44, #162f68, #0f2a5f, #091833);
  background-size: 400% 400%;
  animation: gradientBG 12s ease infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.auth-card {
  background: white;
  padding: 40px;
  border-radius: 16px;
  width: 380px;
  text-align: center;
}

.auth-logo {
  height: 60px;
  margin-bottom: 20px;
}

.auth-card input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.auth-card button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

#signupBtn { background: #ff7a00; color: white; }
#loginBtn { background: #0A1F44; color: white; }
#googleBtn { background: #4285F4; color: white; }

/* PROFILE */
.profile {
  display: flex;
  align-items: center;
  margin-left: 20px;
  position: relative;
  cursor: pointer;
}

.profile-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
}

.profile-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  background: white;
  color: black;
  min-width: 160px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  padding: 10px 0;
  z-index: 2000;
}

.profile-dropdown a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
}

.profile-dropdown a:hover {
  background: #f3f4f9;
}

.auth-message {
  margin-top: 10px;
  font-size: 14px;
  color: red;
  min-height: 20px;
}

.auth-message {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
  font-weight: 500;
}

/* AUTH BUTTON */
.auth-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #0A1F44;
  color: white;
  font-weight: 600;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* BUTTON LOADER */
.btn-loader {
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-top: 3px solid #ff7a00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
}

/* MESSAGE FADE */
.auth-message {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
  font-weight: 500;
  transition: opacity 0.4s ease;
}

/* PASSWORD STRENGTH */
.password-strength {
  height: 6px;
  background: #eee;
  border-radius: 5px;
  margin-top: 8px;
  overflow: hidden;
}

#strengthBar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* =========================
   PASSWORD WRAPPER
========================= */
.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 12px; /* space for eye icon */
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  box-sizing: border-box;
}

.password-wrapper input:focus {
  outline: none;
  border-color: #0A1F44;
  box-shadow: 0 0 0 2px rgba(10, 31, 68, 0.1);
}

/* =========================
   EYE TOGGLE ICON
========================= */
#togglePassword {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: #777;
  transition: color 0.3s ease;
}

#togglePassword:hover {
  color: #0A1F44;
}

/* =========================
   REMEMBER ME FIXED
========================= */
.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;              /* controls spacing between checkbox and text */
  margin-top: 12px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
}

.remember-me input {
  margin: 0;             /* remove default browser spacing */
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* =========================
   PASSWORD STRENGTH BAR
========================= */
.password-strength {
  height: 6px;
  background: #eee;
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
}

#strengthBar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 5px;
}

/* =========================
   STRENGTH TEXT
========================= */
#strengthText {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
  min-height: 16px;
}

/* =========================
   AUTH MESSAGE
========================= */
.auth-message {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

/* =========================
   AUTH INPUT STANDARDIZATION
========================= */
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  box-sizing: border-box;
}

.auth-card input:focus {
  outline: none;
  border-color: #0A1F44;
  box-shadow: 0 0 0 2px rgba(10, 31, 68, 0.1);
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 240px;
  background: #0A1F44;
  color: white;
  padding: 20px;
}

.dashboard-main {
  flex: 1;
  padding: 40px;
  background: #f5f7fb;
}

#courseGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 20px;
}

.course-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.course-card:hover {
  transform: translateY(-5px);
}

.course-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.course-card .info {
  padding: 15px;
}