/* Profile Page Styles */

.profile-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 32px 120px;
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 32px;
    background: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    margin-bottom: 24px;
}

.profile-header__avatar {
    position: relative;
    flex-shrink: 0;
}

.profile-header__avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #F1F5F9;
}

.profile-header__avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #F1F5F9;
}

.profile-header__avatar-placeholder i {
    font-size: 40px;
    color: #6366F1;
}

.profile-header__avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0F172A;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-header__avatar-edit:hover {
    background: #1E293B;
    transform: scale(1.1);
}

.profile-header__avatar-edit i {
    font-size: 14px;
}

.profile-header__info {
    flex: 1;
    min-width: 0;
}

.profile-header__username {
    font-size: 28px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 4px 0;
}

/* Admin wrapper next to username (global) */
.profile-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    font-size: 13px;
    color: #475569;
}

/* Admin badge icon (use challenge trophy color) */
.profile-admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(180deg,#fff,#FBFDFF);
    box-shadow: 0 6px 18px rgba(12,18,35,0.04);
    color: #F59E0B; /* same as trophy color */
    border: 1px solid rgba(245,158,11,0.12);
}
.profile-admin-badge i { font-size: 14px; color: #F59E0B; }

/* Visible label explaining admin status */
.profile-admin-label {
    font-weight: 600;
    color: #334155;
}

/* Small counter of created challenges (removed from UI) */
/* profile-admin-count removed globally (hidden) */
.profile-admin-count { display:none !important; }

/* Replace pseudo tooltip with explicit dropdown label shown on hover/focus */
.profile-admin { position: relative; }
/* Hide built-in pseudo-tooltip entirely */
.profile-admin[data-desc]::after,
.profile-admin[data-desc]::before { display: none !important; }

/* The visible label will only appear on hover / focus and above the badge */
.profile-admin-label {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(2,6,23,0.95);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(2,6,23,0.12);
    z-index: 60;
}
.profile-admin-label::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(2,6,23,0.95) transparent transparent transparent;
}

/* Show label on hover or focus (keyboard accessible) */
.profile-admin:hover .profile-admin-label,
.profile-admin:focus-within .profile-admin-label { display: block; }

/* Bump the badge size for better visibility (larger on all screens) */
.profile-admin-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}
.profile-admin-badge i { font-size: 20px; }

/* Responsive adjustments keep the badge prominent but not oversized */
@media (max-width: 900px) {
    .profile-admin-badge { width: 28px; height: 28px; border-radius: 6px; }
    .profile-admin-badge i { font-size: 14px; }
}

@media (max-width: 640px) {
    .profile-admin-badge { width: 24px; height: 24px; }
    .profile-admin-badge i { font-size: 12px; }
}

/* Hide the label on very small screens to save space */
@media (max-width: 480px) {
    .profile-admin-label { display: none; }
}

/* Responsive admin badge and label for different widths */
@media (max-width: 900px) {
    .profile-admin {
        gap: 6px;
        font-size: 12px;
    }
    /* Keep the admin badge comfortably large on tablets */
    .profile-admin-badge {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .profile-admin-badge i {
        font-size: 16px;
    }
    /* profile-admin-count removed */
}

@media (max-width: 640px) {
    .profile-admin {
        gap: 6px;
        font-size: 12px;
    }
    /* Increase badge on mobile for better tap target and visibility */
    .profile-admin-badge {
        width: 40px;
        height: 40px;
        border-radius: 9px;
    }
    .profile-admin-badge i {
        font-size: 18px;
    }
    /* profile-admin-count removed */
}

.profile-header__email {
    font-size: 14px;
    color: #64748B;
    margin: 0 0 8px 0;
}

.profile-header__bio {
    font-size: 15px;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

/* Follow line (inline counts under joined date) */
.profile-header__follow-line a { color: #475569; text-decoration: none; margin-right: 12px; }
.profile-header__follow-line a span { font-weight:700; color:#0F172A; margin-left:6px; }
.profile-header__follow-line a:hover { text-decoration: underline; color: #0F172A; }

.profile-header__actions {
    flex-shrink: 0;
}

.profile-header__actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #334155;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-header__actions .btn-secondary:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

/* Stats Cards */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: #E2E8F0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #F0F9FF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card__icon i {
    font-size: 24px;
    color: #0EA5E9;
}

.stat-card__icon--votes {
    background: #FEF2F2;
}

.stat-card__icon--votes i {
    color: #EF4444;
}

.stat-card__icon--challenges {
    background: #FEF3C7;
}

.stat-card__icon--challenges i {
    color: #F59E0B;
}

.stat-card__icon--active {
    background: #F0FDF4;
}

.stat-card__icon--active i {
    color: #22C55E;
}

.stat-card__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-card__value {
    font-size: 24px;
    font-weight: 700;
    color: #0F172A;
}

.stat-card__label {
    font-size: 13px;
    color: #64748B;
}

/* Subscriptions modal and list */
.subscriptions-list { display: flex; flex-direction: column; gap: 12px; }
.subscription-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; border: 1px solid #F1F5F9; background: #fff; justify-content: space-between; }
.subscription-item__left { display:flex; align-items:center; gap:12px; }

/* Follow button inside subscriptions modal */
.subscriptions-list .user-follow-btn, .subscription-item .user-follow-btn { background:#0F172A; color:#fff; border:none; padding:8px 12px; border-radius:8px; cursor:pointer; font-weight:600; }
.subscriptions-list .user-follow-btn[disabled], .subscription-item .user-follow-btn[disabled] { opacity:0.6; cursor:not-allowed; }
.subscription-avatar { width:44px; height:44px; border-radius:50%; object-fit:cover; border:1px solid #E6EEF8; }
.subscription-avatar-icon { width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; background:#fff; border:1px solid #E6EEF8; color:#0F172A; font-size:20px; }
.subscription-meta a { font-weight:600; color:#0F172A; text-decoration:none; }
.subscription-bio { color:#64748B; font-size:13px; margin-top:4px; }

/* Make stat-card clickable visually obvious */
.stat-card--clickable { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.stat-card--clickable:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(2,6,23,0.06); }

/* Modal show shorthand (reuses existing modal styles) */
.create-modal.show { transform: translateY(0%); opacity: 1; }
.modal-overlay.show { display:block; opacity: 0.65; }

/* Tabs */
.profile-tabs {
    background: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    overflow: hidden;
}

.profile-tabs__nav {
    display: flex;
    border-bottom: 1px solid #F1F5F9;
    padding: 0 8px;
}

.profile-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.profile-tab:hover {
    color: #334155;
}

.profile-tab.active {
    color: #0F172A;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #0F172A;
    border-radius: 2px 2px 0 0;
}

.profile-tab i {
    font-size: 18px;
}

.profile-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #F1F5F9;
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
}

.profile-tab.active .profile-tab__count {
    background: #0F172A;
    color: #FFFFFF;
}

/* Tab Content */
.profile-tab-content {
    display: none;
    padding: 24px;
}

.profile-tab-content.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state > i {
    font-size: 48px;
    color: #CBD5E1;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #64748B;
    margin: 0 0 20px 0;
}

.empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    background: #0F172A;
    color: #FFFFFF;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-state .btn-primary i {
    font-size: 16px;
    color: #FFFFFF;
    margin-bottom: 0;
    display: inline;
}

.empty-state .btn-primary:hover {
    background: #1E293B;
}

/* Submissions Grid */
.submissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.submission-card-profile {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.submission-card-profile:hover {
    border-color: #CBD5E1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.submission-card-profile--past {
    opacity: 0.8;
}

.submission-card-profile__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.submission-card-profile__platform {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.submission-card-profile__platform--tiktok {
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
}

.submission-card-profile__platform--instagram-reels,
.submission-card-profile__platform--instagram-video {
    background: linear-gradient(135deg, rgba(245, 133, 41, 0.12), rgba(221, 42, 123, 0.12));
    color: #DD2A7B;
}

.submission-card-profile__platform--youtube-shorts,
.submission-card-profile__platform--youtube {
    background: rgba(255, 0, 0, 0.08);
    color: #DC2626;
}

.submission-card-profile__platform--facebook {
    background: rgba(24, 119, 242, 0.08);
    color: #1877F2;
}

.submission-card-profile__countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #22C55E;
}

.submission-card-profile__countdown i {
    font-size: 14px;
}

.submission-card-profile__status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.submission-card-profile__status--ended {
    background: #F1F5F9;
    color: #64748B;
}

.submission-card-profile__title {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.submission-card-profile__challenge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748B;
    text-decoration: none;
    margin-bottom: 14px;
    transition: color 0.2s ease;
}

.submission-card-profile__challenge:hover {
    color: #6366F1;
}

.submission-card-profile__challenge i {
    font-size: 14px;
    color: #F59E0B;
}

.submission-card-profile__prize {
    margin-left: auto;
    font-weight: 600;
    color: #0F172A;
}

.submission-card-profile__stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #F1F5F9;
}

.submission-card-profile__votes {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #EF4444;
}

.submission-card-profile__votes i {
    font-size: 16px;
}

.submission-card-profile__date {
    font-size: 13px;
    color: #94A3B8;
}

.btn-view-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #0F172A;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-view-small:hover {
    background: #1E293B;
}

/* Challenges Grid */
.challenges-grid-profile {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.challenge-card-profile {
    position: relative;
    background: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.challenge-card-profile:hover {
    border-color: #E2E8F0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.challenge-card-profile__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.challenge-card-profile .challenge-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #F8FAFC 0%, #E5E7EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.challenge-card-profile .challenge-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.challenge-card-profile:hover .challenge-image img {
    transform: scale(1.05);
}

.challenge-card-profile .challenge-prize {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #0F172A;
    color: #FFFFFF;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
    z-index: 1;
}

.challenge-card-profile .verified-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 1;
}

.challenge-card-profile .verified-badge i {
    font-size: 13px;
}

.challenge-content-profile {
    padding: 20px;
    min-width: 0;
}

.challenge-card-profile__delete {
    position: absolute;
    bottom: 178px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #FEE2E2;
    background: rgba(254, 242, 242, 0.95);
    color: #DC2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.challenge-card-profile__delete:hover {
    background: #DC2626;
    border-color: #DC2626;
    color: #FFFFFF;
    transform: scale(1.1);
}

.challenge-card-profile__delete i {
    font-size: 16px;
}

.challenge-card-profile--ended {
    opacity: 0.75;
}

.challenge-card-profile .challenge-title {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
    margin: 0 0 8px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.challenge-card-profile .challenge-desc {
    font-size: 13px;
    color: #64748B;
    line-height: 1.5;
    margin: 0 0 12px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.challenge-card-profile .challenge-platforms {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.challenge-card-profile .platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 16px;
    transition: all 0.15s ease;
}

.challenge-card-profile .platform-icon:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
    transform: scale(1.1);
}

.challenge-card-profile .platform-more {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.challenge-card-profile .platform-more:hover {
    background: #6366F1;
    border-color: #6366F1;
    color: #FFFFFF;
    transform: scale(1.1);
}

.challenge-card-profile .challenge-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #64748B;
}

.challenge-card-profile .challenge-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.challenge-card-profile .challenge-meta i {
    font-size: 14px;
}

/* Edit Profile Form */
.edit-profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.form-group input,
.form-group textarea {
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-hint i {
    font-size: 14px;
}

.form-hint-inline {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 400;
}

.input-disabled {
    background-color: #F8FAFC !important;
    color: #64748B !important;
    cursor: not-allowed !important;
    border-color: #E2E8F0 !important;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

    /* Toggle switch */
    .switch {
        position: relative;
        display: inline-block;
        width: 46px;
        height: 26px;
    }

    .switch-input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
        left: 0;
        top: 0;
    }

    .switch-slider {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #E5E7EB;
        border-radius: 999px;
        transition: background .18s ease;
    }

    .switch-slider::before {
        content: '';
        position: absolute;
        left: 3px;
        top: 3px;
        height: 20px;
        width: 20px;
        background: #FFFFFF;
        border-radius: 50%;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        transition: transform .18s cubic-bezier(.4,0,.2,1);
    }

    .switch-input:checked + .switch-slider {
        background: #10B981;
    }

    .switch-input:checked + .switch-slider::before {
        transform: translateX(20px);
    }

    .switch-input:focus + .switch-slider {
        box-shadow: 0 0 0 4px rgba(16,185,129,0.12);
    }

    /* Make switch clearly clickable */
    .switch, .switch-slider { cursor: pointer; }

    .form-group--email-toggle .email-toggle-row { display:flex; align-items:center; gap:12px; }

    /* Small state label spacing */
    #edit-show-email-state { margin-left: 6px; }

    /* Icon-only share button */
    .btn-icon {
        padding: 8px;
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile: smaller actions and move share button a bit closer */
    @media (max-width: 768px) {
        .profile-header {
            padding: 20px;
            gap: 12px;
        }
        .profile-header__avatar img {
            width: 72px;
            height: 72px;
        }
        .profile-header__username { font-size: 20px; }
        .profile-header__actions { margin-top: 8px; align-self: flex-start; }
        .btn-icon { width: 38px; height: 38px; padding: 6px; }

        /* Inline share button next to username for public profiles */
        .profile-share-inline {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-left: 10px;
            padding: 8px;
            width: 40px;
            height: 40px;
            border-radius: 8px;
        }

        /* Mobile: center actions and username text */
        .profile-header__actions {
            margin-top: 12px;
            align-self: center;
            display: flex;
            justify-content: center;
            gap: 8px;
            width: 100%;
        }
        .profile-header__info { text-align: center; }

        /* Profile header card: subtle background and padding for a cleaner look */
        .profile-header {
            background: #ffffff;
            border: 1px solid #EEF2F7;
            border-radius: 14px;
            padding: 26px 28px;
            box-shadow: 0 8px 30px rgba(2,6,23,0.04);
            align-items: center;
            gap: 22px;
            margin-bottom: 18px;
        }

        .profile-header__info { text-align: center; }
        .profile-header__username { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 6px; }

        /* Profile tags container (renders under "Membre depuis") */
        .profile-tags--container {
            display: flex;
            gap: 10px;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 10px;
            width: 100%;
        }

        /* Modern pill chips */
        .profile-tags--container .tag-chip {
            padding: 6px 12px;
            font-weight: 700;
            font-size: 13px;
            background: linear-gradient(180deg, #ffffff, #FBFDFF);
            border: 0;
            color: #0F172A;
            box-shadow: 0 6px 18px rgba(12,18,35,0.04);
            border-radius: 999px;
            display: inline-flex;
            gap: 8px;
            align-items: center;
            transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
        }

        .profile-tags--container .tag-chip i { font-size: 14px; margin-right: 6px; opacity: 0.95; }
        .profile-tags--container .tag-chip .tag-label { font-weight: 700; color: inherit; }

        .profile-tags--container .tag-chip:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(12,18,35,0.08); }

        /* Badge palettes (simple, distinct) */
        .tag-chip--nouveau { background: linear-gradient(90deg,#FDE68A,#FEEBC8); color: #92400E; }
        .tag-chip--premier-defi { background: linear-gradient(90deg,#DFF3FF,#E6F6FF); color:#0369A1; }
        .tag-chip--auteur { background: linear-gradient(90deg,#E9D5FF,#F0ABFC); color:#5B21B6; }
        .tag-chip--premiere-participation { background: linear-gradient(90deg,#FFF6EB,#FFF1E6); color:#92400E; }
        .tag-chip--premier-vote { background: linear-gradient(90deg,#FFE4E6,#FFDDE0); color:#B91C1C; }
        .tag-chip--premiere-victoire { background: linear-gradient(90deg,#FFF7ED,#FFF1E6); color:#B45309; }
        .tag-chip--veteran { background: linear-gradient(90deg,#E8FDF5,#DFFCF0); color:#065F46; }
        .tag-chip--assidu { background: linear-gradient(90deg,#ECFDF5,#DCFBDE); color:#047857; }
        .tag-chip--top-createur { background: linear-gradient(90deg,#FEF3C7,#FDE68A); color:#92400E; }
        .tag-chip--multi-victoire { background: linear-gradient(90deg,#FEF0FF,#FDE8FF); color:#7C3AED; }
        .tag-chip--populaire { background: linear-gradient(90deg,#FFF1F2,#FFE4E6); color:#991B1B; }

        /* Inactive state remains muted */
        .profile-tags--container .tag-chip.tag-chip--inactive { opacity: 0.46; filter: grayscale(60%); transform: none; box-shadow: none; }

        /* Wrapper for badges between header and stats */
        .profile-badges-wrapper {
            display: flex;
            justify-content: center;
            width: 100%;
            margin: 0 0 22px;
            padding: 12px 12px 18px; /* space for separator + chips */
            position: relative;
            background: transparent;
        }
        /* subtle separator line above badges */
        .profile-badges-wrapper::before {
            content: '';
            position: absolute;
            top: 6px;
            left: 12px;
            right: 12px;
            height: 1px;
            background: #EEF2F7;
            border-radius: 2px;
            z-index: 1;
        }
        .profile-badges-wrapper .profile-tags--container {
            max-width: 920px;
            justify-content: center;
            gap: 12px;
            z-index: 2; /* place above separator */
        }

        /* Ensure .profile-tags fallback shares the same layout/appearance on all screens */
        .profile-tags, .profile-tags--container, .profile-badges-wrapper .profile-tags {
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* Force consistent chip styling across any selector */
        .profile-tags .tag-chip, .profile-tags--container .tag-chip, .profile-badges-wrapper .tag-chip {
            padding: 6px 12px;
            font-weight: 700;
            font-size: 13px;
            background: linear-gradient(180deg, #ffffff, #FBFDFF);
            border: 0;
            color: #0F172A;
            box-shadow: 0 6px 18px rgba(12,18,35,0.04);
            border-radius: 999px;
            display: inline-flex;
            gap: 8px;
            align-items: center;
            transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
        }

        /* small screens adjustments */
        @media (max-width: 640px) {
            .profile-header { padding: 18px; }
            .profile-header__username { font-size: 18px; }
            .profile-tags--container .tag-chip { padding: 5px 10px; font-size: 12px; }
        }

        /* Fallback: style .profile-tags if rendered elsewhere or accidentally left in the H1 */
        .profile-tags {
            display: flex;
            gap: 10px;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 10px;
        }
        .profile-tags .tag-chip {
            padding: 6px 12px;
            font-weight: 700;
            font-size: 13px;
            background: linear-gradient(180deg, #ffffff, #FBFDFF);
            border: 0;
            color: #0F172A;
            box-shadow: 0 6px 18px rgba(12,18,35,0.04);
            border-radius: 999px;
            display: inline-flex;
            gap: 8px;
            align-items: center;
        }

        /* If badges are still inside the h1, hide them to avoid duplicate messy rendering */
        .profile-header__username .profile-tags { display: none !important; }

        /* Style improvements: more original chips */
        .profile-tags--container .tag-chip {
            background: linear-gradient(180deg, #fff, #FBFDFF);
            border: 1px solid rgba(10,20,40,0.06);
            box-shadow: 0 6px 18px rgba(12,18,35,0.04);
            padding: 6px 12px;
            border-radius: 999px;
            display: inline-flex;
            gap: 8px;
            align-items: center;
            transition: transform .12s ease, box-shadow .12s ease;
        }
        .profile-tags--container .tag-chip:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(12,18,35,0.08); }
        .profile-tags--container .tag-chip i { color: #0F172A; opacity: 0.9; }

        /* Badge modal */
        .badge-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 60; }
        .modal-overlay#badgeModalOverlay.show { display:block; position: fixed; inset:0; z-index:50; background: rgba(2,6,23,0.45); }
        .badge-modal.show { display:flex; }
        .badge-modal__inner { background: #fff; padding: 20px; border-radius: 12px; width: 90%; max-width: 420px; box-shadow: 0 20px 50px rgba(2,6,23,0.2); position: relative; }
        .badge-modal__header { display:flex; gap:12px; align-items:center; }
        .badge-modal__icon { font-size: 22px; color: #F59E0B; }
        .badge-modal__close { position:absolute; right:10px; top:10px; border:0; background:transparent; cursor:pointer; color:#64748B; }
        .badge-modal__body { margin-top:12px; color:#334155; font-size:14px; line-height:1.4; }



    }

/* Challenge filter buttons (global) — consistent on all breakpoints */
.challenges-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: flex-start; /* left-align on larger screens */
}

.filter-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease, transform 0.12s ease;
    font-size: 13px;
    box-shadow: 0 6px 18px rgba(12,18,35,0.04);
}

.filter-btn:hover { transform: translateY(-2px); }

.filter-btn.active {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
    box-shadow: 0 10px 24px rgba(99,102,241,0.12);
}

/* Small-screen tweak: center filters on mobile */
@media (max-width: 768px) {
    .challenges-filters { justify-content: center; }
}

.form-divider span {
    font-size: 13px;
    color: #64748B;
    white-space: nowrap;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-feedback {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-feedback.success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.form-feedback.error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid #F1F5F9;
}

.form-actions .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #334155;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .btn-secondary:hover {
    background: #F8FAFC;
}

.form-actions .btn-primary {
    padding: 10px 24px;
    border-radius: 8px;
    background: #0F172A;
    color: #FFFFFF;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .btn-primary:hover {
    background: #1E293B;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-page {
        padding: 32px 16px 80px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 24px 20px;
    }
    
    .profile-header__avatar img,
    .profile-header__avatar-placeholder {
        width: 80px;
        height: 80px;
    }
    
    .profile-header__avatar-placeholder i {
        font-size: 32px;
    }
    
    .profile-header__username {
        font-size: 22px;
    }
    
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
        gap: 12px;
    }
    
    .stat-card__icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-card__icon i {
        font-size: 20px;
    }
    
    .stat-card__value {
        font-size: 20px;
    }
    
    .profile-tabs__nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
    }
    
    .profile-tab {
        padding: 14px 16px;
        white-space: nowrap;
        font-size: 13px;
    }
    
    .profile-tab i {
        display: none;
    }
    
    .profile-tab-content {
        padding: 16px;
    }
    
    .submissions-grid {
        grid-template-columns: 1fr;
    }
    
    .challenges-grid-profile {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #FFFFFF;
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: calc(100% - 32px);
    z-index: 10001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.confirm-modal.show {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.confirm-modal__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEF2F2;
    border-radius: 50%;
    color: #DC2626;
}

.confirm-modal__icon i {
    font-size: 32px;
}

.confirm-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 12px 0;
}

.confirm-modal__message {
    font-size: 14px;
    color: #64748B;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.confirm-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal__actions button {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Confirmation Modal Mobile */
@media (max-width: 768px) {
    .confirm-modal {
        width: calc(100% - 40px);
        max-width: none;
        padding: 24px 20px;
        margin: 0;
    }
    
    .confirm-modal__icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }
    
    .confirm-modal__icon i {
        font-size: 28px;
    }
    
    .confirm-modal__title {
        font-size: 18px;
    }
    
    .confirm-modal__message {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .confirm-modal__actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .confirm-modal__actions button {
        width: 100%;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .confirm-modal {
        width: calc(100% - 32px);
        padding: 20px 16px;
    }
}
