/* Выпадающее меню профиля — модульный дизайн, светлая тема */
.profile-menu-container {
  position: relative;
  display: inline-block;
}

.profile-menu-container .profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: #666;
  font-size: 18px;
  font-weight: 600;
}

.profile-menu-container .profile-avatar:hover {
  border-color: #0066FF;
  transform: scale(1.05);
}

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

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid #e5e5e5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1000;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-menu-container.active .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Модули — карточки со скруглениями */
.profile-dropdown .dropdown-module {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #eee;
}

/* Кредиты + прогресс-бар */
.profile-dropdown .credits-module {
  background: transparent;
  border: none;
  padding: 0 0 4px 0;
}

.profile-dropdown .credits-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.profile-dropdown .credits-label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.profile-dropdown .credits-arrow {
  font-size: 12px;
  color: #999;
  cursor: pointer;
}

.profile-dropdown .credits-bar {
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
}

.profile-dropdown .credits-bar-fill {
  height: 100%;
  background: #0066FF;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Карточка Go Premium */
.profile-dropdown .upgrade-card,
.profile-dropdown .boost-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-dropdown .module-icon {
  font-size: 18px;
  flex-shrink: 0;
  color: #0066FF;
}

.profile-dropdown .module-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.profile-dropdown .module-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: #0066FF;
  color: #fff;
  transition: background 0.2s, transform 0.1s;
}

.profile-dropdown .module-btn:hover {
  background: #0052cc;
  transform: scale(1.02);
}

/* Карточка пользователя */
.profile-dropdown .user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-dropdown .user-card-info {
  min-width: 0;
}

.profile-dropdown .user-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
  word-break: break-word;
}

.profile-dropdown .user-plan {
  font-size: 12px;
  color: #888;
}

.profile-dropdown .module-arrow {
  font-size: 14px;
  color: #999;
  flex-shrink: 0;
}

/* Блок ссылок — карточка как остальные модули */
.profile-dropdown .menu-links {
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-dropdown .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s;
  color: #333;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  border-radius: 10px;
  box-sizing: border-box;
}

.profile-dropdown .menu-item:hover {
  background: #eef1f5;
  color: #1a1a1a;
}

.profile-dropdown .menu-item.logout {
  color: #e53935;
}

.profile-dropdown .menu-item.logout:hover {
  background: #ffebee;
}

.profile-dropdown .item-icon {
  width: 20px;
  font-size: 16px;
  flex-shrink: 0;
}

.profile-dropdown .item-text {
  font-size: 14px;
}

/* Выход — отдельная закруглённая карточка как остальные модули */
.profile-dropdown .dropdown-footer {
  margin-top: 2px;
  padding: 6px 0 0 0;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 0;
}

.profile-dropdown .dropdown-footer .menu-item {
  padding: 12px 14px;
  border-radius: 12px;
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 999;
}

.menu-overlay.active {
  display: block;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .profile-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .profile-menu-container.active .profile-dropdown {
    transform: translateY(0);
  }

  .menu-overlay.active {
    background: rgba(0, 0, 0, 0.5);
  }
}
