/**
 * GymDiet Master — Modern Profile Redesign (Dark Neon / OLED Obsidian)
 * Features:
 * - Dynamic Background Banner with instant photo upload
 * - Big bold display name & Unique @username
 * - 3 Columns Stat Row: Рост (см), Вес (кг), Возраст (лет)
 * - Thought status bubble ("Coffee or tea?")
 * - Circular avatar with neon glow and floating "+" upload button
 * - Clean "Активность" card
 * - Yandex ID / Yandex Mail authorization card
 */

/* ── Screen Container ── */
#screen-profile {
  background: #000000 !important;
  color: #ffffff;
  padding-bottom: 96px;
  min-height: 100vh;
}

#screen-profile .header {
  background: transparent !important;
  border-bottom: none !important;
  padding-left: 12px;
  padding-right: 12px;
  position: relative;
  z-index: 10;
}

/* ── Banner Container ── */
.profile-banner-container {
  position: relative;
  box-sizing: border-box !important;
  width: calc(100% - 24px) !important;
  max-width: 680px !important;
  margin: 8px auto 16px auto !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 240, 118, 0.22) !important;
  background-color: #050810 !important;
  min-height: 200px !important;
}

/* Default Starry Nebula Background */
.profile-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.35s ease;
  background-image: 
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(0, 240, 118, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.15) 0%, transparent 60%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.3) 0%, rgba(2, 4, 8, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23ffffff' fill-opacity='0.25'%3E%3Ccircle cx='20' cy='20' r='1.2'/%3E%3Ccircle cx='70' cy='35' r='1'/%3E%3Ccircle cx='130' cy='15' r='1.5'/%3E%3Ccircle cx='105' cy='65' r='1.2'/%3E%3Ccircle cx='45' cy='95' r='1'/%3E%3Ccircle cx='140' cy='110' r='1.3'/%3E%3Ccircle cx='25' cy='140' r='1.4'/%3E%3Ccircle cx='90' cy='145' r='1'/%3E%3Cpath d='M70 20 L71 22 L73 22 L71.5 23.2 L72 25 L70 23.8 L68 25 L68.5 23.2 L67 22 L69 22 Z' fill-opacity='0.4' fill='%23a78bfa'/%3E%3Cpath d='M135 75 L135.8 76.5 L137.5 76.5 L136.2 77.5 L136.7 79 L135 78 L133.3 79 L133.8 77.5 L132.5 76.5 L134.2 76.5 Z' fill-opacity='0.45' fill='%2338bdf8'/%3E%3C/g%3E%3C/svg%3E");
}

.profile-banner-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.75) 60%, rgba(0, 0, 0, 0.96) 100%);
  pointer-events: none;
}

/* Banner Edit Button (Top Right) */
.profile-banner-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-banner-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 15, 24, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 6px 12px;
  color: #f1f5f9;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-banner-change:hover {
  background: rgba(20, 30, 48, 0.9);
  border-color: rgba(0, 240, 118, 0.5);
  color: #00f076;
  transform: translateY(-1px);
}

.btn-banner-change:active {
  transform: scale(0.96);
}

/* Banner Content Area */
.profile-banner-content {
  position: relative;
  z-index: 4;
  padding: 56px 16px 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

/* ── Left Column: Name, Username, 3 Stats ── */
.profile-left-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Display Name */
.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.profile-display-name {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.6px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.profile-name-caret {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  font-size: 18px;
  transition: transform 0.2s, color 0.2s;
  user-select: none;
}

.profile-name-row:hover .profile-name-caret {
  color: #00f076;
  transform: translateY(2px);
}

/* Unique Username (@username) */
.profile-username-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  margin-bottom: 18px;
  cursor: pointer;
  align-self: flex-start;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.profile-username-row:hover {
  background: rgba(0, 240, 118, 0.1);
  border-color: rgba(0, 240, 118, 0.35);
}

.profile-username-at {
  color: #00f076;
  font-weight: 800;
  font-size: 14px;
}

.profile-unique-username {
  font-size: 13.5px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: -0.2px;
}

.profile-verified-badge {
  color: #00f076;
  flex-shrink: 0;
}

/* 3 Stat Columns Row (Following / Followers / Likes style) */
.profile-stats-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: flex-end !important;
  width: 100% !important;
  max-width: 280px !important;
  margin-top: 6px !important;
}

.profile-stat-col {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.profile-stat-col:hover {
  background: rgba(255, 255, 255, 0.06);
}

.profile-stat-col:active {
  transform: scale(0.96);
}

.profile-stat-number {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.5px;
}

.profile-stat-number span {
  font-size: 22px;
  font-weight: 900;
}

.profile-stat-unit {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 2px;
}

.profile-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── Right Column: Speech Bubble & Circular Avatar with "+" ── */
.profile-right-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

/* Speech / Thought Bubble */
.profile-speech-bubble {
  position: relative;
  background: rgba(18, 24, 38, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 7px 13px;
  margin-bottom: 10px;
  max-width: 145px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.profile-speech-bubble:hover {
  background: rgba(24, 34, 52, 0.98);
  border-color: rgba(0, 240, 118, 0.4);
  transform: translateY(-2px);
}

.profile-speech-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tail pointing down to avatar */
.profile-speech-tail {
  position: absolute !important;
  bottom: -6px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) rotate(45deg) !important;
  width: 10px !important;
  height: 10px !important;
  background: rgba(18, 24, 38, 0.95) !important;
  border-right: 1px solid rgba(0, 240, 118, 0.35) !important;
  border-bottom: 1px solid rgba(0, 240, 118, 0.35) !important;
}

/* Circular Avatar with Glowing Edge */
.profile-avatar-wrap {
  position: relative;
  width: 86px;
  height: 86px;
}

.profile-avatar-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #00f076;
  box-shadow: 0 0 20px rgba(0, 240, 118, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.8);
  background: #090d16;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-avatar-disc:hover {
  transform: scale(1.03);
  box-shadow: 0 0 26px rgba(0, 240, 118, 0.6);
}

.profile-avatar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #00f076;
}

.profile-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Floating "+" Badge Button (Bottom Right) */
.profile-avatar-plus-btn {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #00f076;
  color: #000000;
  border: 2.5px solid #000000;
  box-shadow: 0 0 10px rgba(0, 240, 118, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  z-index: 3;
}

.profile-avatar-plus-btn:hover {
  transform: scale(1.15) rotate(90deg);
  background: #17e682;
}

.profile-avatar-plus-btn:active {
  transform: scale(0.95);
}

/* ── Section «Активность» ── */
.profile-activity-card {
  box-sizing: border-box !important;
  width: calc(100% - 24px) !important;
  max-width: 680px !important;
  margin: 0 auto 24px auto !important;
  background: linear-gradient(135deg, rgba(14, 21, 33, 0.95) 0%, rgba(9, 13, 22, 0.98) 100%);
  border: 1px solid rgba(0, 240, 118, 0.25);
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-activity-card:hover {
  border-color: rgba(0, 240, 118, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 240, 118, 0.12);
}

.profile-activity-card:active {
  transform: scale(0.985);
}

.profile-activity-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(0, 240, 118, 0.12);
  border: 1px solid rgba(0, 240, 118, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00f076;
  flex-shrink: 0;
}

.profile-activity-content {
  flex: 1;
  min-width: 0;
}

.profile-activity-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.profile-activity-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #00f076;
}

.profile-activity-chip {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 240, 118, 0.15);
  color: #00f076;
  padding: 2px 8px;
  border-radius: 12px;
}

.profile-activity-value {
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.profile-activity-desc {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-activity-arrow {
  color: #64748b;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.profile-activity-card:hover .profile-activity-arrow {
  color: #00f076;
  transform: translateX(3px);
}

/* ── Section «Яндекс ID / Авторизация через Яндекс Почту» ── */
.profile-yandex-card {
  box-sizing: border-box !important;
  width: calc(100% - 24px) !important;
  max-width: 680px !important;
  margin: 0 auto 16px auto !important;
  background: linear-gradient(135deg, rgba(16, 22, 34, 0.95) 0%, rgba(10, 15, 24, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s;
}

.profile-yandex-card.is-connected {
  border-color: rgba(0, 240, 118, 0.35);
}

.yandex-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.yandex-brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(252, 63, 29, 0.25);
  flex-shrink: 0;
}

.yandex-red-letter {
  color: #fc3f1d;
  font-size: 22px;
  font-weight: 900;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1;
}

.yandex-card-title-wrap {
  flex: 1;
  min-width: 0;
}

.yandex-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.yandex-card-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.yandex-badge-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
}

.yandex-badge-tag.tag-offline {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}

.yandex-badge-tag.tag-connected {
  background: rgba(0, 240, 118, 0.15);
  color: #00f076;
}

/* Unauthorized state */
.btn-yandex-login-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fc3f1d;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(252, 63, 29, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-yandex-login-main:hover {
  background: #e03212;
  box-shadow: 0 8px 24px rgba(252, 63, 29, 0.5);
  transform: translateY(-1px);
}

.btn-yandex-login-main:active {
  transform: scale(0.985);
}

.yandex-white-disc {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: #fc3f1d;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.yandex-quick-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #64748b;
  font-size: 11px;
  margin: 14px 0 10px 0;
}

.yandex-quick-divider::before,
.yandex-quick-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.yandex-quick-divider span {
  padding: 0 10px;
}

.yandex-direct-row {
  display: flex;
  gap: 8px;
}

.yandex-email-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.yandex-email-input:focus {
  border-color: #00f076;
}

.btn-yandex-link-direct {
  background: rgba(0, 240, 118, 0.15);
  color: #00f076;
  border: 1px solid rgba(0, 240, 118, 0.35);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-yandex-link-direct:hover {
  background: #00f076;
  color: #000000;
}

/* Authorized state */
.yandex-connected-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 240, 118, 0.06);
  border: 1px solid rgba(0, 240, 118, 0.2);
}

.yandex-user-info {
  display: flex;
  flex-direction: column;
}

.yandex-user-email {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.yandex-user-status {
  font-size: 11px;
  color: #00f076;
  margin-top: 2px;
}

.btn-yandex-logout {
  background: rgba(255, 92, 122, 0.15);
  color: #ff5c7a;
  border: 1px solid rgba(255, 92, 122, 0.3);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-yandex-logout:hover {
  background: #ff5c7a;
  color: #ffffff;
}

/* ── Banner Presets Modal / Picker (Optional Quick Pick) ── */
.banner-presets-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.banner-preset-thumb {
  width: 48px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  background-size: cover;
}

.banner-preset-thumb.active {
  border-color: #00f076;
}

/* ── Symmetrical Equal Stat Columns ── */
.profile-stat-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  cursor: pointer !important;
  padding: 3px 0 !important;
  min-width: 0 !important;
}

.profile-stat-number {
  font-size: 20px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  line-height: 1.1 !important;
  letter-spacing: -0.3px !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 2px !important;
  white-space: nowrap !important;
}

.profile-stat-unit {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #00f076 !important;
  text-transform: uppercase !important;
}

.profile-stat-label {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  margin-top: 4px !important;
}

/* ── Avatar Circle Clean Display Overrides ── */
#screen-profile #profile-avatar,
#screen-profile #profile-avatar.has-image,
#screen-profile #profile-avatar:not(.has-image) {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  background: #080d17 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #00f076 !important;
  overflow: hidden !important;
}

#screen-profile #profile-avatar::before,
#screen-profile #profile-avatar::after {
  content: none !important;
  display: none !important;
}

#screen-profile #profile-avatar > * {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#screen-profile #profile-avatar img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

/* ── Section «Коллекция карточек & Недельный Бустер-Пак» ── */
.profile-cards-section {
  box-sizing: border-box !important;
  width: calc(100% - 24px) !important;
  max-width: 680px !important;
  margin: 0 auto 16px auto !important;
}

/* ── Section «Достижения» ── */
.profile-achievements-card {
  box-sizing: border-box !important;
  width: calc(100% - 24px) !important;
  max-width: 680px !important;
  margin: 0 auto 20px auto !important;
  background: linear-gradient(135deg, rgba(16, 22, 34, 0.95) 0%, rgba(10, 15, 24, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  padding: 18px !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5) !important;
  transition: border-color 0.2s;
}

.profile-achievements-card:hover {
  border-color: rgba(0, 240, 118, 0.3) !important;
}

.profile-achievements-card .progress-gradient {
  background: linear-gradient(90deg, #00f076 0%, #38bdf8 100%) !important;
}
