/**
 * أنماط جدول الدول
 */

/* حاوية الجدول */
.countries-table-container {
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
  direction: rtl;
}

/* تخصيص شريط التمرير */
.countries-table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.countries-table-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.countries-table-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.countries-table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* جدول الدول */
.countries-table {
  width: 100%;
  border-collapse: collapse;
  color: white;
  font-size: 14px;
}

/* رأس الجدول */
.countries-table thead {
  position: sticky;
  top: 0;
  background-color: rgba(76, 29, 149, 0.9);
  z-index: 10;
}

.countries-table th {
  padding: 12px 15px;
  text-align: right;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.countries-table th:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* أيقونات الترتيب */
.sort-icon {
  margin-right: 5px;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.sort-active {
  opacity: 1;
}

/* صفوف الجدول */
.countries-table tbody tr {
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.countries-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* خلايا الجدول */
.countries-table td {
  padding: 10px 15px;
  text-align: right;
}

/* تمييز شركاء الشحن */
.shipping-partner {
  background-color: rgba(255, 193, 7, 0.2);
}

.shipping-partner td:first-child {
  position: relative;
}

.shipping-partner td:first-child::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background-color: #ffc107;
}

/* شريط البحث */
.countries-search-container {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 10px;
}

.countries-search-input {
  flex: 1;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: 'Tajawal', sans-serif;
  transition: all 0.3s ease;
}

.countries-search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.15);
}

.countries-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* عدد النتائج */
.countries-count {
  margin-right: 15px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* رسالة عدم وجود نتائج */
.no-results {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* تأثير تحميل الجدول */
.table-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  transition: opacity 0.5s ease;
}

.table-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* تصميم متجاوب */
@media (max-width: 768px) {
  .countries-table {
    font-size: 12px;
  }
  
  .countries-table th,
  .countries-table td {
    padding: 8px 10px;
  }
  
  .countries-search-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .countries-search-input {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .countries-count {
    margin-right: 0;
  }
}
