/* Profile Page */
.profile-page {
    padding: 0 0 40px;
}

/* Profile Header */
.profile-header {
    position: relative;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.profile-info {
    position: relative;
    padding: 0 32px 24px;
    margin-top: -60px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: end;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow-md);
    background-color: var(--bg-secondary);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-details h1 {
    font-size: 2rem;
    margin-bottom: 4px;
}

.profile-bio {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.profile-stats {
    display: flex;
    gap: 32px;
}

.profile-stats .stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-stats .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stats .stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Profile Level */
.profile-level {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.level-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    border-radius: var(--radius-md);
    color: white;
}

.level-icon {
    font-size: 24px;
}

.level-text {
    font-weight: 600;
}

.level-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: right;
}

/* Profile Content */
.profile-content {
    padding: 32px 0;
}

.profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.profile-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.profile-tab:hover {
    color: var(--text-primary);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.achievement-card {
    padding: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-normal);
}

.achievement-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.achievement-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 13px;
    color: var(--text-tertiary);
}

.achievement-date {
    margin-top: 8px;
    font-size: 12px;
    color: var(--success-color);
}

/* About Section */
.about-section {
    max-width: 600px;
}

.about-section h3 {
    font-size: 1.125rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

/* Edit Profile Button */
.edit-profile-btn {
    position: absolute;
    top: 24px;
    right: 32px;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-info {
        grid-template-columns: 1fr;
        text-align: center;
        margin-top: -40px;
        padding: 0 20px 24px;
    }

    .profile-avatar {
        margin: 0 auto;
    }

    .profile-stats {
        justify-content: center;
        gap: 24px;
    }

    .profile-level {
        min-width: auto;
        max-width: 300px;
        margin: 0 auto;
    }

    .profile-tabs {
        overflow-x: auto;
        padding-bottom: 0;
    }

    .profile-tab {
        white-space: nowrap;
    }

    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .profile-cover {
        height: 150px;
    }

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

    .profile-details h1 {
        font-size: 1.5rem;
    }

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

    .profile-stats .stat-item {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

/* Empty States */
.empty-photos,
.empty-favorites {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-tertiary);
}

.empty-photos svg,
.empty-favorites svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Settings Form */
.settings-form {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 32px;
    padding: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.settings-section h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-track {
    width: 48px;
    height: 26px;
    background-color: var(--bg-tertiary);
    border-radius: 13px;
    position: relative;
    transition: var(--transition-fast);
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active .toggle-track {
    background-color: var(--primary-color);
}

.toggle-switch.active .toggle-thumb {
    transform: translateX(22px);
}

.toggle-label {
    margin-left: 12px;
    color: var(--text-secondary);
}

/* Danger Zone */
.danger-zone {
    padding: 24px;
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
}

.danger-zone h3 {
    color: var(--error-color);
    margin-bottom: 8px;
}

.danger-zone p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Avatar Upload */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-upload .profile-avatar {
    width: 80px;
    height: 80px;
}

.avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.avatar-upload-btn:hover {
    background-color: var(--bg-tertiary);
}

.avatar-upload input[type="file"] {
    display: none;
}
