/*---------------------------
       Global Variables
----------------------------*/
:root {
  --gradient-start: #6C63FF;
  --gradient-end: #4433FF;
  --dark-bg: #1c1c1c;
  --dark-text: #ddd;
  --light-bg: #fff;
  --light-text: #555;
  --footer-bg: #2e3a4e; /* Solid footer background */
  --sidebar-width: 300px;
  --border-color: #ccc;
}

/*---------------------------
       Base & Layout
----------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  font-family: 'Roboto', sans-serif;
  transition: background 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
}
body.light {
  background: var(--light-bg);
  color: var(--light-text);
}
body.dark {
  background: var(--dark-bg);
  color: var(--dark-text);
}
.wrapper {
  flex: 1;
}

/*---------------------------
       Top Navbar
----------------------------*/
.top-nav {
  background-color: var(--footer-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: relative;
  z-index: 1000;
}
.top-nav .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
}
.top-nav .logo img {
  height: 40px;
  margin-right: 10px;
}
.top-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.top-nav ul li .nav-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: background 0.3s, opacity 0.3s;
}
.top-nav ul li .nav-btn:hover {
  background: rgba(255,255,255,0.3);
  opacity: 0.9;
}

/* Mobile Navbar */
.navbar-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
}
@media (max-width: 768px) {
  .top-nav ul {
    display: none;
    flex-direction: column;
    background-color: var(--footer-bg);
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    border-radius: 0;
    z-index: 999;
  }
  .top-nav ul.show {
    display: flex;
  }
  .top-nav ul li {
    margin: 1rem 0;
    text-align: center;
  }
  .navbar-toggle {
    display: block;
  }
}

/*---------------------------
       Hero Section with Background Image
----------------------------*/
.hero {
  position: relative;
  background: url("../images/backgroundr.jpg") center center / cover no-repeat;
  color: #fff;
  text-align: center;
  padding: 4rem 2rem;
  overflow: hidden;
  min-height: 40vh;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
  z-index: 0;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/*---------------------------
       Lesson Cards
----------------------------*/
.lesson-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 2rem;
  justify-content: center;
}
.lesson-card {
  background: #fff;
  color: #333;
  flex: 1 1 280px;
  max-width: 320px;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}
body.dark .lesson-card {
  background: #2c2c2c;
  color: #ddd;
  box-shadow: 0 2px 5px rgba(255,255,255,0.1);
}
.lesson-card h2 {
  margin-bottom: 0.5rem;
  color: var(--gradient-start);
}
.lesson-card p {
  margin-bottom: 1rem;
}
.btn {
  background: var(--gradient-start);
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 20px;
  transition: background 0.3s;
}
.btn:hover {
  background: #5a54d1;
}
.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/*---------------------------
       Footer (Solid Background)
----------------------------*/
.footer-widget {
  background-color: var(--footer-bg);
  padding: 40px 20px;
  text-align: center;
}
.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}
.footer-logo, .footer-touch, .footer-social {
  flex: 1;
  margin: 10px 0;
}
.footer-logo img {
  width: 80px;
  margin-bottom: 10px;
}
.footer-touch p {
  font-size: 16px;
  margin: 0;
}
.footer-touch a {
  color: #ffffff;
  text-decoration: underline;
  font-size: 18px;
}
.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}
.footer-social a {
  font-size: 25px;
  width: 60px;
  height: 60px;
  line-height: 64px;
  text-align: center;
  border-radius: 50%;
  margin: 10px 14px;
  color: #ffffff;
  background-color: transparent;
  transition: all 0.3s ease-out;
  text-decoration: none;
}
@media (max-width: 767px) {
  .footer-social a {
    width: 52px;
    height: 50px;
    line-height: 50px;
    font-size: 20px;
    margin: 10px 7px;
  }
}
.footer-social a:hover {
  transform: scale(1.2);
}
.footer-copyright {
  padding: 10px 0;
}
.footer-copyright p {
  color: #fff;
  font-size: 16px;
}

.footer-widget {
  background-color: var(--footer-bg);
  padding: 40px 20px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

/* Each item is side-by-side on desktop by default */
.footer-logo, .footer-touch, .footer-social {
  flex: 1;
  margin: 10px 0;
}

/* On mobile, stack them vertically in the given order */
@media (max-width: 767px) {
  .footer-content {
    flex-direction: column;
  }
  .footer-logo,
  .footer-touch,
  .footer-social {
    flex: 0;       /* or flex: none; */
    width: 100%;   /* ensures full width if desired */
    margin: 10px 0;
  }
}


/*---------------------------
       Back-to-Top
----------------------------*/
.back-to-top {
  font-size: 20px;
  color: #fff;
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  line-height: 46px;
  border-radius: 50%;
  border: 2px solid #586376;
  background-color: #152136;
  text-align: center;
  z-index: 99;
  transition: all 0.3s ease-out;
  display: none;
}
.back-to-top:hover {
  background-color: #754ef9;
  border-color: #754ef9;
}

/*---------------------------
       Light/Dark Toggle
----------------------------*/
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #bbb;
  color: #333;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 1001;
  transition: background 0.3s;
}
.theme-toggle:hover {
  background: #999;
}
body.dark .theme-toggle {
  background: #444;
  color: #fff;
}
body.dark .theme-toggle:hover {
  background: #666;
}

.top-nav ul li .nav-btn.active {
  font-weight: bold;
}
