:root {
  --primary-color: #a8c45b;
  --secondary-color: #84b400;
  --dark-color: #2c3e50;
  --light-color: #f8f9fa;
  --gray-color: #6c757d;
  --border-radius: 12px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.main-section-auction {
  padding: 0px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* الهيدر */
.page-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-3px);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 5px;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-buttons {
  display: flex;
  gap: 15px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav-btn.primary {
  background: white;
  color: var(--secondary-color);
}

.nav-btn.primary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.nav-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.nav-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* قائمة الجوال */
.mobile-nav {
  display: none;
  background: white;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-top: 15px;
  overflow: hidden;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav-buttons {
  display: flex;
  flex-direction: column;
}

.mobile-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  text-decoration: none;
  color: var(--dark-color);
  border-bottom: 1px solid #eee;
  transition: var(--transition);
}

.mobile-nav-btn:hover {
  background: #f8f9fa;
  color: var(--secondary-color);
}

.mobile-nav-btn:last-child {
  border-bottom: none;
}

/* صندوق البحث والتصفية */
.search-box {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  margin: 30px 0;
  box-shadow: var(--box-shadow);
}

.search-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.search-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(168, 196, 91, 0.2);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-color);
}

.form-select {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: white;
  min-width: 180px;
  transition: var(--transition);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(168, 196, 91, 0.2);
}

/* الإحصائيات */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 25px 20px;
  text-align: center;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.stat-running {
  color: var(--primary-color);
}

.stat-upcoming {
  color: #ffc107;
}

.stat-ended {
  color: #6c757d;
}

.stat-sold {
  color: #28a745;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-label {
  color: var(--gray-color);
  font-size: 0.9rem;
}

/* العناوين */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.running-icon {
  color: var(--primary-color);
}

.upcoming-icon {
  color: #ffc107;
}

.ended-icon {
  color: #6c757d;
}

/* شبكة المزادات */
.auctions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.auction-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.auction-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.auction-image-container {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.auction-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
  transition: var(--transition);
}

.auction-card:hover .auction-image {
  transform: scale(1.05);
}

.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #f8f9fa;
  color: #adb5bd;
}

.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.status-running {
  background: var(--primary-color);
}

.status-upcoming {
  background: #ffc107;
}

.status-ended {
  background: #6c757d;
}

.timer-overlay,
.winner-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.winner-overlay {
  background: rgba(40, 167, 69, 0.8);
}

.auction-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.auction-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.auction-description {
  color: var(--gray-color);
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f8e9;
  color: var(--secondary-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 15px;
  width: fit-content;
}

.price-section {
  margin-bottom: 15px;
}

.current-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.start-price {
  font-size: 0.9rem;
  color: var(--gray-color);
}

.auction-stats {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--gray-color);
}

.auction-footer {
  padding: 15px 20px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.auction-btn {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary {
  background: var(--secondary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.btn-outline:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

/* حالة فارغة */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin: 40px 0;
}

.empty-icon {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.empty-state p {
  color: var(--gray-color);
}

/* الفوتر */
.footer {
  background: var(--dark-color);
  color: white;
  text-align: center;
  padding: 20px 0;
  margin-top: 60px;
}

/* التجاوب */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-buttons {
    display: none;
  }

  .search-row {
    flex-direction: column;
  }

  .search-input,
  .form-select {
    min-width: 100%;
  }

  .auctions-grid {
    grid-template-columns: 1fr;
  }

  .header-left {
    gap: 10px;
  }

  .page-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-title {
    font-size: 1.3rem;
  }
}

/* قسم المزادات في الصفحة الرئيسية */
.auctions-nav-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
  direction: rtl;
  position: relative;
}

.auctions-page-title {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 32px;
  font-weight: 700;
  color: var(--dark-color);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.auctions-page-title i {
  color: var(--primary-color);
  font-size: 28px;
}

.auctions-nav-buttons {
  display: flex;
  gap: 15px;
  margin-right: auto; /* لدفع الأزرار للطرف الآخر */
  margin-left: 50px; /* المسافة من اليسار */
}

.auctions-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  font-size: 16px;
}

.auctions-nav-btn.primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.auctions-nav-btn.primary:hover {
  background: #8ca548;
  border-color: #8ca548;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(168, 196, 91, 0.3);
}

.auctions-nav-btn.secondary {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.auctions-nav-btn.secondary:hover {
  background: #739c00;
  border-color: #739c00;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(132, 180, 0, 0.3);
}

.auctions-nav-btn i {
  font-size: 14px;
}

/* التجاوب مع الأجهزة المختلفة */
@media (max-width: 768px) {
  .auctions-nav-section {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 20px 0;
  }

  .auctions-page-title {
    position: static;
    transform: none;
    font-size: 28px;
    justify-content: center;
    order: 1;
  }

  .auctions-page-title i {
    font-size: 24px;
  }

  .auctions-nav-buttons {
    margin-right: 0;
    margin-left: 0; /* إزالة الـ margin في الموبايل */
    justify-content: center;
    flex-wrap: wrap;
    order: 2;
  }

  .auctions-nav-btn {
    padding: 10px 20px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .auctions-page-title {
    font-size: 24px;
  }

  .auctions-nav-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .auctions-nav-buttons {
    width: 100%;
    flex-direction: column;
  }
}
