/**
 * ShadowBoard 2.0 - Profile Page CSS
 * GitHub-style profile with crimson accents
 */

.profile-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */

.profile-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Avatar */
.avatar-section {
    margin-bottom: 20px;
}

.avatar-wrapper {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--bg-tertiary);
    object-fit: cover;
    background: var(--bg-secondary);
}

.default-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    font-weight: bold;
    color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    text-shadow: 0 0 30px var(--accent-glow);
}

.avatar-change-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #000;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid var(--bg-primary);
    transition: all 0.2s;
    box-shadow: 0 0 15px var(--accent-glow);
}

.avatar-change-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--accent-glow);
}

/* Identity */
.profile-identity {
    margin-bottom: 15px;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.profile-alias {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 5px 0 0;
}

/* Bio */
.profile-bio {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.bio-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Meta Info */
.profile-meta {
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.meta-item span:last-child {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.meta-icon {
    width: 20px;
    text-align: center;
}

.meta-item a {
    color: var(--accent-primary);
    text-decoration: none;
}

.meta-item a:hover {
    text-decoration: underline;
}

/* Actions */
.profile-actions {
    margin-bottom: 20px;
}

.btn-edit-profile {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-profile:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-follow {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    color: #000;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-follow:hover {
    box-shadow: 0 0 25px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-follow.following {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-follow.following:hover {
    border-color: #ff4444;
    color: #ff4444;
}

/* Timeline Invite Button - Quartz Dust #1 Only */
.btn-timeline-invite {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, #dc143c 0%, #8b0a1f 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.4);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.btn-timeline-invite:hover {
    box-shadow: 0 0 25px rgba(220, 20, 60, 0.6);
    transform: translateY(-1px);
}

.btn-timeline-invite .invite-icon {
    font-size: 1rem;
}

.timeline-access-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 16px;
    margin-top: 10px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Stats */
.profile-stats {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-link {
    color: inherit;
    text-decoration: none;
}

.stat-link:hover {
    color: var(--accent-primary);
}

.stat-link strong {
    color: var(--text-primary);
}

.stat-separator {
    margin: 0 8px;
}

/* Sidebar Achievements */
.profile-achievements {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.profile-achievements h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.achievement-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.achievement-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
}

/* ============================================
   RIGHT CONTENT
   ============================================ */

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 0;
    overflow: hidden;
}

.content-section {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.8) 0%, rgba(10, 10, 10, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    min-width: 0;
    overflow: hidden;
}

.section-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.section-header-row .section-title {
    margin: 0;
    padding: 0;
    border: none;
}

.see-all {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
}

.see-all:hover {
    color: var(--accent-primary);
}

/* Thread List */
.threads-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.thread-item:hover {
    background: var(--bg-hover);
    border-left: 3px solid var(--accent-primary);
    padding-left: 12px;
}

.thread-avatar img,
.mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.mini-avatar {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-weight: bold;
    font-size: 1rem;
}

.thread-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.thread-title {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.thread-author {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.thread-stats {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.stat-dot {
    color: var(--text-muted);
}

.view-more {
    display: block;
    text-align: center;
    padding: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 10px;
}

.view-more:hover {
    color: var(--accent-primary);
}

.no-content {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* Activity Grid */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.activity-stat {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Achievements Showcase */
.achievements-showcase {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.achievement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    min-width: 100px;
    transition: all 0.2s;
}

.achievement-card.unlocked {
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.2);
}

.achievement-card.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.ach-icon {
    font-size: 2.5rem;
}

.ach-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        position: static;
        max-width: 400px;
        margin: 0 auto;
        text-align: center;
    }
    
    .profile-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
    }
    
    .meta-item {
        margin: 0;
    }
    
    .profile-stats {
        justify-content: center;
    }
    
    .achievements-grid {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .avatar-wrapper {
        width: 200px;
        height: 200px;
    }
    
    .activity-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-showcase {
        justify-content: center;
    }
}
