/* Profile Modal
 * #profileModal (viewing own/other users' profiles): header, stats, bio,
 * friendship buttons, collapsible templates/exercises/achievements sections,
 * mobile profile styling.
 */
/* Make user profile modal wider */
#userProfileModal .modal-content {
    max-width: 800px;
    width: 90%;
}

@media (min-width: 1024px) {
    #userProfileModal .modal-content {
        width: 70%;
        max-width: 900px;
    }
}

/* Profile Styling */
.profile-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--border-radius);
}

.profile-field label {
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-field span {
    color: var(--text-primary);
    font-weight: 500;
}

.view-profile {
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color) !important;
    color: white !important;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.view-profile:hover {
    background: #475569 !important;
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.4);
    transform: translateY(-2px);
}

/* Profile modal styling */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.profile-info h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.profile-info .username {
    margin: 0 0 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-info .fitness-goal {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.profile-actions {
    margin-bottom: 1.5rem;
    text-align: center;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Enhanced profile modal styling */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.profile-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.username {
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.fitness-goal {
    color: var(--primary-color);
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    text-transform: capitalize;
}

.join-date {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.9rem;
    margin: 0;
}

.profile-edit-section {
    margin-top: 1rem;
}

.profile-edit-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-stats {
    margin-top: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#userProfileModal .stat-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7) !important;
}

#userProfileModal .stat-value {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95) !important;
}

.profile-bio {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.profile-bio h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-bio p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.profile-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Enhanced Profile Modal Styling */
.profile-modal-enhanced {
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.profile-modal-content {
    padding: 2rem;
    color: white;
}

/* Enhanced stat items within profile modal */
.profile-modal-enhanced .enhanced-stat-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.profile-modal-enhanced .enhanced-stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.profile-modal-enhanced .enhanced-stat-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.profile-modal-enhanced .enhanced-stat-value {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Ensure all profile modal text has proper contrast */
.profile-modal-enhanced .username {
    color: rgba(255, 255, 255, 0.8) !important;
}

.profile-modal-enhanced .join-date {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-overview-section {
    margin-bottom: 2rem;
}

.profile-overview-section h4 {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-overview-section h4 i {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Collapsible profile sections (templates & exercises) */
.profile-section-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.profile-section-header i.section-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-section-header .profile-section-chevron {
    margin-left: auto;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease;
}

.profile-section-header.expanded .profile-section-chevron {
    transform: rotate(180deg);
}

.profile-section-header.expanded {
    margin-bottom: 1rem;
}

.profile-section-body {
    display: none;
}

.profile-section-header.expanded + .profile-section-body {
    display: block;
}

.profile-templates-section {
    margin-top: 2rem;
}

.profile-templates-section h4:not(.profile-section-header) {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-templates-section h4 i.fa-clipboard-list {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-templates-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-template-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.2s ease;
}

.profile-template-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.profile-template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.profile-template-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.profile-template-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-template-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.profile-template-chevron {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.profile-template-card.expanded .profile-template-chevron {
    transform: rotate(180deg);
}

.profile-template-body {
    display: none;
    padding-top: 0.6rem;
    margin-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-template-card.expanded .profile-template-body {
    display: block;
}

.profile-template-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.profile-template-exercises {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.profile-template-exercise-item {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.2rem 0;
}

.profile-template-exercise-item i {
    font-size: 0.65rem;
    margin-right: 0.4rem;
    opacity: 0.5;
}

.profile-template-copy {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

.profile-templates-loading {
    text-align: center;
    padding: 1rem 0;
    color: rgba(255, 255, 255, 0.5);
}

/* Profile Exercises Section */
.profile-exercises-section {
    margin-top: 2rem;
}

.profile-exercises-section h4:not(.profile-section-header) {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-exercises-section h4 i.fa-dumbbell {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-exercise-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
}

.profile-exercises-select-all {
    margin-bottom: 0.5rem;
}

.profile-exercises-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-exercise-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.2s ease;
}

.profile-exercise-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.profile-exercise-checkbox {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color, #6366f1);
}

.profile-exercise-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-exercise-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-exercise-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.profile-exercise-badge.weight {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

.profile-exercise-badge.cardio {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.profile-exercise-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.profile-exercise-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.profile-exercise-actions .btn-ghost {
    color: rgba(255, 255, 255, 0.6);
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.profile-exercise-actions .btn-ghost:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.1);
}

.profile-exercises-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.625rem 1rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.profile-exercises-loading {
    text-align: center;
    padding: 1rem 0;
    color: rgba(255, 255, 255, 0.5);
}

/* Exercise Details Modal */
.exercise-details-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0.5rem 0;
}

.exercise-detail-stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary, rgba(99, 102, 241, 0.06));
    border-radius: 10px;
}

.exercise-detail-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.exercise-detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.25rem;
}

.exercise-detail-trend {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

@media (max-width: 480px) {
    .profile-exercise-card {
        flex-wrap: wrap;
    }

    .profile-exercise-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.25rem;
    }
}

.profile-achievements-section {
    margin-top: 2rem;
}

.profile-achievements-section h4 {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-achievements-section h4 i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-align: center;
}

.achievement-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.achievement-item.unlocked {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.4);
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.achievement-item .achievement-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
}

.achievement-item .achievement-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.achievement-progress {
    margin-top: 0.5rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s ease;
}

.achievement-progress-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-top: 0.25rem;
}

.enhanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.enhanced-stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.enhanced-stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.enhanced-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95) !important;
    margin-bottom: 0.25rem;
}

.enhanced-stat-label {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7) !important;
    font-weight: 500;
}

.profile-bio-enhanced {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.profile-bio-enhanced h5 {
    margin: 0 0 0.5rem 0;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-bio-enhanced h5 i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-bio-enhanced p {
    margin: 0;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Mobile profile styling */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-modal-content {
        padding: 1.5rem;
    }
    
    .enhanced-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Friendship status button styling */
.friendship-status {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.friendship-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.friendship-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.friendship-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.friendship-btn.pending {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.4);
    color: rgba(255, 255, 255, 0.95) !important;
}

.friendship-btn.accepted {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.4);
    color: rgba(255, 255, 255, 0.95) !important;
}
    
    .stat-item {
        padding: 0.5rem 0.75rem;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
}


/* Enhanced Profile Modal Styling */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.profile-header .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.profile-header .profile-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-header .username {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.profile-header .join-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.enhanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.enhanced-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.enhanced-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.enhanced-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.enhanced-stat-label {
    color: rgba(0, 0, 0, 0.7) !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-bio-enhanced {
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-top: 1rem;
}

.profile-bio-enhanced h5 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-bio-enhanced h5 i {
    color: var(--primary-color);
}

.profile-bio-enhanced p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}

.profile-actions-enhanced {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.profile-actions-enhanced .btn {
    min-width: 120px;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem 0 1rem;
    }
    
    .enhanced-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .enhanced-stat-item {
        padding: 1rem;
    }
    
    .enhanced-stat-value {
        font-size: 1.5rem;
    }
    
    .enhanced-stat-label {
        font-size: 0.8rem;
    }
    
    .profile-actions-enhanced {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .profile-actions-enhanced .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .enhanced-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-header .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .profile-header .profile-info h3 {
        font-size: 1.25rem;
    }
}

/* Enhanced Profile Form Styles */
.profile-edit-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-edit-section h4 i {
    color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group .form-input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group .form-input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.char-count {
    display: block;
    text-align: right;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}


/* User Profile Modal Enhancements */
.profile-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    margin: -1.5rem -1.5rem 2rem -1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.profile-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.username {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.join-date {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin: 0;
}

/* Enhanced Stats Grid */
.enhanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.enhanced-stat-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enhanced-stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.enhanced-stat-item:hover::before {
    transform: scaleX(1);
}

.enhanced-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.enhanced-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.enhanced-stat-label {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7) !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bio Section Enhancement */
.profile-bio-enhanced {
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin: 2rem 0;
}

.profile-bio-enhanced h5 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-bio-enhanced p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
}

/* Friendship Status Enhancement */
.friendship-status {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.friendship-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.friendship-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.friendship-btn.pending {
    background: var(--gradient-warning);
}

.friendship-btn.accepted {
    background: var(--gradient-success);
}

/* User Workouts Display Enhancement */
.user-workout-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-workout-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.user-workout-item:hover::before {
    transform: scaleX(1);
}

.user-workout-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

.workout-date {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.workout-duration {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.workout-exercises-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.exercise-chip {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Mobile responsiveness for user views */
@media (max-width: 768px) {
    .user-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .view-workouts, .view-profile {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .enhanced-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .enhanced-stat-value {
        font-size: 1.5rem;
    }
    
    .profile-header {
        padding: 1.5rem;
    }
    
    .profile-avatar {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.3rem;
    }
}

/* Fix username display in header */
.user-profile .username,
.mobile-user-profile .username {
    color: var(--text-primary) !important;
    background: transparent !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* Ensure profile header username styling only applies to profile modals */
.profile-header .username {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}
/* Enhanced User Workout Details */
.user-workout-detailed {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.user-workout-detailed:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.workout-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

.workout-date-time {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.workout-date {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workout-duration {
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workout-total-volume {
    text-align: right;
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.volume-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.volume-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.workout-exercises-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exercise-section {
    background: rgba(249, 250, 251, 0.8);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.user-workout-detailed .sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.user-workout-detailed .set-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.user-workout-detailed .set-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-workout-detailed .set-item.weight {
    border-left: 4px solid var(--primary-color);
}

.user-workout-detailed .set-item.cardio {
    border-left: 4px solid var(--success-color);
}

.user-workout-detailed .set-number {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-workout-detailed .set-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-workout-detailed .set-details span {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-workout-detailed .set-volume {
    font-size: 0.8rem !important;
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Mobile responsiveness for workout details */
@media (max-width: 768px) {
    .user-workout-detailed {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .workout-info-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .workout-total-volume {
        text-align: center;
    }
    
    .user-workout-detailed .sets-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .effort-rating-container {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.4rem;
    }

    .effort-rating-label {
        min-width: auto;
        font-size: 0.75rem;
    }
    
    .volume-value {
        font-size: 1.3rem;
    }
    
    .workout-date {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .exercise-section {
        padding: 1rem;
    }
    
    .workout-info-header {
        margin-bottom: 1.5rem;
    }
}

/* Friends List Action Buttons */
.friend-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.friend-actions .view-workouts, 
.friend-actions .view-profile {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.85rem;
}

.friend-actions .view-workouts:hover, 
.friend-actions .view-profile:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

@media (max-width: 768px) {
    .friend-actions {
        flex-direction: row;
        gap: 0.4rem;
        justify-content: center;
    }
    
    .friend-actions .view-workouts, 
    .friend-actions .view-profile {
        flex: 1;
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.6rem 0.5rem;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 2rem;
    font-size: 1rem;
}
