/* --- Google Font Import --- */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* --- CSS Variables & Theming --- */
:root {
  /* Light Theme Colors */
  --primary-color: #5e35b1; /* Deep Purple */
  --secondary-color: #ede7f6; /* Light Purple */
  --background-color: #f5f5f7;
  --surface-color: #ffffff;
  --text-color: #212121;
  --text-muted-color: #616161;
  --accent-color-premium: #e2720a; 
  --accent-color-live: crimson; 
  --accent-color-free: green;
  --border-color: #e0e0e0;
  --shadow-color: rgba(94, 53, 177, 0.2);
  --header-bg: rgba(245, 245, 247, 0.7);
  --orange-gradient: linear-gradient(135deg, #ff7b00 0%, #f97316 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Theme Colors */
    --primary-color: #8b5cf6;
    --secondary-color: #311b92;
    --background-color: #0a0a10;
    --surface-color: #111116;
    --text-color: #e0e0e0;
    --text-muted-color: #a0a0a0;
    --border-color: #2d2d33;
    --shadow-color: rgba(139, 92, 246, 0.25);
    --header-bg: rgba(17, 17, 25, 0.7);
  }
}

/* --- General & Reset Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: var(--background-color);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4a2a8c; /* A slightly darker purple for hover */
}

/* --- Header & Navigation --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  padding: 5px;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
}

nav .logo img {
  margin-top: 5px;
  height: 50px;
  width: 50px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul li a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  position: relative;
  padding-bottom: 0.5rem;
  transition: color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--primary-color);
}

nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

#menu-toggle {
  display: none;
}

/* Base hamburger styling */
.hamburger {
  display: none;
  font-size: 25px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.4s ease, color 0.3s ease;
}

/* Menu links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

/* Responsive behavior */
@media (max-width: 710px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background-color: var(--background-color);
    position: absolute;
    top: 66px;
    left: 30vw;
    width: 200px;
    padding: 15px 0;
    text-align: center;
    gap: 10px;
  }

  /* When menu is checked (open) */
  #menu-toggle:checked + .hamburger + .nav-links {
    display: flex;
    animation: slideDown 0.3s ease;
  }

  /* Animate hamburger icon to rotate and change to X */
  #menu-toggle:checked + .hamburger {
    transform: rotate(180deg);
    color: #ff4d4d;
  }

  #menu-toggle:checked + .hamburger::before {
    content: "✖";
  }

  #menu-toggle:checked + .hamburger {
    color: transparent;
  }

  #menu-toggle:checked + .hamburger::before {
    position: absolute;
    color: #ff4d4d;
    transform: rotate(180deg);
  }

  /* Simple dropdown animation */
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* --- Buttons --- */
.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background-color: #4a2a8c;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  padding: 0.8rem 2rem;
  border-radius: 50px;
  border: 2px solid var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-3px);
}

.btn-back {
    position: absolute;
    top: 15px;
    left: 25px;
    padding: 10px;
    text-decoration: none;
    color: var(--text-muted-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 10;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
}

.btn-back:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

/* --- Hero Section --- */
#hero {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 5%;
  position: relative;
  overflow: hidden;
}

.hero-content {
  z-index: 2;
  animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-muted-color);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.animated-gradient-text {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color-premium), var(--primary-color));
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-flow 5s linear infinite;
}

/* Moving Background Shapes */
.background-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.background-shapes::before,
.background-shapes::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0.2;
}

.background-shapes::before {
  width: 400px;
  height: 400px;
  top: 10%;
  left: 15%;
  animation: moveShape 10s infinite alternate ease-in-out;
}

.background-shapes::after {
  width: 300px;
  height: 300px;
  bottom: 15%;
  right: 10%;
  animation: moveShape 15s infinite alternate-reverse ease-in-out;
}

/* --- General Section Styling --- */
section {
  padding: 6rem 5%;
}

section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

section h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* --- Course Cards --- */
.courses-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.course-card {
  background-color: transparent;
  width: 300px;
  height: 420px;
  perspective: 1000px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s, box-shadow 0.4s ease;
  transform-style: preserve-3d;
}

.course-card:hover .card-inner {
  transform: rotateY(180deg);
}
.course-card:hover {
  filter: drop-shadow(0 0 20px var(--shadow-color));
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background-color: var(--surface-color);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-front {
  align-items: center;
  padding: 1.5rem;
  text-align: center;
}
.card-front img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.card-front h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}
.card-front p {
  color: var(--text-muted-color);
  font-size: 0.9rem;
  line-height: 1.4;
  flex-grow: 1;
  text-align: center;
}

.card-back {
  transform: rotateY(180deg);
  padding: 2rem;
  justify-content: center;
}
.card-back h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}
.card-back ul {
  list-style: none;
  margin-bottom: 2rem;
}
.card-back ul li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-color);
}
.card-back ul li::before {
  content: "✓";
  color: var(--accent-color-free);
  margin-right: 0.5rem;
}

.price-tag {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}
.price-tag.premium {
  background-color: var(--accent-color-premium);
}
.price-tag.live {
  background-color: var(--accent-color-live);
}
.price-tag.free {
  background-color: var(--accent-color-free);
}

.btn-card {
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem;
  width: 100%;
  text-align: center;
  border-radius: 8px;
  transition: background-color 0.3s;
}
.btn-card:hover {
  background-color: #4a2a8c;
}

.explore-btn-container {
  text-align: center;
  margin-top: 3rem;
}

/* --- Instructors Section --- */
#instructors {
  background-color: var(--surface-color);
}
.instructor-carousel {
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}
.instructor-slider {
  display: flex;
  width: 200%; /* 2 slides */
  animation: slideInstructors 8s infinite ease-in-out;
}
.instructor-slide {
  width: 50%;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  transition: transform 0.3s ease;
}

.instructor-image img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-color);
  transition: box-shadow 0.3s ease;
  box-shadow: 0 0 10px var(--primary-color);
}
.instructor-info h2 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 0.2rem;
  text-align: left;
  transform: none;
  left: 0;
}
.instructor-info h2::after {
  display: none;
}
.instructor-info h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #f7f6f8;
  margin-bottom: 0.6rem;
  max-width: fit-content;
  background-color: #6c30e365;
  border-radius: 15px;
  padding: 0 10px;
}

.instructor-info2 {
  display: flex;
  gap: 10px;
  color: #ffffffc7;
  margin-bottom: 1rem;
}

.instructor-info2 h4 {
  max-width: fit-content;
  background-color: #6c30e35c;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 15px;
  padding: 0 10px;
}

.instructor-info p {
  text-align: justify;
}

.instructor-slide:hover{
  transform: translateY(-3px);
}

.instructor-slide:hover .instructor-image img{
  box-shadow: 0 0 10px 5px var(--primary-color);
}

.carousel-dots {
  text-align: center;
  margin-top: 1.5rem;
}
.carousel-dots .dot {
  display: inline-block;
  height: 10px;
  width: 10px;
  background-color: var(--border-color);
  border-radius: 5px;
  margin: 0 5px;
  transition: width 0.3s ease;
}

.instructor-slider:hover{
  animation-play-state: paused;
}

/* Dot animation */
@keyframes dotAnimation {
  0%,
  45%,
  100% {
    width: 10px;
    background-color: var(--border-color);
  }
  50%,
  95% {
    width: 30px;
    background-color: var(--primary-color);
  }
}

.carousel-dots .dot:first-child {
  animation: dotAnimation 8s infinite ease-in-out;
  animation-delay: -4s; /* Start halfway through second part */
}
.carousel-dots .dot:last-child {
  animation: dotAnimation 8s infinite ease-in-out;
}

.instructor-slider:hover ~ .carousel-dots .dot {
  animation-play-state: paused;
}


/* --- Courses Page Specific --- */
#quote {
  text-align: center;
  padding: 8rem 5% 4rem;
  background-color: var(--surface-color);
}
.quote-content p {
  font-size: 1.8rem;
  font-style: italic;
  max-width: 800px;
  margin: 0 auto 1rem;
  animation: fadeInUp 1s ease-out, gradient-flow 5s linear infinite;
}
.quote-content cite {
  font-size: 1.1rem;
  animation: fadeInUp 1s ease-out 0.2s, gradient-flow 5s linear infinite;
  animation-fill-mode: backwards;
}

#premium-courses {
  background-color: var(--surface-color);
  padding-top: 3rem;
}
#free-courses {
  padding-top: 3rem;
}

/* --- Authentication Pages (Login/Signup) --- */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding-top: 80px; /* Offset for header */
}

.auth-form {
  background-color: var(--surface-color);
  padding: 2.5rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px var(--shadow-color);
  width: 100%;
  max-width: 450px;
  /* text-align: center; */
  animation: fadeInUp 0.8s ease-out;
}

.auth-form h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-muted-color);
  margin: 2rem 0;
  text-align: center;
}

.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--shadow-color);
}

.form-options {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.forgot-password {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
}

.forgot-password:hover {
  text-decoration: underline;
}

.auth-btn {
  width: 100%;
  padding: 0.8rem;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
}

.auth-switch {
  margin-top: 1.5rem;
  color: var(--text-muted-color);
}

.auth-switch a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* --- Footer --- */
footer {
  background-color: var(--surface-color);
  padding: 4rem 5% 1rem;
  border-top: 1px solid var(--border-color);
}
.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.footer-about h3,
.footer-links h3,
.footer-social h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}
.footer-about p {
  color: var(--text-muted-color);
}
.footer-links ul {
  list-style: none;
}
.footer-links ul li a {
  text-decoration: none;
  color: var(--text-muted-color);
  display: inline-block;
  margin-bottom: 0.5rem;
  transition: color 0.3s, transform 0.3s;
}
.footer-links ul li a:hover {
  color: orange;
  transform: translateX(5px);
}

.social-icons {
  display: flex;
  gap: 12px;
}

.social-icons img {
  height: 19px;
  width: 19px;
  filter: brightness(0) saturate(100%) invert(94%) sepia(100%) saturate(0%)
    hue-rotate(233deg) brightness(107%) contrast(105%);
  transition: transform 0.5s;
}

.social-icons img:hover {
  transform: translateY(-2px);
  /* filter: brightness(0) saturate(100%) invert(35%) sepia(65%) saturate(1578%) hue-rotate(235deg) brightness(101%) contrast(93%); */
  filter: brightness(0) saturate(100%) invert(67%) sepia(12%) saturate(6495%)
    hue-rotate(338deg) brightness(100%) contrast(91%);
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted-color);
  font-size: 0.9rem;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes moveShape {
  from {
    transform: translate(0, 0) rotate(0deg);
  }
  to {
    transform: translate(40px, 60px) rotate(90deg);
  }
}

@keyframes gradient-flow { 
  to {
        background-position: 200% center;
    }
}

@keyframes slideInstructors {
  0%,
  45% {
    transform: translateX(0%);
  }
  50%,
  95% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0%);
  }
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  nav ul {
    display: flex;
    gap: 1rem;
  }
  .hero-content h1 {
    font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 4rem 5%;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .instructor-slide {
    flex-direction: column;
    text-align: center;
  }
  .instructor-info h2 {
    text-align: center;
    left: 0;
    transform: none;
  }
}

@media (max-width: 710px) {
  nav ul {
    display: none;
  }

  /* .logo{
    display: none;
  } */
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.5rem;
  }
  .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  section h2 {
    font-size: 2rem;
  }
  .background-shapes::before {
    width: 250px;
    height: 250px;
  }
  .background-shapes::after {
    width: 150px;
    height: 150px;
  }
  .auth-form {
    padding: 1.5rem;
  }
}
