/* Профиль */
.profile-container {
    padding: 16px;
}

/* Карточка профиля */
.profile-hero-card {
    position: relative;
    background: linear-gradient(165deg, var(--surface) 0%, var(--surface-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px 18px 18px;
    margin-bottom: 14px;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.profile-hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb, 147, 51, 234), 0.18), transparent 55%);
    pointer-events: none;
}

.profile-hero-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-light-rgb, 192, 132, 252), 0.6), transparent);
}

.profile-refresh-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.profile-refresh-btn svg {
    width: 18px;
    height: 18px;
}

.profile-refresh-btn:active {
    transform: scale(0.95);
    border-color: var(--primary);
    color: var(--primary-light);
}

.profile-hero-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.profile-hero-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 0 24px rgba(var(--primary-rgb, 147, 51, 234), 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--surface);
}

.profile-hero-letter {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-light);
    border: 3px solid var(--surface);
}

.profile-hero-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.profile-hero-handle {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.12);
    border: 1px solid rgba(var(--primary-rgb, 147, 51, 234), 0.25);
    border-radius: 20px;
    padding: 4px 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.profile-id-chip {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--background);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    text-align: left;
}

.profile-id-chip:active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.08);
}

.profile-id-chip-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.profile-id-chip-value {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-id-chip-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.profile-phone-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    width: 100%;
    max-width: 280px;
}

.profile-phone-link-btn {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb, 147, 51, 234), 0.35);
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.12);
    color: var(--primary-light);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.profile-phone-link-btn:active {
    transform: scale(0.98);
}

.profile-card {
    display: none;
}

.copy-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s;
}

.copy-icon:hover {
    opacity: 1;
}

.profile-refresh {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.profile-refresh:hover {
    background: var(--primary);
}

.profile-refresh:hover .refresh-icon {
    color: white;
}

.refresh-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    transition: all 0.2s;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.profile-grid-compact {
    grid-template-columns: repeat(2, 1fr);
}

.profile-balance-card {
    margin: 14px 0 6px;
    padding: 16px;
    border-radius: 20px;
    background:
        radial-gradient(ellipse 80% 70% at 100% 0%, rgba(251, 191, 36, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(var(--primary-rgb, 147, 51, 234), 0.2) 0%, transparent 50%),
        linear-gradient(145deg, var(--surface-elevated) 0%, var(--surface) 100%);
    border: 1px solid rgba(var(--primary-rgb, 147, 51, 234), 0.28);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.profile-balance-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.profile-balance-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fcd34d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-balance-icon svg {
    width: 22px;
    height: 22px;
}

.profile-balance-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-balance-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-balance-value {
    font-size: 24px;
    font-weight: 900;
    color: #fcd34d;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.profile-balance-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-balance-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-balance-available {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-balance-available strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-light);
}

.profile-balance-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(var(--primary-rgb, 147, 51, 234), 0.35);
}

.profile-balance-btn:active {
    transform: scale(0.97);
}

.profile-balance-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════════════════════════════════
   Меню профиля — premium cards
   ═══════════════════════════════════════════ */
.profile-menu {
    margin-top: 6px;
}

.profile-menu-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.profile-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-menu-card {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px;
    min-height: 148px;
    border: 1px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.profile-menu-card-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    transition: opacity 0.25s;
}

.profile-menu-card-referrals .profile-menu-card-bg {
    background:
        radial-gradient(ellipse 70% 80% at 100% 0%, rgba(var(--primary-rgb, 147, 51, 234), 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 50% 60% at 0% 100%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
        linear-gradient(145deg, #1e1035 0%, var(--surface) 45%, var(--surface-elevated) 100%);
}

.profile-menu-card-manager .profile-menu-card-bg {
    background:
        radial-gradient(ellipse 70% 80% at 100% 0%, rgba(99, 102, 241, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse 50% 60% at 0% 100%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        linear-gradient(145deg, #0f1729 0%, var(--surface) 45%, var(--surface-elevated) 100%);
}

.profile-menu-card-referrals {
    border-color: rgba(var(--primary-rgb, 147, 51, 234), 0.35);
}

.profile-menu-card-manager {
    border-color: rgba(99, 102, 241, 0.3);
}

.profile-menu-card-channel .profile-menu-card-bg {
    background:
        radial-gradient(ellipse 70% 80% at 100% 0%, rgba(45, 212, 191, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 50% 60% at 0% 100%, rgba(20, 184, 166, 0.15) 0%, transparent 50%),
        linear-gradient(145deg, #0d1f1c 0%, var(--surface) 45%, var(--surface-elevated) 100%);
}

.profile-menu-card-channel {
    border-color: rgba(45, 212, 191, 0.28);
}

.profile-menu-card-orb-teal {
    background: rgba(45, 212, 191, 0.28);
    animation-delay: -1.2s;
}

.profile-menu-card-orb {
    position: absolute;
    width: 100px;
    height: 100px;
    top: -30px;
    right: -20px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.25);
    filter: blur(30px);
    pointer-events: none;
    z-index: 0;
    animation: menuOrbPulse 5s ease-in-out infinite;
}

.profile-menu-card-orb-blue {
    background: rgba(99, 102, 241, 0.3);
    animation-delay: -2.5s;
}

@keyframes menuOrbPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.profile-menu-card:active {
    transform: scale(0.97);
}

.profile-menu-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.profile-menu-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.profile-menu-icon svg {
    width: 24px;
    height: 24px;
}

.profile-menu-icon-referrals {
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.25);
    border: 1px solid rgba(var(--primary-rgb, 147, 51, 234), 0.45);
    color: var(--primary-light);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb, 147, 51, 234), 0.3);
}

.profile-menu-icon-manager {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
}

.profile-menu-icon-channel {
    background: rgba(45, 212, 191, 0.18);
    border: 1px solid rgba(45, 212, 191, 0.38);
    color: #5eead4;
    box-shadow: 0 4px 20px rgba(45, 212, 191, 0.22);
}

.profile-menu-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.2);
    border: 1px solid rgba(var(--primary-rgb, 147, 51, 234), 0.4);
    color: var(--primary-light);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.profile-menu-pill-online {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.profile-menu-pill-online::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    margin-right: 5px;
    box-shadow: 0 0 8px #34d399;
    animation: onlineBlink 2s ease-in-out infinite;
}

.profile-menu-pill-channel {
    background: rgba(45, 212, 191, 0.14);
    border-color: rgba(45, 212, 191, 0.32);
    color: #5eead4;
}

@keyframes onlineBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.profile-menu-card-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.profile-menu-title {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.15;
}

.profile-menu-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.35;
}

.profile-menu-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-menu-stat {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.profile-menu-stat strong {
    font-size: 16px;
    font-weight: 900;
    color: var(--primary-light);
    margin-right: 4px;
}

.profile-menu-card-manager .profile-menu-stat strong {
    color: #a5b4fc;
}

.profile-menu-arrow {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.profile-menu-card:active .profile-menu-arrow {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.profile-menu-arrow svg {
    width: 16px;
    height: 16px;
}

/* Legacy action cards — hidden */
.profile-actions { display: none; }

.profile-grid-item {
    background: var(--surface);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: both;
}

.profile-grid-item:nth-child(1) { animation-delay: 0.1s; }
.profile-grid-item:nth-child(2) { animation-delay: 0.2s; }
.profile-grid-item:nth-child(3) { animation-delay: 0.3s; }
.profile-grid-item:nth-child(4) { animation-delay: 0.4s; }
.profile-grid-item:nth-child(5) { animation-delay: 0.5s; }

.profile-grid-item-large {
    grid-column: 1 / -1;
}

.profile-grid-item:active {
    transform: scale(0.95);
}

.grid-item-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
}

.grid-item-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.grid-item-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 8px;
}

.badge-green {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
}

.badge-blue {
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.15);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 147, 51, 234), 0.2);
}

.badge-faq {
    background: rgba(var(--primary-rgb, 147, 51, 234), 0.15);
    color: var(--primary);
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 147, 51, 234), 0.2);
}
