/* carspage.css */

/* --- HEADER DÜYMƏLƏRİ --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Desktopda sol tərəfdəki hamburger gizli olsun */
#openSidebar {
  display: none;
}

.header-fav-btn,
.header-search-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  transition: 0.3s;
  font-size: 1rem;
}

/* Desktop-da Axtarış ikonu GİZLİ olsun */
.header-search-btn {
  display: none;
}

/* Favorit hər zaman görünür */
.header-fav-btn {
  display: flex;
}

.header-fav-btn:hover,
.header-search-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* SIDEBAR BALANS DÜZƏLİŞİ (YENİ) */
.sidebar-balance-box {
  background: #f8fafc;
  padding: 12px 20px;
  margin: 0 0 20px 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e2e8f0;
}

.bal-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.bal-label {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 2px;
  font-weight: 500;
}

.sidebar-amount {
  font-weight: 800;
  color: #1e293b;
  font-size: 1.1rem;
  margin: 0;
}

.sidebar-add-btn {
  background: #f59e0b;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
  transition: 0.3s;
}

.sidebar-add-btn:hover {
  background: #d97706;
  transform: scale(1.1);
}

/* --- AXTARIŞ PANELİ --- */
.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 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

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

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;
}

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

.search-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 15px;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #f1f5f9;
}

button[type="submit"] {
  background-color: #1e293b;
  color: white;
  border: none;
  padding: 0 30px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  height: 48px;
}

/* Bağlama düyməsi (default olaraq gizli) */
.close-search-btn {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  z-index: 10;
}

/* --- 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;
}
.cat-chip:hover,
.cat-chip.active {
  border-color: #f59e0b;
  color: #1e293b;
}
.cat-chip i {
  color: #f59e0b;
}

/* --- ELAN KARTLARI (DESKTOP DEFAULT) --- */
.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

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

.card-vip-style {
  border: 2px solid #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.image-wrapper {
  position: relative;
  height: 200px; /* Desktop hündürlük */
  overflow: hidden;
  background: #e2e8f0;
}

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

.card:hover .image-wrapper img {
  transform: scale(1.05);
}

/* --- BADGES (YENİLƏNMİŞ) --- */
/* VIP Badge - Sağ Yuxarı */
.status-badge.vip-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(45deg, #f59e0b, #d97706);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.75rem;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Offer Badge (Satılır/Kirayə) - Sol Aşağı (Məkanın altında yox, şəklin üzərində) */
.offer-badge {
  position: absolute;
  bottom: 130px;
  left: 10px;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.7rem;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.badge-sale {
  background: #10b981;
}
.badge-rent {
  background: #f59e0b;
}

/* Location Badge - Sol Yuxarı */
.location-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(30, 41, 59, 0.85);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
  z-index: 5;
  max-width: 60%; /* VIP üzərinə çıxmasın deyə limit */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ürək Butonu - Sağ Aşağı */
.card-fav-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  color: #94a3b8;
  transition: 0.3s;
  font-size: 1rem;
}
.card-fav-btn:hover {
  transform: scale(1.1);
}
.card-fav-btn.active {
  color: #ef4444;
}

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

.card h3 {
  font-size: 1.05rem;
  margin: 0 0 8px 0;
  color: #1e293b;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}

.card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 12px;
}
.card-details span {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

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

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

.id-text {
  color: #94a3b8;
  font-size: 0.75rem;
}

.vip-load-btn {
  border-color: #f59e0b;
  color: #b45309;
}
.vip-load-btn:hover {
  background: #f59e0b;
  color: white;
}

.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.btn-outline {
  background: transparent;
  border: 2px solid #1e293b;
  color: #1e293b;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}
.btn-outline:hover {
  background: #1e293b;
  color: white;
}

/* =========================================
     RESPONSIVE (MOBIL) HİSSƏSİ
     ========================================= */
@media (max-width: 768px) {
  /* 1. Header Düzəlişi */
  header {
    justify-content: space-between;
    padding: 0 15px;
    height: 60px; /* Hündürlük azaldıldı */
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Hamburger Solda */
  #openSidebar {
    display: flex !important;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    padding: 0;
  }

  /* --- LOGO SADECE İKON --- */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .logo h1 {
    font-size: 0; /* Yazını gizlət */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .logo h1 i {
    font-size: 1.6rem; /* İkonu göstər */
    display: block;
    color: #f59e0b;
  }

  /* Header Sağ Tərəf (İkonların Sıralanması) */
  .header-actions {
    gap: 12px;
  }

  /* Profil Adını Gizlət (Təkcə İkon Qalsın) */
  #userNameDisplay,
  .mobile-hide {
    display: none !important;
  }

  /* 3. İkonların Sırası: Axtarış - Seçilmişlər - Profil */
  .header-actions .user-dropdown {
    order: 3;
  }
  #favFilterBtn {
    order: 2;
  }
  #mobileSearchBtn {
    order: 1;
  }

  /* Profil İkonunu Düzəlt */
  .profile-btn {
    border: none;
    padding: 0;
    background: transparent;
    font-size: 1.3rem;
  }
  .profile-btn:hover {
    background: transparent;
  }

  .header-fav-btn,
  .header-search-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 1.3rem;
  }

  /* Favorit sayını mobildə gizlət (Səliqəli olsun) */
  .header-fav-btn span {
    display: none;
  }

  /* 2. Kart Grid Düzəlişi (2 Sütun) */
  .listings {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Kartların Mobildə Görünüşü */
  .image-wrapper {
    height: 140px;
  }

  .card-content {
    padding: 10px;
  }

  .card h3 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    height: 2.4em;
  }

  .card-details {
    gap: 4px;
    font-size: 0.7rem;
    margin-bottom: 8px;
    display: none;
  }

  .price {
    font-size: 1rem;
  }

  .id-text {
    font-size: 0.65rem;
  }

  /* Badges Mobildə - Ölçülər */
  .status-badge.vip-badge,
  .offer-badge,
  .location-badge {
    font-size: 0.6rem;
    padding: 3px 6px;
    top: 6px;
    left: 6px;
  }
  /* VIP sağ yuxarı */
  .status-badge.vip-badge {
    right: 6px;
    left: auto;
    top: 6px;
  }
  /* Məkan sol yuxarı */
  .location-badge {
    max-width: 55%;
  }
  /* Offer (Satılır) sol aşağı */
  .offer-badge {
    top: auto;
    bottom: 80px;
    left: 6px;
  }
  /* Ürək sağ aşağı */
  .card-fav-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    bottom: 6px;
    right: 6px;
  }

  .container {
    padding: 0 10px;
  }

  /* --- BAŞLIQLAR MƏRKƏZDƏ --- */
  .section-title {
    text-align: center;
  }

  /* 3. Axtarış Paneli */
  .search-wrapper {
    display: none;
    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;
  }
  .search-top,
  .search-filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .search-filters {
    border-top: none;
    padding-top: 0;
  }
  button[type="submit"] {
    width: 100%;
    margin-top: 10px;
  }
  .close-search-btn {
    display: block;
  }
  .header-search-btn {
    display: flex;
  }
}
.ad-banner-section .container {
  padding: 0; /* Konteyner paddingini sıfırla ki, şəkil tam görünsün */
}

/* Mobildə reklamın kənarlardan azca aralı qalması üçün */
@media (max-width: 768px) {
  .ad-banner-section .ad-box {
    border-radius: 12px;
  }
}

/* --- 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;
  }
}
