/* =================================
   User Profile Page Styles
   Matching Leaderboard Design Language
   ================================= */

.page-profile {
    min-height: calc(100vh - 4rem);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: var(--color-background);
    color: var(--color-on-background);
    font-family: "Lexend Deca", sans-serif;
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}

.profile-page-container {
    background: linear-gradient(145deg, rgba(39, 38, 44, 0.95), rgba(28, 27, 31, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Profile Header Card */
.profile-header-card {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 150, 0, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
}

.profile-avatar-large img,
.profile-flag-large {
    width: 70px;
    height: auto;
    object-fit: contain;
}

.profile-flag-universal-large {
    font-size: 3.5rem;
}

.profile-header-info {
    text-align: center;
}

.profile-username {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
}

/* Profile Stats - Podium Style */
.profile-stats-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 100px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.profile-stat .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffd700;
    line-height: 1.2;
}

.profile-stat .stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.profile-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-joined {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.profile-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.profile-social-link:hover {
    background: rgba(96, 165, 250, 0.25);
    border-color: rgba(96, 165, 250, 0.5);
    color: #93c5fd;
    transform: translateY(-1px);
}

.profile-social-link .social-icon {
    font-size: 1rem;
}

/* Completions Section */
.profile-completions-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
}

.profile-completions-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 1.25rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.completions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.completion-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    transition: all 0.2s ease;
}

.completion-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.completion-rank {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
}

.completion-info {
    flex: 1;
    min-width: 0;
}

.completion-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.completion-name:hover {
    color: #60a5fa;
}

.completion-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.completion-points {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffd700;
}

.completion-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.completion-proof {
    flex-shrink: 0;
}

.proof-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.proof-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.05);
}

.proof-btn.video-proof:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
}

.proof-btn.screenshot-proof:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
}

/* No Completions State */
.no-completions {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Error State */
.profile-error {
    text-align: center;
    padding: 4rem 2rem;
}

.profile-error h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #ef4444;
}

.profile-error p {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
}

/* Flag Select Button for Profile Settings */
.flag-select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.flag-select-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.flag-btn-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 24px;
}

.flag-btn-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 2px;
}

.flag-btn-text {
    flex: 1;
    text-align: left;
}

.flag-btn-arrow {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Profile Settings Avatar with real flag */
.profile-avatar-settings {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar-settings img {
    width: 50px;
    height: auto;
    object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
    .page-profile {
        padding: 1rem;
    }
    
    .profile-page-container {
        padding: 1.5rem;
    }
    
    .profile-avatar-large {
        width: 100px;
        height: 100px;
    }
    
    .profile-avatar-large img,
    .profile-flag-large {
        width: 60px;
    }
    
    .profile-flag-universal-large {
        font-size: 3rem;
    }
    
    .profile-username {
        font-size: 1.5rem;
    }
    
    .profile-stats-row {
        flex-wrap: wrap;
    }
    
    .profile-stat {
        min-width: 80px;
        padding: 0.75rem 1rem;
    }
    
    .profile-stat .stat-value {
        font-size: 1.5rem;
    }
    
    .completion-card {
        padding: 0.75rem;
    }
    
    .completion-rank {
        min-width: 45px;
        font-size: 0.8rem;
    }
    
    .completion-name {
        font-size: 0.85rem;
    }
}
