/* profile.css - Perfect Neumorphism Profile Modal - Полностью адаптивный */
:root {
  /* Переменные из других файлов */
  --card-bg: var(--bg-secondary);
  --accent-color: var(--neu-primary);
  --accent-hover: var(--neu-primary-dark);
  --border-color: var(--border-light);
  --accent-rgb: 74, 108, 247;
  --secondary-color: var(--neu-text);
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ===== ОСНОВНЫЕ СТИЛИ МОДАЛКИ ===== */
.profile-modal {
  max-width: 800px;
  width: 95%;
  max-height: 90vh;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: auto;
}

/* ===== МЕДИА-ЗАПРОСЫ ДЛЯ АДАПТИВНОСТИ ===== */

/* Планшеты (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .profile-modal {
    max-width: 90%;
    width: 90%;
    max-height: 85vh;
  }
  
  .profile-header {
    padding: 20px;
    gap: 16px;
  }
  
  .profile-avatar {
    width: 90px;
    height: 90px;
    font-size: 36px;
  }
  
  .avatar-edit-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .profile-username {
    font-size: 22px;
  }
  
  .profile-nav-item {
    padding: 14px 12px;
  }
  
  .profile-content {
    padding: 20px;
  }
  
  .entity-item {
    padding: 14px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-item {
    padding: 14px;
  }
}

/* Мобильные устройства (320px - 768px) - ФУЛЛСКРИН */
@media (max-width: 768px) {
  .profile-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 16px;
  }
  
  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 32px;
    border-width: 3px;
  }
  
  .avatar-edit-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-width: 2px;
  }
  
  .profile-username {
    font-size: 20px;
  }
  
  .profile-name {
    font-size: 15px;
    margin-bottom: 10px;
  }
  
  .profile-bio {
    font-size: 13px;
    line-height: 1.5;
  }
  
  /* Оптимизация табов для мобильных */
  .profile-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .profile-nav-item {
    flex: 1 0 calc(33.333% - 4px);
    padding: 14px 8px;
    min-height: 44px; /* Оптимальный touch target */
  }
  
  .profile-nav-icon {
    font-size: 18px;
  }
  
  .profile-nav-label {
    font-size: 11px;
  }
  
  .profile-content {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
  }
  
  /* Оптимизация карточек */
  .entity-item {
    padding: 12px;
    min-height: 44px; /* Улучшение touch target */
  }
  
  .entity-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .entity-name {
    font-size: 14px;
  }
  
  .entity-members {
    font-size: 12px;
  }
  
  /* Адаптация статистики */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-item {
    padding: 14px;
  }
  
  /* Адаптация форм */
  .form-input, .form-textarea {
    padding: 12px 14px;
    font-size: 16px; /* Предотвращает масштабирование в iOS */
  }
  
  .form-group {
    gap: 6px;
  }
  
  /* Адаптация кнопок */
  .profile-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
  }
  
  .btn-profile {
    width: 100%;
    min-height: 44px;
    padding: 12px 20px;
  }
  
  /* Специальный класс для кнопки "Назад" на мобильных */
  .profile-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }
  
  .profile-back-btn:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-inset);
    transform: scale(0.98);
  }
  
  /* Фикс для sticky элементов на мобильных */
  .modal-header, .profile-nav {
    position: sticky;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-secondary-rgb, 255, 255, 255), 0.95);
  }
  
  [data-theme="dark"] .modal-header,
  [data-theme="dark"] .profile-nav {
    background: rgba(var(--bg-secondary-rgb, 30, 30, 30), 0.95);
  }
}

/* Малые мобильные (320px - 480px) */
@media (max-width: 480px) {
  .profile-nav-item {
    flex: 1 0 calc(50% - 4px);
    padding: 12px 6px;
  }
  
  .profile-nav-icon {
    font-size: 16px;
  }
  
  .profile-nav-label {
    font-size: 10px;
  }
  
  .profile-content {
    padding: 14px;
  }
  
  .profile-tab {
    padding: 16px;
  }
  
  .entity-item {
    padding: 10px 12px;
  }
  
  .entity-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  
  .entity-name {
    font-size: 13px;
  }
  
  .entity-members {
    font-size: 11px;
  }
  
  .section-title {
    font-size: 16px;
    margin-bottom: 14px;
  }
  
  .section-title-icon {
    font-size: 18px;
  }
  
  .form-input, .form-textarea {
    padding: 10px 12px;
  }
  
  .user-status-badge {
    padding: 4px 10px;
    font-size: 11px;
  }
  
  .profile-username-row {
    gap: 8px;
    justify-content: center;
    text-align: center;
  }
  
  .profile-user-info {
    width: 100%;
  }
}

/* Десктоп (1025px и выше) - оптимизация */
@media (min-width: 1025px) {
  .profile-modal {
    max-width: 850px;
  }
  
  .profile-header {
    padding: 28px 32px;
  }
  
  .profile-avatar {
    width: 110px;
    height: 110px;
    font-size: 44px;
  }
  
  .profile-username {
    font-size: 26px;
  }
  
  .profile-content {
    padding: 32px;
  }
  
  .profile-nav-item {
    padding: 18px 20px;
  }
  
  .profile-nav-icon {
    font-size: 22px;
  }
  
  .profile-nav-label {
    font-size: 13px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
  }
  
  .stat-item {
    padding: 20px;
  }
  
  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }
  
  .stat-value {
    font-size: 20px;
  }
}

/* Заголовок модалки - Perfect Neumorphism */
.profile-modal .modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.profile-modal .modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.profile-modal .close-modal {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  min-height: 44px; /* Оптимальный touch target */
}

.profile-modal .close-modal:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-inset);
  transform: scale(0.95);
  color: var(--text-primary);
}

.profile-modal .close-modal:active {
  box-shadow: var(--shadow-pressed);
  transform: scale(0.92);
}

/* ===== ШАПКА ПРОФИЛЯ - Neumorphism Design ===== */
.profile-header {
  padding: 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.profile-avatar-container {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--neu-text);
  background: linear-gradient(145deg, var(--neu-primary), var(--neu-primary-dark));
  overflow: hidden;
  border: 4px solid var(--bg-secondary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition-medium);
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  background: var(--neu-primary);
  color: var(--neu-text);
  border: 3px solid var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  min-height: 36px;
}

.avatar-edit-btn:hover {
  background: var(--neu-primary-dark);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.profile-user-info {
  flex: 1;
  min-width: 0;
}

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.profile-username {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  word-break: break-word;
  letter-spacing: -0.01em;
}

.user-status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  box-shadow: var(--shadow-sm);
  min-height: 24px;
}

/* Цвета статусов - Neumorphic */
.status-member { background: linear-gradient(145deg, #6b7280, #4b5563); color: white; }
.status-owner { background: linear-gradient(145deg, #f59e0b, #d97706); color: white; }
.status-admin { background: linear-gradient(145deg, #10b981, #059669); color: white; }
.status-superadmin { background: linear-gradient(145deg, #ef4444, #dc2626); color: white; }
.status-boss { background: linear-gradient(145deg, #8b5cf6, #7c3aed); color: white; }
.status-shop-pav { background: linear-gradient(145deg, #ec4899, #be185d); color: white; }
.status-shop-nat { background: linear-gradient(145deg, #14b8a6, #0d9488); color: white; }
.status-obm { background: linear-gradient(145deg, #3b82f6, #1d4ed8); color: white; }
.status-kadr { background: linear-gradient(145deg, #84cc16, #65a30d); color: white; }
.status-market { background: linear-gradient(145deg, #f97316, #ea580c); color: white; }
.status-forum { background: linear-gradient(145deg, #6366f1, #4f46e5); color: white; }

.profile-name {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  font-weight: 450;
}

.profile-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
  font-weight: 400;
}

/* ===== НАВИГАЦИЯ ВКЛАДОК - Neumorphism Design ===== */
.profile-nav {
  display: flex;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.profile-nav-item {
  flex: 1;
  padding: 16px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  position: relative;
  border-radius: 0;
  min-height: 44px; /* Оптимальный touch target */
}

.profile-nav-item:hover {
  color: var(--neu-primary);
  background: var(--bg-hover);
  box-shadow: var(--shadow-inset);
}

.profile-nav-item.active {
  color: var(--neu-primary);
}

.profile-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--neu-primary);
  border-radius: 3px 3px 0 0;
  box-shadow: var(--shadow-sm);
}

.profile-nav-icon {
  font-size: 20px;
}

.profile-nav-label {
  font-size: 12px;
  text-align: center;
}

.profile-nav-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--neu-primary);
}

/* ===== КОНТЕНТ ВКЛАДОК ===== */
.profile-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
  min-height: 300px;
  scroll-behavior: smooth;
}

.profile-content::-webkit-scrollbar {
  width: 6px;
}

.profile-content::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.profile-content::-webkit-scrollbar-thumb {
  background: var(--neu-shadow-dark);
  border-radius: 3px;
}

.profile-content::-webkit-scrollbar-thumb:hover {
  background: var(--neu-shadow-light);
}

.profile-tab {
  display: none;
  padding: 24px;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-tab.active {
  display: block;
}

@keyframes fadeIn {
  from { 
    opacity: 0;
    transform: translateY(10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ОБНОВЛЕННЫЕ СПИСКИ ЧАТОВ И КАНАЛОВ - Простой стиль ===== */
.entity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entity-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  min-height: 44px; /* Улучшение touch target */
}

.entity-item:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--neu-primary);
}

.entity-item:active {
  box-shadow: var(--shadow-pressed);
  transform: translateY(0);
}

.entity-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--neu-text);
  background: linear-gradient(145deg, var(--neu-primary), var(--neu-primary-dark));
  overflow: hidden;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-light);
}

.entity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-info {
  flex: 1;
  min-width: 0;
}

.entity-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  word-break: break-word;
}

.entity-members {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.entity-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

.entity-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
  background: var(--bg-tertiary);
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-sm);
}

.entity-empty p {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.entity-empty small {
  font-size: 13px;
  opacity: 0.7;
  font-weight: 400;
}

/* Заголовки разделов */
.profile-section {
  margin-bottom: 24px;
}

.profile-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.section-title-icon {
  font-size: 20px;
  color: var(--neu-primary);
}

.section-title-count {
  background: var(--neu-primary);
  color: var(--neu-text);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ===== ФОРМЫ РЕДАКТИРОВАНИЯ - Neumorphism Design ===== */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label-icon {
  color: var(--neu-primary);
}

.form-input {
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-inset);
  border: 1px solid transparent;
  font-weight: 450;
  min-height: 44px; /* Улучшение touch target */
}

.form-input:focus {
  outline: none;
  border-color: var(--neu-primary);
  box-shadow: 
    inset 3px 3px 6px var(--neu-shadow-dark),
    inset -3px -3px 6px var(--neu-shadow-light),
    0 0 0 3px rgba(74, 108, 247, 0.2);
}

.form-input[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-secondary);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
  min-height: 44px; /* Улучшение touch target */
}

/* Кнопки - Стили как в других файлах */
.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-profile {
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  height: 48px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  font-family: inherit;
  min-height: 44px; /* Оптимальный touch target */
}

.btn-profile-primary {
  background: linear-gradient(145deg, var(--neu-primary), var(--neu-primary-dark));
  color: var(--neu-text);
}

.btn-profile-primary:hover {
  background: linear-gradient(145deg, var(--neu-primary-dark), var(--neu-primary));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-profile-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-pressed);
}

.btn-profile-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-profile-secondary:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-inset);
  transform: translateY(-2px);
}

.btn-profile-secondary:active {
  box-shadow: var(--shadow-pressed);
  transform: translateY(0);
}

.btn-profile-danger {
  background: linear-gradient(145deg, #ef4444, #dc2626);
  color: white;
}

.btn-profile-danger:hover {
  background: linear-gradient(145deg, #dc2626, #ef4444);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-profile-danger:active {
  transform: translateY(0);
  box-shadow: var(--shadow-pressed);
}

.btn-profile:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Статистика - Neumorphism Design */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.stat-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--neu-primary);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--neu-primary), var(--neu-primary-dark));
  color: var(--neu-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Анимация появления модалки */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Загрузка */
.profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.profile-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--neu-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Скрытые элементы */
.hidden {
  display: none !important;
}

/* Тема */
[data-theme="dark"] .profile-modal {
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .form-input {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .form-input:focus {
  box-shadow: 
    inset 3px 3px 6px var(--neu-shadow-dark),
    inset -3px -3px 6px var(--neu-shadow-light),
    0 0 0 3px rgba(90, 125, 249, 0.2);
}

/* Специфичные стили для темной темы */
[data-theme="dark"] .entity-item:hover {
  border-color: var(--neu-primary);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--neu-primary);
}

[data-theme="dark"] .stat-item:hover {
  border-color: var(--neu-primary);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--neu-primary);
}

[data-theme="dark"] .profile-nav-item:hover {
  box-shadow: var(--shadow-inset);
}

[data-theme="dark"] .profile-nav-item.active::after {
  box-shadow: var(--shadow-sm);
}

.user-profile-modal .profile-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-profile {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-profile-primary {
    background: var(--accent-color);
    color: white;
}

.btn-profile-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.entity-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.entity-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Скрываем элемент, если нет имени */
.profile-name.hidden {
    display: none;
}

/* Стили для модалки аватара */
#avatarUrlInput:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

/* Анимация для превью аватара */
#avatarPreview {
    transition: all 0.3s ease;
}

#avatarPreview:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

/* Стили для сообщений об ошибках/успехе */
.avatar-validation {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.avatar-validation.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-left: 4px solid #ef4444;
    display: block;
}

.avatar-validation.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-left: 4px solid #22c55e;
    display: block;
}

/* Кнопка загрузки */
#saveAvatar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Подсказка для URL */
.url-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.url-hint::before {
    content: "💡";
    font-size: 14px;
}

.user-status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Фиксы для предотвращения горизонтального скролла */
@media (max-width: 768px) {
  * {
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  body, html {
    overflow-x: hidden;
  }
  
  .profile-modal {
    overflow-x: hidden;
  }
  
  .profile-content {
    overflow-x: hidden;
  }
}

/* Адаптивность для статуса пользователя */
@media (max-width: 768px) {
    .user-status {
        max-width: 140px;
    }
}

/* Дополнительные оптимизации для планшетов в портретной ориентации */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
  .profile-modal {
    max-width: 95%;
    width: 95%;
  }
  
  .profile-nav-item {
    padding: 12px 10px;
  }
  
  .profile-content {
    padding: 18px;
  }
}

/* Оптимизация для очень высоких экранов */
@media (min-height: 900px) and (min-width: 1025px) {
  .profile-modal {
    max-height: 80vh;
  }
  
  .profile-content {
    max-height: 60vh;
  }
}

/* Поддержка Hover на устройствах без hover */
@media (hover: none) {
  .profile-avatar:hover,
  .entity-item:hover,
  .stat-item:hover,
  .btn-profile:hover,
  .close-modal:hover,
  .avatar-edit-btn:hover,
  .profile-nav-item:hover {
    transform: none;
  }
  
  .entity-item:active,
  .btn-profile:active,
  .close-modal:active,
  .profile-nav-item:active {
    box-shadow: var(--shadow-pressed);
    transform: scale(0.98);
  }
}