/* =========================================
    COURSES PAGE & SEARCH STYLES
    ========================================= */

/* --- PREMIUM HERO SECTION --- */
.page-header {
  position: relative;
  padding: 200px 8% 80px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(to bottom, rgba(14, 22, 16, 0.85), var(--bg-body)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80");
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(39, 217, 83, 0.15), transparent 70%);
  transform: translate(-50%, -50%);
  filter: blur(80px);
  z-index: -1;
  animation: pulse 8s infinite alternate;
}
@keyframes pulse {
  0% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.9);
  }
  100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.1);
  }
}
.page-header h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  color: white;
  margin-bottom: 25px;
  font-weight: 800;
  line-height: 1.1;
}
.text-gradient {
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-header p {
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 650px;
  margin: 0 auto 40px;
}

/* --- SEARCH & FILTER BAR --- */
.search-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  z-index: 10;
}
.search-bar {
  background: rgba(24, 36, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 10px 15px;
  display: flex;
  gap: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.search-input-group {
  flex: 2;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border: 1px solid transparent;
  transition: 0.3s;
}
.search-input-group:focus-within {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
}
.search-input-group input {
  background: transparent;
  border: none;
  width: 100%;
  color: white;
  font-size: 1rem;
  padding: 15px 10px;
  outline: none;
}
.search-input-group i {
  color: var(--text-muted);
  margin-right: 5px;
}

.filter-select {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: white;
  border-radius: 50px;
  padding: 0 20px;
  cursor: pointer;
  outline: none;
  appearance: none;
  color-scheme: dark;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2327d953' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 16px;
  font-size: 0.95rem;
  transition: 0.3s;
}
.filter-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.filter-select option {
  background: #18241b;
  color: #f0f4f1;
  padding: 10px;
}

.filter-select option:hover,
.filter-select option:checked {
  background: #1f2e23;
  color: var(--primary, #27d953);
}

.btn-search {
  background: var(--primary);
  color: black;
  border: none;
  border-radius: 50px;
  padding: 0 40px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  font-size: 1rem;
  white-space: nowrap;
}
.btn-search:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* --- COURSES GRID --- */
.courses-section {
  padding: 40px 8% 100px;
}
.section-label {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  display: block;
}
.courses-header-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 50px;
}
.courses-header-row h2 {
  font-size: 2.5rem;
  color: white;
}
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
}
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: 0.4s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.course-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.course-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  box-shadow: inset 0 0 0 0 rgba(39, 217, 83, 0);
  transition: 0.4s;
  pointer-events: none;
}
.course-card:hover::after {
  box-shadow: inset 0 0 20px rgba(39, 217, 83, 0.1);
}

.course-thumb {
  height: 220px;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.course-card:hover .course-thumb img {
  transform: scale(1.1);
}
.course-overlay {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  padding: 5px 12px;
  border-radius: 50px;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.course-content {
  padding: 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.course-category {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.course-category::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}
.course-title {
  font-size: 1.4rem;
  color: white;
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.course-features {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.c-feat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.c-feat i {
  color: var(--text-muted);
}
.course-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.course-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}
.course-enroll-btn {
  padding: 10px 24px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
  text-decoration: none;
  transition: 0.3s;
}
.course-enroll-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: black;
}

/* --- STATS SECTION --- */
.stats-section {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  max-width: 1200px;
  margin: -60px auto 0;
  position: relative;
  z-index: 5;
  padding: 0 5%;
}
.stat-item {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: 0.3s;
}
.stat-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}
.stat-item i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 15px;
}
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  display: block;
  margin-bottom: 5px;
}

/* --- COURSE RESPONSIVE IMPROVEMENTS --- */
@media (max-width: 991px) {
  .search-bar {
    flex-direction: column;
    border-radius: 24px;
    padding: 25px;
    background: rgba(24, 36, 27, 0.95); /* Simpler bg for mobile */
    height: auto;
    gap: 15px;
  }
  .search-input-group,
  .filter-select,
  .btn-search {
    width: 100%;
    margin: 0;
    height: 50px; /* Uniform height */
  }
  .btn-search {
    padding: 0; /* Centered text */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .search-container {
    margin-top: 30px;
  }

  .stats-section {
    flex-direction: column;
    margin-top: 40px;
    margin-bottom: 40px;
  }
  .page-header h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 140px 5% 80px;
  }
  .courses-section {
    padding: 50px 5% 70px;
  }
  .courses-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
  }
  .courses-header-row h2 {
    font-size: 1.8rem;
  }
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .course-content {
    padding: 22px;
  }
  .course-title {
    font-size: 1.2rem;
  }
  .course-features {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: 120px 5% 60px;
  }
  .page-header h1 {
    font-size: 1.8rem;
  }
  .page-header p {
    font-size: 1rem;
  }
  .course-thumb {
    height: 180px;
  }
  .stat-item {
    padding: 20px;
  }
  .stat-number {
    font-size: 2rem;
  }
}
