/* ======================================== */
/* СОВРЕМЕННЫЙ ПОЛЬЗОВАТЕЛЬСКИЙ ВИДЖЕТ 2025 */
/* ======================================== */

/* === ОСНОВНОЙ ВИДЖЕТ === */
.user-widget {
  position: relative;
  display: inline-block;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-width: 120px;
}

.user-trigger:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}

.user-trigger.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.02);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* === АВАТАР === */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* === ПОЛЬЗОВАТЕЛЬСКАЯ ИНФОРМАЦИЯ === */
.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.user-role {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1;
  margin: 0;
}

/* === ИНДИКАТОР СОСТОЯНИЯ === */
.user-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid white;
  position: absolute;
  bottom: 2px;
  right: 2px;
  animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === ВЫПАДАЮЩЕЕ МЕНЮ === */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* === ЗАГОЛОВОК МЕНЮ === */
.user-dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(248, 250, 252, 0.6);
}

.user-dropdown-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  overflow: hidden;
}

.user-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.user-dropdown-details h6 {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.125rem 0;
  font-size: 0.875rem;
}

.user-dropdown-details p {
  color: #6b7280;
  margin: 0;
  font-size: 0.75rem;
}

/* === СПИСОК МЕНЮ === */
.user-dropdown-list {
  padding: 0.5rem;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  color: #374151;
  text-decoration: none;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.user-dropdown-item:hover {
  background: #f3f4f6;
  color: #1f2937;
  text-decoration: none;
  transform: translateX(2px);
}

.user-dropdown-item:active {
  transform: translateX(1px) scale(0.98);
}

.user-dropdown-item.danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.user-dropdown-item i {
  width: 16px;
  text-align: center;
  color: #9ca3af;
  transition: color 0.15s ease;
}

.user-dropdown-item:hover i {
  color: #6b7280;
}

.user-dropdown-item.danger:hover i {
  color: #dc2626;
}

/* === РАЗДЕЛИТЕЛЬ === */
.user-dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 0.5rem 0;
  border: none;
}

/* === ПОДВАЛ МЕНЮ === */
.user-dropdown-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(248, 250, 252, 0.4);
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.theme-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #6b7280;
}

.theme-btn:hover {
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.12);
  color: #374151;
}

.theme-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* === BADGE/СТАТУС === */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.user-badge.executor {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.user-badge.customer {
  background: rgba(168, 85, 247, 0.1);
  color: #7c3aed;
}

.user-badge i {
  font-size: 0.625rem;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
  .user-dropdown {
    width: 260px;
    right: -1rem;
  }
  
  .user-trigger {
    min-width: auto;
  }
  
  .user-info {
    display: none;
  }
  
  .user-avatar {
    width: 36px;
    height: 36px;
  }
}

/* === АНИМАЦИЯ ПОЯВЛЕНИЯ === */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-dropdown.show {
  animation: slideInDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
