/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

/* ---------- OVERLAY ---------- */
.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
    will-change: transform, opacity;
}

.profile-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Ambient background */


/* Content wrapper */
.profile-overlay-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--bg-primary) 30%,
        var(--bg-primary) 100%
    );
}

/* ---------- TOP BAR ---------- */
.profile-top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: calc(var(--safe-top) + 8px) 16px 8px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.profile-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

.profile-back-btn:hover {
    background-color: var(--bg-hover);
}

.profile-back-btn:active {
    background-color: var(--bg-active);
}

.profile-back-btn .material-icons-round {
    font-size: 2rem;    color: var(--text-primary);
    pointer-events: none;
}

.profile-top-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ---------- SCROLLABLE CONTENT ---------- */
.profile-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 32px 24px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* ---------- PROFILE HEADER ---------- */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 0 24px 0;
    text-align: center;
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: .4rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #b71c1c 100%);
    flex-shrink: 0;
}

.profile-avatar-text {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.profile-username {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.profile-gender {
    font-size: 1.1rem;
    color: var(--text-tertiary);
}

.manage-account-link {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--accent-color);
    font-size: .9rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all var(--transition-fast);
}

.manage-account-link:hover {
    text-decoration: underline;
}

/* ---------- TOKEN BALANCE ---------- */
.profile-tokens {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--divider-color);
    border-radius: 12px;
    margin-bottom: 24px;
}

.tokens-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: var(--accent-light);
    flex-shrink: 0;
}

.tokens-icon .material-icons-round {
    font-size: 2rem;    color: var(--accent-color);
}

.tokens-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tokens-label {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.tokens-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tokens-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    cursor: pointer;
    color: #ffffff;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.tokens-add-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.tokens-add-btn:active {
    transform: scale(0.9);
}

.tokens-add-btn .material-icons-round {
    font-size: 2rem;    pointer-events: none;
}

/* ---------- NAVIGATION LIST ---------- */
.profile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 4px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--divider-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    font-family: 'Poppins', sans-serif;
}

.profile-nav-item:last-child {
    border-bottom: none;
}

.profile-nav-item:hover {
    background: var(--bg-surface-light);
}

.profile-nav-item:active {
    background: var(--bg-hover);
}

.profile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 8px;
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.profile-nav-icon .material-icons-round {
    font-size: 2rem;    color: var(--text-secondary);
    pointer-events: none;
}

.profile-nav-label {
    flex: 1;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: none;
}

.profile-nav-arrow-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.notification-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 600;
}

.profile-nav-arrow {
    font-size: 1.75rem;    color: var(--text-tertiary);
    pointer-events: none;
}

/* ---------- LEGAL LINKS ---------- */
.profile-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.legal-link {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    transition: color var(--transition-fast);
}

.legal-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.legal-separator {
    color: var(--text-disabled);
    font-size: 0.75rem;
}

/* ---------- DESKTOP LAYOUT ---------- */
@media (min-width: 711px) {
    .profile-scroll {
        /* max-width: 1000px; */
        margin: 0 auto;
        width: 100%;
        padding: 0 48px 32px 48px;
    }
    
    /* Header becomes horizontal tile */
    .profile-header {
        flex-direction: row;
        align-items: center;
        gap: 24px;
        padding: 48px 24px 32px 24px;
        text-align: left;
        background: transparent;
        border: none;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        min-width: 100px;
    }
    
    .profile-avatar-text {
        font-size: 3rem;
    }
    
    .profile-info {
        flex: 1;
        text-align: left;
    }
    
    .profile-name {
        font-size: 1.55rem;
    }
    
    .manage-account-link {
        flex-shrink: 0;
        align-self: center;
    }
    
    /* Token balance - wider */
    .profile-tokens {
        max-width: 100%;
        margin-bottom: 32px;
    }
    
    /* Navigation becomes grid */
    .profile-nav-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
        margin-bottom: 32px;
    }
    
    .profile-nav-item {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 24px 16px;
        background: var(--bg-surface);
        border: 1px solid var(--divider-color);
        border-radius: 12px;
        border-bottom: 1px solid var(--divider-color);
        text-align: center;
        position: relative;
        transition: all var(--transition-fast);
    }
    
    .profile-nav-item:hover {
        background: var(--bg-hover);
    }
    
    
    .profile-nav-icon {
        width: 56px;
        height: 56px;
        min-width: 56px;
        border-radius: 50%;
        background: var(--bg-elevated);
    }
    
    .profile-nav-icon .material-icons-round {
        font-size: 2.3rem;    }
    
    .profile-nav-label {
        text-align: center;
        font-size: 1.1rem;
    }
    
    .profile-nav-arrow-wrap {
        position: absolute;
        top: 12px;
        right: 12px;
    }
    
    .profile-nav-arrow {
        font-size: 1.625rem;    }
    
    /* Legal links */
    .profile-legal {
        padding: 24px 0;
    }
}

/* Tablet */
@media (min-width: 711px) and (max-width: 1024px) {
    .profile-scroll {
        padding: 0 1rem 32px 1rem;
    }
    
    .profile-nav-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- MOBILE RESPONSIVE ---------- */
@media (max-width: 710px) {
    .profile-scroll {
        padding: 0 .5rem 24px .5rem;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
    
    .profile-avatar-text {
        font-size: 2.5rem;
    }
    
    .profile-name {
        font-size: 1.4rem;
    }
    
    .profile-nav-item {
        padding: 12px 2px;
        gap: 12px;
    }
    
    .profile-nav-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    
    .profile-nav-icon .material-icons-round {
        font-size: 2rem;    }
    
    .profile-nav-label {
        font-size: 1.1rem;
    }
    
    .profile-tokens {
        padding: 12px;
        gap: 12px;
    }
    
    .tokens-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .tokens-count {
        font-size: 1.2rem;
    }
}

/* ============================================
   NOTIFICATION BADGE — hidden state + animation
   ============================================ */

.notification-badge[style*="display: none"] {
    display: none !important;
}

.notification-badge.pulse {
    animation: badge-pulse 0.4s ease;
}

@keyframes badge-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}