/* Profile Component Styles */

.profile-section {
    max-width: 100%;
    margin: 0 auto;
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(135deg, #007AFF, #5AC8FA);
    border-radius: 1.5rem;
    color: white;
}

.profile-avatar {
    flex-shrink: 0;
    width: 20%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gl-primary), var(--gl-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    border-radius: 50%;
}

.profile-avatar__status {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #34C759;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid white;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.5rem 0;
}

/* Responsive text sizing for larger screens */
@media (min-width: 1200px) {
    .profile-name {
        font-size: 2rem;
    }
}

@media (min-width: 1600px) {
    .profile-name {
        font-size: 2.5rem;
    }
}

.profile-title {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 1rem 0;
}

.profile-level {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.profile-level__badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (min-width: 1200px) {
    .profile-level__badge {
        font-size: 1rem;
        padding: 8px 18px;
        border-radius: 25px;
    }
}

@media (min-width: 1600px) {
    .profile-level__badge {
        font-size: 1.125rem;
        padding: 10px 22px;
        border-radius: 30px;
    }
}

.profile-level__content {
    flex: 1;
    min-width: 0;
}

.profile-level__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.profile-level__description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
    max-width: 300px;
}

.profile-stats-header {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}

.profile-stat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-stat-header__icon {
    font-size: 1.25rem;
}

.profile-stat-header__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

@media (min-width: 1200px) {
    .profile-stat-header__icon {
        font-size: 1.5rem;
    }
    
    .profile-stat-header__value {
        font-size: 1.5rem;
    }
}

@media (min-width: 1600px) {
    .profile-stat-header__icon {
        font-size: 1.75rem;
    }
    
    .profile-stat-header__value {
        font-size: 1.75rem;
    }
}

.profile-stat-header__label {
    font-size: 0.75rem;
    color: var(--gl-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === PROFILE PROGRESS === */
.profile-progress {
    margin-top: 1rem;
}

.profile-progress__info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.profile-progress__label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.profile-progress__value {
    font-weight: 700;
    color: white;
}

@media (min-width: 1200px) {
    .profile-progress__label,
    .profile-progress__value {
        font-size: 1.125rem;
    }
}

@media (min-width: 1600px) {
    .profile-progress__label,
    .profile-progress__value {
        font-size: 1.25rem;
    }
}

.profile-progress__bar {
    height: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-top: var(--gl-spacing-2);
}

@media (min-width: 1200px) {
    .profile-progress__bar {
        height: 14px;
        border-radius: 7px;
    }
}

@media (min-width: 1600px) {
    .profile-progress__bar {
        height: 16px;
        border-radius: 8px;
    }
}

.profile-progress__fill {
    height: 100%;
    background: #007AFF;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.profile-progress__details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--gl-spacing-2);
    font-size: 0.875rem;
}

.profile-progress__level {
    font-weight: 600;
    color: var(--gl-gray-700);
}

.profile-progress__next {
    color: var(--gl-primary);
    font-weight: 500;
}

.profile-progress__breakdown {
    margin-top: var(--gl-spacing-4);
    padding: var(--gl-spacing-4);
    background: var(--gl-gray-50);
    border-radius: var(--gl-radius-md);
    border: 1px solid var(--gl-gray-200);
}

.profile-progress__breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--gl-spacing-2) 0;
    border-bottom: 1px solid var(--gl-gray-200);
}

.profile-progress__breakdown-item:last-child {
    border-bottom: none;
}

.profile-progress__breakdown-label {
    font-size: 0.875rem;
    color: var(--gl-gray-600);
    font-weight: 500;
}

.profile-progress__breakdown-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gl-gray-800);
}

.profile-progress__breakdown-value--needed {
    color: var(--gl-warning);
}

.profile-progress__breakdown-value--complete {
    color: var(--gl-success);
}

/* Stats Grid */
.profile-stats {
    margin-bottom: var(--gl-spacing-6);
}

.profile-stats__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gl-gray-800);
    margin: 0 0 var(--gl-spacing-4) 0;
}

.profile-stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gl-spacing-4);
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: var(--gl-spacing-4);
    padding: var(--gl-spacing-5);
    background: white;
    border-radius: var(--gl-border-radius-lg);
    border: 1px solid var(--gl-gray-200);
    transition: all 0.2s ease;
}

.profile-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--gl-shadow-md);
    border-color: var(--gl-primary);
}

.profile-stat__icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gl-gray-50);
    border-radius: var(--gl-border-radius-lg);
}

.profile-stat__content {
    flex: 1;
}

.profile-stat__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gl-gray-800);
    margin-bottom: var(--gl-spacing-1);
}

.profile-stat__label {
    display: block;
    font-size: 0.875rem;
    color: var(--gl-gray-600);
    font-weight: 500;
}

/* Achievements */
.profile-achievements {
    margin-bottom: var(--gl-spacing-6);
}

.profile-achievements__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gl-gray-800);
    margin: 0 0 var(--gl-spacing-4) 0;
}

.profile-achievements__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--gl-spacing-3);
    padding: var(--gl-spacing-3);
}

.profile-achievement {
    width: 100%;
    max-width: 200px;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    cursor: pointer;

}

.profile-achievement:hover {
    box-shadow: var(--gl-shadow-lg);
    transform: translateY(-2px);
}

.profile-achievement__image {
    width: 100%;
    aspect-ratio: 1;
    background: #f9fafb;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.profile-achievement__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--gl-border-radius-lg);
    display: block;
}

.profile-achievement__category-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-achievement__status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(52, 199, 89, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-achievement__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: transparent;
    color: var(--gl-gray-400);
    font-size: 3rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.profile-achievement__content {
    padding: var(--gl-spacing-2);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.profile-achievement__name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    text-align: center;
}

.profile-achievement__description {
    font-size: 0.75rem;
    color: #4b5563;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    flex: 1;
    text-align: center;
}

/* Achievement Progress Bar */
.profile-achievement__progress {
    margin-top: 0.5rem;
    width: 100%;
}

.profile-achievement__progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.profile-achievement__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gl-primary), #5AC8FA);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.profile-achievement__progress-fill--completed {
    background: linear-gradient(90deg, #34C759, #30D158);
}

.profile-achievement__progress-text {
    font-size: 0.625rem;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

.profile-achievement__rewards {
    display: flex;
    gap: var(--gl-spacing-1);
    justify-content: center;
    flex-wrap: wrap;
}

.profile-achievement__points,
.profile-achievement__credits {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 0.375rem;
    background: #f3f4f6;
    color: #374151;
}

.profile-achievement__points {
    background: #FFF3CD;
    color: #856404;
}

.profile-achievement__credits {
    background: #D1ECF1;
    color: #0C5460;
}

/* Error State */
.profile-error {
    text-align: center;
    padding: var(--gl-spacing-8);
    color: var(--gl-gray-500);
}

.profile-error__icon {
    font-size: 3rem;
    margin-bottom: var(--gl-spacing-4);
}

.profile-error__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gl-gray-700);
    margin: 0 0 var(--gl-spacing-2) 0;
}

.profile-error__message {
    color: var(--gl-gray-500);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .profile-achievements__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--gl-spacing-3);
    }
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: var(--gl-spacing-4);
    }
    
    .profile-avatar__image {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .profile-stats__grid {
        grid-template-columns: 1fr;
    }
    
    .profile-achievements__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--gl-spacing-2);
    }
    
    .profile-stat {
        padding: var(--gl-spacing-4);
    }
    
    .profile-achievement {
        padding: var(--gl-spacing-4);
    }
}
