/**
 * ErotikChat.one - Professional Users List Styles
 * Modern, Responsive, Premium Design
 */

:root {
  /* Colors */
  --primary: #E8175D;
  --primary-dark: #C4104A;
  --primary-light: #FF3672;
  --accent: #FF4D82;

  /* Backgrounds */
  --bg-light: #f7f3f0;
  --bg-lighter: #fff;
  --bg-surface: #f5f1ee;
  --bg-surface-alt: #ede8e4;

  /* Text */
  --text-primary: #18140f;
  --text-secondary: #46413c;
  --text-tertiary: #8c8680;
  --text-light: #c4bcb8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.13);
  --shadow-primary: 0 4px 20px rgba(232, 23, 93, 0.35);

  /* Borders */
  --border-light: rgba(0, 0, 0, 0.07);
  --border-lighter: rgba(0, 0, 0, 0.05);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

/* ════════════════════════════════════════════════════════ */
/* USERS LIST CONTAINER */
/* ════════════════════════════════════════════════════════ */

.users-list-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-light);
  overflow: hidden;
}

.users-list-header {
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: var(--shadow-md);
}

.users-list-header-title {
  font-size: 15px;
  font-weight: 900;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.users-list-header-count {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  margin-left: auto;
}

.users-list-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Scrollbar Styling */
.users-list-content::-webkit-scrollbar {
  width: 6px;
}

.users-list-content::-webkit-scrollbar-track {
  background: transparent;
}

.users-list-content::-webkit-scrollbar-thumb {
  background: var(--bg-surface-alt);
  border-radius: var(--radius-sm);
}

.users-list-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ════════════════════════════════════════════════════════ */
/* USER ITEM CARD */
/* ════════════════════════════════════════════════════════ */

.user-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  background: var(--bg-lighter);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.user-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(232, 23, 93, 0.05), rgba(255, 54, 114, 0.02));
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.user-item:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.user-item:hover::before {
  opacity: 1;
}

.user-item.selected {
  background: linear-gradient(135deg, rgba(232, 23, 93, 0.06), rgba(232, 23, 93, 0.02));
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.user-item.selected::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

/* ════════════════════════════════════════════════════════ */
/* AVATAR */
/* ════════════════════════════════════════════════════════ */

.user-avatar {
  position: relative;
  flex-shrink: 0;
}

.user-avatar-image {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-alt) 100%);
  border: 2px solid var(--border-light);
  box-shadow: var(--shadow-md);
}

.user-avatar-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2.5px solid var(--bg-lighter);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.45);
}

.user-avatar-status.offline {
  background: #ef4444;
}

/* ════════════════════════════════════════════════════════ */
/* USER INFO */
/* ════════════════════════════════════════════════════════ */

.user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.user-name {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-gender-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.user-gender-badge.female {
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
}

.user-gender-badge.male {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.user-gender-badge.divers {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.user-details {
  display: flex;
  gap: var(--spacing-lg);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.user-detail-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ════════════════════════════════════════════════════════ */
/* USER META */
/* ════════════════════════════════════════════════════════ */

.user-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-shrink: 0;
}

.user-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #d1fae5;
  color: #065f46;
  white-space: nowrap;
}

.user-status.idle {
  background: #fef3c7;
  color: #92400e;
}

.user-flag {
  width: 40px;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* ════════════════════════════════════════════════════════ */
/* EMPTY STATE */
/* ════════════════════════════════════════════════════════ */

.users-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-2xl);
  color: var(--text-tertiary);
  text-align: center;
  flex: 1;
}

.users-list-empty-icon {
  font-size: 48px;
  opacity: 0.2;
}

.users-list-empty-text {
  font-size: 14px;
  font-weight: 600;
}

.users-list-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: var(--spacing-2xl);
  color: var(--text-tertiary);
  font-weight: 600;
}

.users-list-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ════════════════════════════════════════════════════════ */
/* ANIMATIONS */
/* ════════════════════════════════════════════════════════ */

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.user-item {
  animation: fadeIn 0.4s ease both;
}

.user-item:nth-child(1) {
  animation-delay: 0s;
}
.user-item:nth-child(2) {
  animation-delay: 0.05s;
}
.user-item:nth-child(3) {
  animation-delay: 0.1s;
}
.user-item:nth-child(4) {
  animation-delay: 0.15s;
}
.user-item:nth-child(5) {
  animation-delay: 0.2s;
}

/* ════════════════════════════════════════════════════════ */
/* RESPONSIVE */
/* ════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .user-item {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
  }

  .user-avatar-image {
    width: 48px;
    height: 48px;
  }

  .user-name {
    font-size: 14px;
  }

  .user-details {
    font-size: 11px;
    gap: var(--spacing-md);
  }

  .user-flag {
    width: 36px;
    height: 25px;
  }
}

/* ════════════════════════════════════════════════════════ */
/* DARK MODE SUPPORT */
/* ════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root {
    --bg-light: #1a1410;
    --bg-lighter: #242018;
    --bg-surface: #2d2620;
    --bg-surface-alt: #36302a;
    --text-primary: #f7f3f0;
    --text-secondary: #e5ddd8;
    --text-tertiary: #a89d96;
    --text-light: #7f7a75;
    --border-light: rgba(255, 255, 255, 0.1);
  }

  .user-status {
    background: rgba(16, 185, 129, 0.15);
    color: #86efac;
  }
}

/* ════════════════════════════════════════════════════════ */
/* ACCESSIBILITY */
/* ════════════════════════════════════════════════════════ */

.user-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.user-item:active {
  transform: scale(0.98);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .user-item {
    animation: none;
    transition: none;
  }

  .user-item:hover {
    transform: none;
  }

  .users-list-spinner {
    animation: none;
  }
}
