* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f9f9f9;
  color: #333;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: #1E3A8A;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

header .logo img {
  width: 50px;
  height: 50px;
}

header .logo span {
  font-size: 24px;
  font-weight: 600;
}

header nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

header nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

header nav a:hover {
  text-decoration: underline;
}

header button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: white;
}

/* Layout */
.container {
  display: flex;
  min-height: calc(100vh - 80px);
}

/* Sidebar */
aside {
  width: 250px;
  background: #E0ECFF;
  padding: 30px 20px;
}

aside h3 {
  margin-bottom: 15px;
  font-size: 20px;
  color: #1E40AF;
}

aside ul {
  list-style: none;
}

aside ul li {
  margin-bottom: 12px;
}

aside ul li a {
  color: #1E40AF;
  text-decoration: none;
  font-weight: 500;
  transition: 0.2s;
}

aside ul li a:hover {
  padding-left: 6px;
  color: #2563EB;
}

/* Main Content */
main {
  flex: 1;
  padding: 40px 30px;
}

main h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

main p {
  font-size: 16px;
  margin-bottom: 30px;
}

.card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-width: 900px;
  margin-bottom: 30px;
}

.card h2 {
  margin-bottom: 10px;
}

.card p {
  margin-bottom: 20px;
}

/* Course Cards Grid */
.course-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.course-card {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: calc((100% / 3) - 16px);
  max-width: calc((100% / 3) - 16px);
  min-width: 250px;
  padding: 28px 22px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 768px) {
  .course-card {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 100% !important;  /* Take up full width */
    max-width: 100% !important;   /* Ensure max-width is 100% */
    min-width: auto;              /* Remove any min-width */
  }
}

/* Light Mode Backgrounds */
.course-card:nth-child(1) { background-color: #dbeafe; }
.course-card:nth-child(2) { background-color: #d1fae5; }
.course-card:nth-child(3) { background-color: #fef3c7; }
.course-card:nth-child(4) { background-color: #f0f4f8; }
.course-card:nth-child(5) { background-color: #ede9fe; }
.course-card:nth-child(6) { background-color: #cffafe; }
.course-card:nth-child(7) { background-color: #ffebfc; }

.course-card h3 {
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 20px;
  color: #1E3A8A;
}

.course-card p {
  color: #444;
  font-size: 15px;
  line-height: 1.4;
  flex-grow: 1;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
}

/* Dark Mode */
body.dark {
  background: linear-gradient(135deg, #0f172a, #1e293b, #0f172a);
  background-size: 400% 400%;
  animation: darkBackground 20s ease infinite;
  color: #e0e0e0;
}

body.dark header {
  background: #1e1e1e;
}

body.dark aside {
  background: linear-gradient(135deg, #0f172a, #0f172a);
  box-shadow: 0 0 15px 0px rgba(139, 154, 179, 0.2);
}

body.dark aside h3,
body.dark aside ul li a {
  color: #93c5fd;
}

body.dark .card {
  background: #1e1e1e;
  color: #e0e0e0;
  box-shadow: 0 0 15px 3px rgba(74, 110, 177, 0.2);
}

body.dark .card p {
  color: #bbb;
}

/* Dark Mode Course Cards */
body.dark .course-card:nth-child(1) { background-color: #1e293b; color: #bfdbfe; }
body.dark .course-card:nth-child(2) { background-color: #14532d; color: #bbf7d0; }
body.dark .course-card:nth-child(3) { background-color: #78350f; color: #fde68a; }
body.dark .course-card:nth-child(4) { background-color: #2e3440; color: #d8dee9; }
body.dark .course-card:nth-child(5) { background-color: #4c1d95; color: #ddd6fe; }
body.dark .course-card:nth-child(6) { background-color: #164e63; color: #a5f3fc; }
body.dark .course-card:nth-child(7) { background-color: #6e2362; color: #fff9fe}

body.dark .course-card h3,
body.dark .course-card p {
  color: inherit;
}

/* Buttons */
.card .btn {
  display: inline-block;
  padding: 10px 18px;
  background-color: #3B82F6;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s;
}

.card .btn:hover {
  background-color: #1E40AF;
}

body.dark .card .btn {
  background-color: #3B82F6;
}

body.dark .card .btn:hover {
  background-color: #1E40AF;
}

/* Footer */
footer {
  background: #172e6e;
  color: white;
  padding: 20px 30px;
  text-align: center;
}

.footer-container {
  max-width: 1000px;
  margin: auto;
}

.footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Dark Mode Footer */
body.dark footer {
  background: #111827;
  color: #d1d5db;
}

body.dark .footer-links a {
  color: #9ca3af;
}

body.dark .footer-links a:hover {
  color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
  
  .container {
        flex-direction: column;
      }

      aside {
        display: none; /* Hide sidebar on mobile */
        width: 100%;
        padding: 20px;
      }

      main {
        padding: 20px;
      }

      nav-wrapper {
    flex-direction: column;
    align-items: flex-start; /* Align nav links to left on small screens */
    width: 100%;
    gap: 10px;
  }

  header nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start; /* Align nav items to left */
  }

  header button {
    align-self: flex-start;
  }

  

  .course-grid {
    flex-direction: column;
  }

  .course-card {
    flex: 1 1 100%;
    min-width: auto;
  }



@keyframes darkBackground {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
}


.mobile-header {
  display: none;
}

@media (max-width: 768px) {
  .mobile-header {
    height: 88px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #1E3A8A;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .mobile-left img {
    width: 69px;
    height: 69px;
  }

  

  .mobile-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }

  .theme-toggle {
    margin-right: 11px;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
  }

  .mobile-menu {
    position: relative;
  }

  .menu-icon {
    font-size: 20px;
    cursor: pointer;
    user-select: none;
  }

  .menu-dropdown {
    position: absolute;
    right: 0;
    top: 30px;
    background-color: #1E3A8A;
    border-radius: 6px;
    padding: 8px 12px;
    display: none;
    flex-direction: column;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  }

  .menu-dropdown a {
    color: white;
    text-decoration: none;
    padding: 6px 0;
    font-size: 14px;
  }

  .menu-dropdown a:hover {
    text-decoration: underline;
  }

  .mobile-menu:hover .menu-dropdown {
    display: flex;
  }

  header {
    display: none;
  }
  .mobile-subjects {
  position: relative;
  cursor: pointer;
}

.subject-icon {
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  margin-left: 117px;
}

.subject-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1E3A8A;
  padding: 8px 0;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  z-index: 1000;
  white-space: nowrap;
}

.subject-dropdown a {
  display: block;
  padding: 8px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}

.subject-dropdown a:hover {
  background-color: #3749A3;
}

.mobile-subjects:hover .subject-dropdown {
  display: block;
}

}

body.dark .mobile-header {
  background-color: #0f172a; /* a nice dark navy shade */
}

body.dark .mobile-subjects .subject-icon,
body.dark .mobile-right .menu-icon {
  color: white;
}

body.dark .subject-dropdown,
body.dark .menu-dropdown {
  background-color: #1e293b;
  border: 1px solid #334155;
}
