/* ========================================
   PROFILE PAGE - MOBILE-FIRST OPTIMIZATION
   ======================================== */

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

/* ========================================
   PROFILE HERO SECTION
   ======================================== */

.profile-hero {
    position: relative;
    width: 100%;
    padding: 20px 16px;
    margin-bottom: 20px;
}

.profile-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(236, 72, 153, 0.1) 100%);
    z-index: 0;
}

/* ========================================
   PROFILE CARD
   ======================================== */

.profile-card {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.08),
        rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    padding: 24px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Avatar Section */
.profile-avatar-section {
    text-align: center;
    margin-bottom: 24px;
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.avatar-edit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.avatar-edit-btn svg {
    width: 18px;
    height: 18px;
}

/* Profile Info */
.profile-info {
    margin-bottom: 20px;
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.verified-tick {
    color: #10b981;
    font-size: 20px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   STATS GRID
   ======================================== */

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.stat-card {
    text-align: center;
    padding: 12px 8px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ========================================
   USER ID SECTION
   ======================================== */

.profile-userid-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 10px;
}

.userid-label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.userid-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.userid-code {
    flex: 1;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.userid-copy-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.userid-copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

.profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.btn-primary-profile:active {
    transform: translateY(0);
}

.btn-primary-profile svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   PROFILE CONTENT WRAPPER
   ======================================== */

.profile-content-wrapper {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ========================================
   PROFILE SECTIONS
   ======================================== */

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.section-header p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
}

/* ========================================
   POSTS GRID
   ======================================== */

.posts-grid-profile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.post-card-profile {
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.08),
        rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-card-profile:hover {
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.12),
        rgba(236, 72, 153, 0.08));
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.post-card-profile h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.post-card-profile p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta-profile {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ========================================
   BADGES GRID
   ======================================== */

.badges-grid-profile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.badge-item-profile {
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.1),
        rgba(236, 72, 153, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.badge-item-profile:hover {
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.15),
        rgba(236, 72, 153, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.badge-icon-profile {
    font-size: 32px;
    display: block;
}

.badge-name-profile {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.badge-desc-profile {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 0;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.profile-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.profile-empty-state-icon {
    font-size: 48px;
    opacity: 0.5;
}

.profile-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* ========================================
   TABLET LAYOUT (481px - 768px)
   ======================================== */

@media (min-width: 481px) and (max-width: 768px) {
    .profile-card {
        padding: 28px 20px;
    }

    .profile-avatar {
        width: 120px;
        height: 120px;
    }

    .profile-name {
        font-size: 28px;
    }

    .posts-grid-profile {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .badges-grid-profile {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .profile-content-wrapper {
        padding: 0 20px;
    }
}

/* ========================================
   DESKTOP LAYOUT (769px and up)
   ======================================== */

@media (min-width: 769px) {
    .profile-hero {
        padding: 40px 40px;
        margin-bottom: 40px;
    }

    .profile-hero-bg {
        height: 150px;
    }

    .profile-card {
        max-width: 900px;
        margin: 0 auto;
        padding: 40px;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 40px;
        align-items: start;
    }

    .profile-avatar-section {
        text-align: left;
        grid-column: 1;
    }

    .profile-avatar {
        width: 140px;
        height: 140px;
    }

    .profile-name {
        font-size: 32px;
        justify-content: flex-start;
    }

    .profile-bio {
        max-width: none;
        text-align: left;
    }

    .profile-card > div:nth-child(2) {
        grid-column: 2;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .profile-content-wrapper {
        padding: 0 40px;
        gap: 50px;
    }

    .posts-grid-profile {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .badges-grid-profile {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .badge-item-profile {
        padding: 20px;
    }

    .badge-icon-profile {
        font-size: 40px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .avatar-edit-btn,
    .stat-card,
    .post-card-profile,
    .badge-item-profile,
    .btn-primary-profile {
        transition: none;
    }

    .avatar-edit-btn:hover,
    .stat-card:hover,
    .post-card-profile:hover,
    .badge-item-profile:hover,
    .btn-primary-profile:hover {
        transform: none;
    }
}

/* Focus styles for keyboard navigation */
.avatar-edit-btn:focus-visible,
.userid-copy-btn:focus-visible,
.btn-primary-profile:focus-visible,
.post-card-profile:focus-visible,
.badge-item-profile:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
}
