/* ================= ROOT VARIABLES ================= */
:root {
  --primary-blue: #2563eb;
  --primary-dark: #1e40af;

  --bg-body: #f4f4f9;
  --bg-card: #ffffff;
  --bg-card-dark: #1e293b;
  --bg-footer: #020617;

  --text-main: #111827;
  --text-light: #f8fafc;
  --text-muted: #6b7280;

  --accent-green: #22c55e;
  --border-color: #ddd;
  --border-radius: 8px;
  --shadow-color: rgba(0,0,0,0.1);
}

h1 {
  text-align: center;
  margin-bottom: 5px;
}

/* ================= COURSES GRID ================= */
#courses-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 3px;
}

/* ================= COURSE CARD ================= */
.course-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px;
  box-shadow: 0 2px 5px var(--shadow-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  margin: 20px;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px var(--shadow-color);
}

/* ================= COURSE IMAGE ================= */
.course-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

/* ================= COURSE TEXT ================= */
.course-title {
  font-size: 18px;
  font-weight: bold;
  margin: 10px 0 6px 0;
  color: var(--text-main);
}

.course-start,
.course-duration,
.course-price,
.course-tags,
.course-instructor,
.course-status {
  font-size: 14px;
  margin: 2px 0;
  color: var(--text-muted);
}

/* ================= COURSE LINK ================= */
.course-link {
  margin-top: auto;
  text-decoration: none;
  background-color: var(--primary-blue);
  color: var(--text-light);
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.course-link:hover {
  background-color: var(--primary-dark);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  #courses-container {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }

  .course-title {
    font-size: 16px;
  }

  .course-start,
  .course-duration,
  .course-price,
  .course-tags,
  .course-instructor,
  .course-status {
    font-size: 13px;
  }
}

@media (max-width: 768px) {

  .courses-container {
    padding-left: 20px;
    padding-right: 20px;
    margin-top: 0rem;
    padding-top: 0rem;
    /* This ensures the cards don't hit the screen edges */
}
  /* 1. Create a compact info grid */
  .course-details-wrapper { 
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two items per row */
    gap: 10px;
    margin-bottom: 15px;
    text-align: left;
  }

  /* 2. Better Image Handling */
  .course-image {
    height: auto; 
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px; /* Softer look */
  }
  
  /* 3. Improved Typography */
  .course-info-label {
    color: #9ca3af; /* Muted gray for labels */
    font-weight: 400;
    display: block; /* Label on top of value */
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .course-card {
    padding: 15px; /* Uniform padding all around */
    margin-bottom: 5px; /* Space between stacked cards */
}
  .course-info-value {
    color: #ffffff; /* Bright white for the actual info */
    font-weight: 600;
    font-size: 13px;
  }
}
@media (max-width: 400px) {
  .course-image {
    height: 120px;
  }

  .course-title {
    font-size: 15px;
  }

  .course-start,
  .course-duration,
  .course-price,
  .course-tags,
  .course-instructor,
  .course-status {
    font-size: 12px;
  }

  .course-link {
    padding: 8px;
    font-size: 13px;
  }
}