/* === Estilos generales === */
:root {
  --accent: #337AB7;
  --muted: #6b7280;
  --bg: #f5f8fc;
  --text: #222;
  --white: #fff;
}

body {
  background: var(--bg);
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.section-title {
  text-align: center;
  margin-bottom: 12px;
  font-size: 1.6rem;
  color: var(--muted);
}

.intro {
  margin-bottom: 18px;
  color: var(--muted);
  text-align: center;
  max-width: 900px;
  margin-inline: auto;
}

/* === Botones de categoría === */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 25px auto 35px;
}

.category-btn {
  background: var(--white);
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 25px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.category-btn:hover,
.category-btn.active {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(51, 122, 183, 0.25);
  border-color: var(--accent); /* ✅ 1 */
  font-weight: 700;            /* ✅ 2 */
  letter-spacing: 0.3px;       /* ✅ 3 */
}

/* === Controles === */
.controls-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-container {
  width: 100%;
  max-width: 520px;
}

.search-container input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  outline: none;
  font-size: 0.95rem;
  transition: box-shadow 0.3s;
}

.search-container input:focus {
  box-shadow: 0 0 8px rgba(51, 122, 183, 0.4);
}

/* === Grid de cursos === */
.courses-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 10px;
}

/* === Tarjetas de cursos === */
.course-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(6, 12, 24, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(6, 12, 24, 0.08);
}

.course-image {
  width: 100%;
  height: 160px;
  background: #e9f2fb;
  background-size: cover;
  background-position: center;
}

.course-body {
  padding: 16px;
}

.course-body h3 {
  font-size: 1rem;
  margin: 10px 0;
  color: var(--accent);
  min-height: 2.4rem;
  font-weight: 600;
}

.course-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.download-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  background: var(--accent);
  color: var(--white);
  transition: all 0.25s ease;
}

.download-btn:hover {
  background: #245f92;
  transform: translateY(-2px);
}

/* === Panel admin (si lo usás) === */
.admin-panel {
  background: var(--white);
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(6, 12, 24, 0.06);
  margin-bottom: 18px;
}

.hidden {
  display: none;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.admin-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-grid input[type="text"],
.admin-grid input[type="url"],
.admin-grid input[type="file"] {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* === Responsivo === */
@media (max-width: 900px) {
  .category-buttons {
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .category-buttons {
    flex-direction: column;
    align-items: center;
  }

  .course-card {
    max-width: 400px;
    margin: auto;
  }
}