/* ------------------------------ Reset & Body -------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}

/* ------------------------------ Navbar -------------------------------- */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #000;
  color: #fff;
  border-radius: 0 0 15px 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.navbar .logo {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.navbar .logo img {
  height: 50px;
  margin-right: 15px;
}
.navbar .logo span {
  font-weight: bold;
  font-size: 1.5rem;
}

/* ------------------------------ Courses Container -------------------------------- */
.courses-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.courses-container h1 {
  text-align: center;
  margin-bottom: 2rem;
}
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .courses-grid {
    grid-template-columns: 1fr;
  }
}
.course-card {
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}
.course-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.course-card h3 {
  margin: 1rem;
  font-size: 1.2rem;
}
.course-card p {
  margin: 0 1rem 1rem 1rem;
  color: #555;
  font-size: 0.95rem;
}

/* ------------------------------ Footer -------------------------------- */
.footer {
  text-align: center;
  padding: 1.5rem;
  background-color: #111;
  color: #fff;
  margin-top: auto;
  border-top: 2px solid #222;
}

/* ------------------------------ Course Detail Page -------------------------------- */
.course-detail-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 450px; /* fixed height */
}
.course-detail-container h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}
.course-detail-container p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  color: #555;
  text-align: justify;
}

/* Language Selector */
.language-select {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.language-select label {
  font-weight: bold;
}
.language-select select {
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

/* ------------------------------ Lesson Card Compact ------------------------------ */
.lesson-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px; /* reduced padding */
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  background-color: #fafafa;
  height: auto; /* auto height to fit only buttons */
  display: flex;
  justify-content: center; /* center buttons horizontally */
  align-items: center; /* center buttons vertically */
  overflow: hidden;
}

/* Remove unnecessary lesson title styling */
.lesson-card p {
  display: none; /* hide the previous lesson title */
}

/* Buttons */
.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.button-group a,
.button-group button {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.button-group a[href$=".pdf"] {
  background-color: #1e90ff;
}
.button-group a[href$=".pdf"]:hover {
  background-color: #1c86ee;
}
.button-group a[href$=".mp4"] {
  background-color: #28a745;
}
.button-group a[href$=".mp4"]:hover {
  background-color: #218838;
}
.button-group button {
  background-color: #6f42c1;
}
.button-group button:hover {
  background-color: #5936a2;
}

/* Audio/Video Player */
#content-area video,
#content-area audio {
  width: 100%;
  margin-top: 10px;
  border-radius: 10px;
}

/* ------------------------------ Responsive -------------------------------- */
@media screen and (max-width: 768px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media screen and (max-width: 480px) {
  .courses-grid {
    grid-template-columns: 1fr;
  }
  .button-group {
    flex-direction: column;
  }
}
