/* =========================================================
   AxisVPN Mini App - Isolated Profile Screen Design Elements
   ========================================================= */

.profile-screen-container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Upper Purple Hero Canvas */
.profile-purple-hero {
  background: linear-gradient(145deg, #1E1035 0%, #351368 45%, #5B21B6 100%);
  padding: calc(16px + var(--tg-total-safe-top, 0px)) 20px 62px 20px;
  border-radius: 0 0 32px 32px;
  box-shadow: 0 12px 36px -4px rgba(91, 33, 182, 0.28);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.profile-purple-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.25) 0%, rgba(109, 40, 217, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.profile-purple-hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, rgba(91, 33, 182, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Top Tab Name Header Label */
.profile-hero-top-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 12px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.14);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.profile-tag-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Centered User Info */
.profile-hero-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  position: relative;
  z-index: 2;
  margin-top: 4px;
}

.profile-avatar-purple {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(139, 92, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1.65rem;
  font-weight: 900;
  overflow: hidden;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-avatar-purple.with-img {
  padding: 0;
  background: #1E1035;
}

.profile-avatar-purple:hover {
  transform: scale(1.06);
}

.profile-hero-name {
  font-size: 1.32rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.profile-hero-handle {
  font-size: 0.84rem;
  color: #C4B5FD;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================
   OVERLAPPING STATS CARDS GRID (White Cards)
   ========================================================= */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: -36px 18px 18px 18px;
  position: relative;
  z-index: 10;
}

.profile-stat-card {
  background: 
    radial-gradient(circle at 90% 10%, rgba(124, 58, 237, 0.028) 0%, transparent 60%),
    linear-gradient(150deg, #FFFFFF 0%, #FDFBFF 70%, #FAF6FE 100%);
  border-radius: 18px;
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  box-shadow: 0 10px 24px -2px rgba(124, 58, 237, 0.035), 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(124, 58, 237, 0.06);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.profile-stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.16);
  box-shadow: 0 14px 28px rgba(109, 40, 217, 0.08);
}

.profile-stat-card:active {
  transform: scale(0.94);
}

.profile-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.profile-stat-val {
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  text-align: center;
}

.profile-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
}

/* Body Content Container */
.profile-body-content {
  padding: 0 18px 90px;
}

/* =========================================================
   INVITE FRIENDS BANNER (White Card)
   ========================================================= */
.profile-invite-banner {
  background: var(--surface-white);
  border-radius: 20px;
  padding: 16px 18px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
}

.profile-invite-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -2px rgba(109, 40, 217, 0.12);
}

.profile-invite-banner:active {
  transform: scale(0.97);
}

.profile-invite-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.profile-invite-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-frost-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-purple);
  flex-shrink: 0;
  border: 1px solid var(--border-brand);
}

.profile-invite-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-invite-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
}

.profile-invite-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.profile-invite-graphic {
  position: relative;
  z-index: 1;
}

/* =========================================================
   SETTINGS MENU CONTAINERS & ITEMS
   ========================================================= */
.profile-menu-container {
  background: var(--surface-white);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 16px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.18s ease;
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item:hover {
  background: rgba(109, 40, 217, 0.03);
}

.profile-menu-item:active {
  background: var(--surface-frost-purple);
}

.profile-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--surface-frost-purple);
  color: var(--brand-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(109, 40, 217, 0.12);
}

.profile-menu-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-menu-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-menu-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  background: var(--surface-frost-purple);
  color: var(--brand-purple);
  border: 1px solid var(--border-brand);
  letter-spacing: 0.2px;
  direction: ltr;
}

[data-theme="dark"] .profile-menu-badge {
  background: rgba(112, 38, 238, 0.18);
  color: #C4B5FD;
  border-color: rgba(112, 38, 238, 0.35);
}

.profile-menu-action-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.profile-menu-item:hover .profile-menu-action-btn {
  transform: translateX(-3px);
  color: var(--brand-purple);
}

/* =========================================================
   Dark Mode Profile Screen Overrides
   ========================================================= */
[data-theme="dark"] .profile-stat-card {
  background: 
    radial-gradient(circle at 90% 10%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
    linear-gradient(150deg, #1C1C24 0%, #17171F 70%, #13131A 100%);
  border: 1px solid rgba(124, 58, 237, 0.22);
  box-shadow: 0 10px 24px -2px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .profile-stat-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .profile-stat-val {
  color: #F1F5F9;
}

[data-theme="dark"] .profile-stat-lbl {
  color: #94A3B8;
}

[data-theme="dark"] .profile-invite-banner {
  background: var(--surface-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .profile-invite-banner:hover {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 12px 30px -2px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .profile-invite-title {
  color: #F1F5F9;
}

[data-theme="dark"] .profile-invite-sub {
  color: #94A3B8;
}

[data-theme="dark"] .profile-invite-icon-box {
  background: rgba(124, 58, 237, 0.16);
  color: #C4B5FD;
  border-color: rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .profile-menu-container {
  background: var(--surface-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .profile-menu-item {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .profile-menu-item:hover {
  background: rgba(124, 58, 237, 0.12);
}

[data-theme="dark"] .profile-menu-item:active {
  background: rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .profile-menu-icon {
  background: rgba(124, 58, 237, 0.16);
  color: #C4B5FD;
  border-color: rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .profile-menu-label {
  color: #F1F5F9;
}

[data-theme="dark"] .profile-menu-action-btn {
  color: #64748B;
}

[data-theme="dark"] .profile-menu-item:hover .profile-menu-action-btn {
  color: #C4B5FD;
}
