/* courses.css - Services ilə eyni dizayn */

/* =========================================
   1. HEADER DÜZƏLİŞLƏRİ (Specifik)
   ========================================= */

/* Desktopda Header-dəki axtarış düyməsini gizlət */
.header-search-btn {
  display: none;
}

/* Mobildə Header-dəki axtarış düyməsini göstər */
@media (max-width: 768px) {
  .header-search-btn {
    display: flex !important;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
  }
}

/* =========================================
     2. AXTARIŞ PANELI (SEARCH BAR)
     ========================================= */
.search-wrapper {
  background: #ffffff;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  border: 1px solid #e2e8f0;
  position: relative;
}

.search-top {
  display: grid;
  grid-template-columns: 2fr 1fr auto; /* Input | Select | Button */
  gap: 15px;
  align-items: center;
}

/* Axtarış qutusu */
.main-search-box {
  position: relative;
  width: 100%;
}

.main-search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  z-index: 2;
}

.main-search-box input {
  padding-left: 45px; /* İkon üçün yer */
}

/* Input və Select stilləri */
input,
select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1e293b;
  background-color: #f8fafc;
  outline: none;
  box-sizing: border-box;
  height: 48px;
  transition: 0.3s;
}

input:focus,
select:focus {
  border-color: #1e293b;
  background-color: #fff;
}

/* Axtar Düyməsi */
button[type="submit"] {
  background-color: #8b5cf6; /* Kurslar üçün bənövşəyi */
  color: white;
  border: none;
  padding: 0 40px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  height: 48px;
  transition: 0.3s;
}

button[type="submit"]:hover {
  background-color: #7c3aed;
}

/* Bağlama (X) Düyməsi - Desktopda GİZLİ */
.close-search-btn {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
}

/* =========================================
     3. KATEQORİYA CHIPLƏRİ
     ========================================= */
.quick-categories {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

.cat-chip {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 10px 20px;
  border-radius: 50px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
  font-size: 0.9rem;
  font-weight: 500;
}

.cat-chip:hover {
  border-color: #8b5cf6;
  color: #1e293b;
}

.cat-chip i {
  color: #8b5cf6;
}

/* =========================================
     4. GRID SİSTEMİ VƏ KARTLAR
     ========================================= */
.section-title {
  text-align: center;
  margin-bottom: 25px;
}

.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

/* KURS KARTI */
.course-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
  height: 100%;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.course-card.is-vip {
  border: 2px solid #f59e0b;
  background: linear-gradient(to bottom, #ffffff, #fffbf2);
}

/* Şəkil */
.course-img-box {
  height: 180px;
  width: 100%;
  position: relative;
  background: #f3f4f6;
  overflow: hidden;
}

.course-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.course-card:hover .course-img-box img {
  transform: scale(1.08);
}

/* Badges */
.course-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.course-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  color: white;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.course-footer-id {
  font-size: 0.9rem;
  color: #000000; /* Açıq boz rəng */
  font-weight: 600;
  font-family: monospace; /* Rəqəmlər üçün xüsusi şrift */
  letter-spacing: 0.5px;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.badge-vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.badge-urgent {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

/* Kateqoriya Etiketi */
.course-cat-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #8b5cf6;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

/* Məzmun */
.course-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-center {
  font-size: 0.9rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  font-weight: 500;
}

.course-center i {
  color: #9ca3af;
}

.course-details-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.course-tag {
  background: #f3f4f6;
  color: #374151;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.course-tag i {
  color: #8b5cf6;
}

.course-footer {
  margin-top: auto;
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #10b981;
}

.course-btn {
  background: #8b5cf6;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
}

.course-btn:hover {
  background: #7c3aed;
}

/* Daha Çox Göstər Düyməsi */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  width: 100%;
}
.btn-outline {
  background: transparent;
  border: 2px solid #8b5cf6;
  color: #8b5cf6;
  padding: 12px 35px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  font-size: 1rem;
}
.btn-outline:hover {
  background: #8b5cf6;
  color: white;
}

/* =========================================
     5. RESPONSIVE (MOBIL)
     ========================================= */
@media (max-width: 768px) {
  /* Axtarış Paneli - MOBIL OVERLAY */
  .search-wrapper {
    display: none; /* Mobildə susmaya görə gizli */
    padding: 20px;
  }

  .search-wrapper.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    border-radius: 0;
    overflow-y: auto;
    background: white;
    padding-top: 60px;
  }

  .close-search-btn {
    display: block; /* Mobildə görünür (active olanda) */
  }

  .search-top {
    grid-template-columns: 1fr; /* Alt-alta */
    gap: 15px;
  }

  button[type="submit"] {
    width: 100%;
  }

  /* Kart Grid */
  .listings {
    grid-template-columns: 1fr 1fr; /* Mobildə 2 sütun */
    gap: 10px;
  }

  .course-img-box {
    height: 130px;
  }

  .course-title {
    font-size: 0.95rem;
  }

  .course-price {
    font-size: 1rem;
  }

  .course-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .course-content {
    padding: 10px;
  }
}

/* --- STORIES (TƏCİLİ) HİSSƏSİ --- */
.stories-container {
  background: white;
  padding: 15px 0;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 20px;
}

.stories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.stories-header h4 {
  margin: 0;
  color: #ef4444; /* Qırmızı rəng */
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stories-link {
  font-size: 0.9rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
}

.stories-wrapper {
  display: flex;
  gap: 15px;
  overflow-x: auto; /* Yana sürüşdürmə */
  padding-bottom: 10px;
  scrollbar-width: none; /* Firefox-da skrollu gizlət */
}

/* Chrome/Safari-də skrollu gizlət */
.stories-wrapper::-webkit-scrollbar {
  display: none;
}

/* Tək element (Story) */
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 72px; /* Sıxılmasın deyə minimum ölçü */
}

/* Şəklin çərçivəsi */
.story-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

/* Aktiv (Təcili) halda qırmızı çərçivə */
.story-ring.active {
  border-color: #ef4444;
}

.story-item:hover .story-ring {
  transform: scale(1.05);
}

/* Şəklin özü */
.story-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover; /* Şəkli dairəyə sığdırır */
  background-color: #f1f5f9;
}

/* Qiymət yazısı */
.story-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* SKELETON (Yüklənəndə görünən boz dairələr) */
.story-skeleton {
  min-width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
