/* ====== PROFILE STYLES ====== */

.profile-modal {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: var(--z-modal);
    overflow-y: auto;
}

.profile-container {
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 80px;
}

.profile-cover {
    height: 200px;
    background: var(--bg-gradient);
    background-size: cover;
    background-position: center;
    position: relative;
}

.profile-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.3));
}

.profile-back-btn, .profile-settings-btn, .profile-more-btn, .cover-edit-btn {
    position: absolute;
    top: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.profile-back-btn { left: 16px; }
.profile-settings-btn, .profile-more-btn { right: 16px; }
.cover-edit-btn { right: 64px; }

.profile-info {
    padding: 0 20px;
    position: relative;
}

.profile-avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin: -50px auto 16px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.avatar-edit-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.verified-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: var(--pastel-blue);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
}

.profile-header {
    text-align: center;
    margin-bottom: 16px;
}

.profile-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 2px;
}

.profile-username {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.profile-title {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-badges {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge-admin, .badge-mod, .badge-vip {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 900;
    color: white;
}

.badge-admin { background: #EF4444; }
.badge-mod { background: #10B981; }
.badge-vip { background: var(--vip-gold); color: #4a3800; }

.profile-bio {
    text-align: center;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.profile-level {
    background: white;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.level-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.xp-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: var(--bg-gradient);
    transition: width 1s ease;
    border-radius: var(--radius-full);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
    cursor: pointer;
    padding: 4px 12px;
}

.stat-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.profile-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.profile-actions .btn-primary,
.profile-actions .btn-secondary {
    flex: 1;
    width: auto;
    margin: 0;
    padding: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.profile-actions .btn-primary.following {
    background: var(--bg-primary);
    color: var(--primary);
}

.btn-icon {
    width: 44px;
    height: 44px;
    background: white;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcased-achievements {
    background: white;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.showcase-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.showcase-list {
    display: flex;
    gap: 12px;
    justify-content: space-around;
}

.showcase-item {
    text-align: center;
}

.showcase-icon {
    font-size: 30px;
    margin-bottom: 4px;
}

.showcase-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-tabs {
    display: flex;
    gap: 4px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.ptab {
    flex: 1;
    padding: 10px 4px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ptab.active {
    background: var(--primary);
    color: white;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.video-thumb {
    aspect-ratio: 9/16;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumb-stats {
    position: absolute;
    bottom: 4px;
    left: 4px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 3px;
}

.empty-tab {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-tab .empty-icon {
    font-size: 50px;
    margin-bottom: 12px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.achievement-card {
    padding: 16px 8px;
    background: white;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement-card.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.achievement-icon {
    font-size: 40px;
    margin-bottom: 6px;
}

.achievement-name {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 2px;
}

.achievement-desc {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Settings */
.settings-modal, .edit-profile-modal, .achievement-detail-modal, .options-sheet, .user-list-modal, .analytics-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px 24px;
    max-width: 400px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

.settings-item:hover {
    background: var(--pastel-pink-light);
}

.settings-item i:first-child {
    width: 24px;
    text-align: center;
    color: var(--primary);
}

.settings-item span {
    flex: 1;
}

.settings-item.admin-setting {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
}

.settings-item.danger {
    color: #EF4444;
}

.settings-item.danger i:first-child {
    color: #EF4444;
}

.settings-version {
    text-align: center;
    color: var(--text-light);
    font-size: 11px;
    margin-top: 16px;
}

/* Achievement Unlock */
.achievement-unlock-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
}

.achievement-unlock-card {
    background: linear-gradient(135deg, #FFD700, #FF6B9D);
    padding: 40px 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    color: white;
    max-width: 350px;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.5);
}

.unlock-header {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 16px;
}

.unlock-icon {
    font-size: 80px;
    margin-bottom: 16px;
}

.unlock-name {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}

.unlock-desc {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.unlock-reward {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
    display: inline-block;
    font-weight: 800;
}

.achievement-unlock-card .btn-primary {
    background: white;
    color: var(--primary);
}

/* User List Items */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-list-item:hover {
    background: var(--pastel-pink-light);
}

.user-list-item img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.small-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Options Sheet */
.options-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
    margin: 0;
}

.option-item {
    padding: 16px;
    text-align: center;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.option-item.danger {
    color: #EF4444;
}

.viewers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.viewer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.viewer-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.viewer-name {
    font-weight: 700;
}

.viewer-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.analytics-card {
    background: var(--bg-primary);
    padding: 16px 8px;
    border-radius: var(--radius-md);
    text-align: center;
}

.anal-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.anal-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
}

.anal-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.analytics-details {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.analytics-details h3 {
    font-size: 14px;
    margin-bottom: 12px;
}

.earning-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.earning-item strong {
    color: var(--coin-gold);
}

.analytics-tip {
    background: var(--pastel-yellow-light);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    text-align: center;
}