:root {
    --blue: #0046CF;
    --yellow: #F4C80C;
    --light-bg: #f9fafb;
    --border: #e5e7eb;
  }

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

  body {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  /* Make sure main grows and centers its content */
  main {
    flex: 1;
    display: flex;
    justify-content: center; /* center horizontally */
    align-items: flex-start; /* top aligned */
    padding: 2rem;
  }

  /* Content box */
  .content {
    width: 100%;
  }

  .container {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 1920px;
  }

  h1 {
    text-align: center;
    color: var(--blue);
    margin-bottom: 1.5rem;
  }

  form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
  }

  input:focus {
    outline: 2px solid var(--blue);
    border-color: var(--blue);
  }

  button {
    background: var(--blue);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  button:hover {
    background: #153075;
  }

  .alt-action {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
  }

  .alt-action a {
    color: var(--yellow);
    font-weight: 600;
    text-decoration: none;
  }

  .alt-action a:hover {
    text-decoration: underline;
  }

  .form-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
  }

  .form-message.success {
    color: green;
  }

  .form-message.error {
    color: red;
  }

.login, .register {
  max-width: 400px;
  padding: 1.2rem;
}

/* Navbar */
.navbar {
  background: var(--blue);
  color: white;
  padding: 1rem;
  width: 100%;           /* span full width */
  position: relative;    /* keep it above content */
  top: 0;
  left: 0;
}

.nav-container {
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-title {
  font-weight: bold;
  font-size: 1.2rem;
  margin-right: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 1rem;
  padding-inline: 30px;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--yellow);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
}



/* Dashboard */

.dashboard {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem;
}

/* User info card */
.user-card {
  background: white;
  padding: 1.5rem;
  margin-top: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: left;           /* align text inside card */
  display: inline-block;      /* shrink to fit content, but still centered */
}

.user-card p {
  margin: 0.5rem 0;
}
/* Search bar */
.search-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.search-bar input {
  flex-grow: 1;
  padding: 10px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px 0 0 6px;
}

.search-bar button {
  padding: 10px 20px;
  border: none;
  background: #007bff;
  color: white;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
}

.search-bar button:hover {
  background: #0056b3;
}

/* Courses grid */
.courses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.card-detail {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}

.card h3 {
  margin: 0 0 5px;
}

.card p {
  font-size: 14px;
  color: #666;
  flex-grow: 1;
}

.card .price {
  font-weight: bold;
  margin: 8px 0;
}

.card button {
  padding: 10px;
  border: none;
  background: #28a745;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

.card button:hover {
  background: #1e7e34;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination button, .pagination select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button.active {
  background: #007bff;
  color: white;
}

.pagination button:disabled {
  background: #eee;
  cursor: not-allowed;
}

.course-detail {
  display: grid;
  grid-template-columns: 150px 1fr; /* label column + value column */
  gap: 8px 20px; /* row gap, column gap */
  margin-bottom: 20px;
  place-content: center;
}

.course-detail-container {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.course-card {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  margin: auto;
}

.course-thumbnail {
  width: 100%;
  max-height: 600px;
  display: block;
  object-fit: cover;
}


.image {
  transition: .5s ease;
  backface-visibility: hidden;
  opacity: 1;
}

.image:hover {
  opacity: 0.8;
}

.course-info {
  padding: 1.5rem;
}

.course-info h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.course-info p {
  margin: 0.3rem 0;
  color: #333;
}

.topic-container {
  display: flex;
  flex-wrap: wrap;      /* wrap tags if they overflow */
  gap: 0.5rem;          /* space between tags */
  margin-top: 10px;
  margin-bottom: 10px;
}

.topic-container .topic-tag {
  background-color: var(--blue); /* blue background */
  color: #fff;               /* white text */
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;     /* fully rounded */
  font-size: 0.875rem;       /* slightly smaller text */
  font-weight: 500;
  display: inline-block;
}

.label {
  font-weight: bold;
  color: #333;
}

.value {
  color: #555;
}

.btn-primary {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: #1d4ed8; /* blue */
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

.form-message {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--yellow);
}

@media (max-width: 480px) {
  .browser {
    padding: 0px;
  }

  .user-data {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 1.5rem;
  }
}

.course-modules-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.download-certificate {
  max-width: 300px;
}

.download-certificate:disabled {
  background: #999;
  cursor: not-allowed;
}

.course-modules-header {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr; /* Defines three columns with fractional units */
  grid-gap: 10px; /* Adds a gap between grid items */
}

.course-header {
  margin-bottom: 30px;
  text-align: center;
}

.course-title {
  font-size: 1.8rem;
  margin-bottom: 3px;
}

.course-instructor {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #4caf50;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: #555;
}

.modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.module-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.module-title {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.module-description {
  margin-bottom: 12px;
  color: #444;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  background: #007bff;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover {
  background: #0056b3;
}

.complete-btn {
  background: #28a745;
}

.complete-btn:hover {
  background: #1e7e34;
}

.video-container {
  margin-top: 20px;
  margin-bottom: 20px;
  width:100%;
}

.video-container video {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

@media (width < 64rem) {

  main {
    padding: 0rem;
  }
  .course-modules-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .courses {
    grid-template-columns: repeat(auto-fit, minmax(208px, 1fr));
  }
  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--blue);
    position: absolute;
    top: 60px;
    right: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
  }
  .nav-links.show {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
}

@media (width >= 64rem) {
  .course-card {
    /* max-width: 600px; */
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: auto;
    display: flex;
  }

  .course-thumbnail {
    width: 100%;
    max-height: 600px;
    display: block;
    object-fit: cover;
  }

  .course-info {
    padding: 1.5rem;
    display: flex;
    flex-grow: 1;
    flex-flow: column;
    justify-content: center;
    align-items: center;
  }

  .course-detail {
    flex-grow: 1;
  }
}