/* style.css - نسخه نهایی */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', 'Tahoma', 'Segoe UI', sans-serif;
  background: #f5f7fa;
  padding: 10px;
  color: #1e293b;
  direction: rtl;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* ===== HEADER ===== */
header {
  text-align: center;
  margin-bottom: 15px;
}

header h1 {
  font-size: 1.6rem;
  color: #0f3b5e;
  font-weight: 900;
}

header p {
  color: #64748b;
  font-size: 0.9rem;
}

/* ===== دکمه جستجو ===== */
.search-toggle {
  text-align: center;
  margin-bottom: 12px;
}

.btn-search-toggle {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Vazirmatn', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-search-toggle:hover {
  background: #2563eb;
  transform: scale(1.02);
}

.btn-search-toggle.active {
  background: #ef4444;
}

.btn-search-toggle.active:hover {
  background: #dc2626;
}

/* ===== فیلترها ===== */
#filtersContainer {
    display: none;
    margin-bottom: 15px;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.filter-row input,
.filter-row select,
.filter-row button {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #fff;
    transition: all 0.2s;
    font-family: 'Vazirmatn', sans-serif;
    flex: 1;
    min-width: 140px;
}

.filter-row input:focus,
.filter-row select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.filter-row button {
    background: #e2e8f0;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #1e293b;
    flex: 0 1 auto;
    min-width: 100px;
}

.filter-row button:hover {
    background: #cbd5e1;
}

/* ===== آمار ===== */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  padding: 10px;
  background: #f1f5f9;
  border-radius: 12px;
}

.stat-item {
  background: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.stat-item strong {
  color: #0f3b5e;
}

/* ===== جدول ===== */
.table-wrapper {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #e9edf2;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#memberTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 500px;
}

#memberTable thead {
  background: #f1f5f9;
}

#memberTable th {
  padding: 10px 12px;
  text-align: right;
  font-weight: 700;
  color: #0f3b5e;
  border-bottom: 2px solid #d1d5db;
  white-space: nowrap;
  font-size: 0.8rem;
}

#memberTable td {
  padding: 10px 12px;
  border-bottom: 1px solid #e9edf2;
  vertical-align: middle;
  font-size: 0.8rem;
}

#memberTable tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

#memberTable tbody tr:hover {
  background: #f8fafc;
}

#memberTable tbody tr.active-row {
  background: #dbeafe;
}

/* ===== عکس‌ها ===== */
.thumb-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  display: block;
}

.no-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
}

.mobile-name .name-fa {
  font-weight: 600;
  color: #0f3b5e;
}

.mobile-name .name-en {
  font-size: 0.7rem;
  color: #94a3b8;
}

.badge-role {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: bold;
  background: #dbeafe;
  color: #1e40af;
  white-space: nowrap;
}

/* ===== مودال ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: sticky;
  top: 0;
  float: left;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #e2e8f0;
  transform: rotate(90deg);
}

.modal-content h2 {
  color: #0f3b5e;
  margin-bottom: 2px;
  font-size: 1.4rem;
  padding-left: 40px;
}

.modal-content .modal-en-name {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.modal-content .modal-detail {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 4px;
}

.modal-content .modal-detail:last-child {
  border-bottom: none;
}

.modal-content .modal-label {
  font-weight: 700;
  min-width: 100px;
  color: #475569;
  font-size: 0.85rem;
}

.modal-content .modal-value {
  color: #0f3b5e;
  font-size: 0.85rem;
  flex: 1;
}

.modal-photo-container {
  text-align: center;
  margin-bottom: 15px;
}

.modal-photo-container img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 12px;
  border: 3px solid #e2e8f0;
  object-fit: cover;
}

.no-photo-large {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #94a3b8;
  border: 3px solid #e2e8f0;
  margin: 0 auto;
}

.btn-download {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  transition: 0.2s;
  font-family: 'Vazirmatn', sans-serif;
}

.btn-download:hover {
  background: #2563eb;
  transform: scale(1.02);
}

/* ======================================== */
/* ===== موبایل ===== */
/* ======================================== */

@media (max-width: 768px) {
  .container { padding: 10px; border-radius: 12px; }
  header h1 { font-size: 1.3rem; }
  
  #filtersContainer .filters {
    padding: 12px;
    gap: 8px;
  }

  .filter-row {
    flex-direction: column;
    gap: 8px;
  }

  .filter-row input,
  .filter-row select,
  .filter-row button {
    flex: 1 1 100%;
    width: 100%;
    min-width: unset;
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .filter-row button {
    flex: 1 1 100%;
    width: 100%;
    min-width: unset;
  }

  .filter-row input[type="date"] {
    min-height: 44px;
  }

  .btn-search-toggle {
    font-size: 0.85rem;
    padding: 10px 20px;
    width: 100%;
    justify-content: center;
  }
  
  .stats { gap: 6px; padding: 8px; }
  .stat-item { font-size: 0.7rem; padding: 3px 10px; }
  
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #memberTable { font-size: 0.75rem; min-width: 400px; }
  #memberTable th, #memberTable td { padding: 6px 8px; }
  
  .thumb-photo { width: 28px !important; height: 28px !important; border-width: 1.5px; }
  .no-photo { width: 28px !important; height: 28px !important; font-size: 0.8rem; border-width: 1.5px; }
  
  #memberTable td:nth-child(2), #memberTable th:nth-child(2) {
    padding: 4px 6px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }
  
  .modal-content { padding: 16px; margin: 5px; max-height: 95vh; }
  .modal-content h2 { font-size: 1.2rem; padding-left: 35px; }
  .modal-content .modal-label { min-width: 80px; font-size: 0.75rem; }
  .modal-content .modal-value { font-size: 0.75rem; }
  .modal-close { width: 28px; height: 28px; font-size: 0.9rem; }
  .modal-photo-container img { max-width: 120px; max-height: 120px; border-width: 2px; }
  .no-photo-large { width: 80px; height: 80px; font-size: 2.5rem; border-width: 2px; }
}

@media (max-width: 480px) {
  body { padding: 5px; }
  .container { padding: 8px; border-radius: 10px; }
  header h1 { font-size: 1.1rem; }
  header p { font-size: 0.75rem; }
  
  #filtersContainer .filters { padding: 10px; gap: 6px; }
  .filter-row { gap: 6px; }
  .filter-row input, .filter-row select, .filter-row button {
    font-size: 0.8rem;
    padding: 8px 10px;
    border-radius: 8px;
  }
  .filter-row input[type="date"] { min-height: 38px; font-size: 0.75rem; }
  .btn-search-toggle { font-size: 0.8rem; padding: 8px 16px; }
  
  #memberTable { font-size: 0.65rem !important; min-width: 340px !important; }
  #memberTable th, #memberTable td { padding: 4px 5px !important; }
  
  .thumb-photo { width: 22px !important; height: 22px !important; border-width: 1px; }
  .no-photo { width: 22px !important; height: 22px !important; font-size: 0.6rem; border-width: 1px; }
  
  #memberTable td:nth-child(2), #memberTable th:nth-child(2) {
    padding: 2px 4px !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }
  
  .modal-content { padding: 12px; }
  .modal-content .modal-detail { padding: 5px 0; }
  .modal-content .modal-label { min-width: 60px; font-size: 0.7rem; }
  .modal-content .modal-value { font-size: 0.7rem; }
  .stat-item { font-size: 0.65rem; padding: 2px 8px; }
  .modal-photo-container img { max-width: 80px; max-height: 80px; }
  .no-photo-large { width: 60px; height: 60px; font-size: 2rem; }
  .btn-download { font-size: 0.75rem; padding: 8px 14px; }
}