:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --secondary: #00cec9;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #dfe6e9;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  direction: rtl;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 40px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  border-radius: 50% 50% 0 0;
}

header .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

header .logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
}

header h1 {
  font-size: 28px;
  font-weight: 800;
}

header .description {
  max-width: 700px;
  margin: 16px auto 0;
  font-size: 15px;
  line-height: 2;
  opacity: 0.9;
}

/* Search */
.search-section {
  max-width: 600px;
  margin: -10px auto 30px;
  position: relative;
  z-index: 2;
  padding: 0 20px;
}

.search-box {
  display: flex;
  gap: 10px;
  background: var(--card-bg);
  border-radius: 50px;
  box-shadow: var(--shadow);
  padding: 4px;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: 14px;
  border-radius: 50px;
  font-family: inherit;
  direction: rtl;
  background: transparent;
}

.search-box select {
  border: none;
  outline: none;
  padding: 14px 16px;
  font-size: 13px;
  border-radius: 50px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  min-width: 110px;
}

.search-box button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.search-box button:hover {
  background: var(--primary-dark);
}

.search-results-info {
  text-align: center;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-light);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
  font-weight: 800;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 20px;
}

.card-body h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.card-body .bio {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Profile Section */
.profile-section {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 20px 0;
  overflow: hidden;
}

.profile-section.active {
  display: block;
}

.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-header-info h2 {
  font-size: 26px;
  margin-bottom: 4px;
}

.profile-header-info .bio {
  font-size: 14px;
  opacity: 0.9;
}

.profile-body {
  padding: 30px 40px;
}

.profile-body .section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--primary);
  position: relative;
  padding-right: 16px;
}

.profile-body .section-title::before {
  content: '';
  position: absolute;
  right: 0;
  top: 6px;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.profile-body .section {
  margin-bottom: 28px;
}

.profile-body .biography-text {
  font-size: 14px;
  color: var(--text-light);
  line-height: 2;
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 13px;
}

/* Experiences */
.experience-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.experience-item:last-child {
  border-bottom: none;
}

.experience-item h4 {
  font-size: 15px;
  margin-bottom: 2px;
}

.experience-item .company {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.experience-item .date {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.experience-item p {
  font-size: 13px;
  color: var(--text-light);
}

/* Contacts */
.contacts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.contact-item .label {
  color: var(--text-light);
}

.contact-item .value {
  color: var(--primary);
  font-weight: 600;
}

/* Links */
.links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link-item {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-decoration: none;
  transition: background var(--transition);
}

.link-item:hover {
  background: var(--primary-dark);
}

/* Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
  margin-bottom: 16px;
}

.back-btn:hover {
  background: var(--border);
}

/* Main content states */
.main-content {
  display: block;
}

.main-content.hidden {
  display: none;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 15px;
}

/* Admin link */
.admin-link {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--card-bg);
  color: var(--text-light);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  text-decoration: none;
  box-shadow: var(--shadow);
  z-index: 100;
  transition: color var(--transition);
}

.admin-link:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  header { padding: 30px 0 40px; }
  header h1 { font-size: 22px; }
  header .description { font-size: 13px; }
  
  .search-box { flex-direction: column; border-radius: var(--radius); }
  .search-box input { border-radius: var(--radius); }
  .search-box select { border-radius: var(--radius); }
  .search-box button { border-radius: var(--radius); }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

  .profile-header { flex-direction: column; text-align: center; padding: 24px; }
  .profile-body { padding: 20px; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  header .logo { width: 60px; height: 60px; font-size: 28px; }
}

/* Admin Panel Styles */
.admin-body {
  direction: rtl;
  background: var(--bg);
}

.admin-panel {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 20px;
}

.admin-panel h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.admin-panel .subtitle {
  color: var(--text-light);
  margin-bottom: 30px;
  font-size: 14px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow);
}

.admin-tab {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--text-light);
  transition: all var(--transition);
}

.admin-tab.active {
  background: var(--primary);
  color: #fff;
}

.admin-section {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.admin-section.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: #e17055;
  color: #fff;
}

.btn-danger:hover {
  background: #d63031;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.member-admin-card .info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.member-admin-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
}

.member-admin-card .name {
  font-weight: 600;
}

.member-admin-card .actions {
  display: flex;
  gap: 8px;
}

.array-field {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.array-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.array-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.array-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.array-item input {
  flex: 1;
}
