/* ==================== PROFILE HEADER ==================== */
.profile-header {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

/* Cover Image */
.profile-cover {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-section) 0%, var(--bg-dark) 100%);
    overflow: hidden;
}

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

.profile-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
}

.profile-cover-edit {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-white);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.profile-cover-edit:hover {
    background: rgba(0, 0, 0, 0.8);
}

.profile-cover-edit svg {
    width: 14px;
    height: 14px;
}

/* Profile Info Section */
.profile-info {
    position: relative;
    padding: var(--space-lg);
    padding-top: 60px;
}

/* Avatar */
.profile-avatar-wrapper {
    position: absolute;
    top: -64px;
    left: var(--space-lg);
}

.profile-avatar {
    width: 128px;
    height: 128px;
    border-radius: var(--radius-full);
    border: 4px solid var(--bg-card);
    object-fit: cover;
    background: var(--bg-input);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.profile-avatar-edit:hover {
    background: var(--bg-hover);
    border-color: var(--fitness-teal);
}

.profile-avatar-edit svg {
    width: 16px;
    height: 16px;
}

/* Profile Actions */
.profile-actions {
    position: absolute;
    top: var(--space-md);
    right: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
}

.profile-action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-white);
    border-color: var(--border-hover);
}

.profile-action-btn svg {
    width: 18px;
    height: 18px;
}

/* User Info */
.profile-user-info {
    margin-bottom: var(--space-md);
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-xs);
}

.profile-display-name {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-white);
}

.profile-verified {
    color: var(--fitness-teal);
    width: 22px;
    height: 22px;
}

.profile-username {
    font-size: var(--text-base);
    color: var(--text-dim);
}

.profile-badges {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.profile-badge[data-platform="soulmate"] {
    background: var(--soulmate-red-light);
    color: var(--soulmate-red);
}

.profile-badge[data-platform="creator"] {
    background: var(--creator-orange-light);
    color: var(--creator-orange);
}

.profile-badge[data-platform="ai"] {
    background: var(--ai-gold-light);
    color: var(--ai-gold);
}

.profile-badge[data-platform="professional"] {
    background: var(--professional-yellow-light);
    color: var(--professional-yellow);
}

.profile-badge[data-platform="fitness"] {
    background: var(--fitness-teal-light);
    color: var(--fitness-teal);
}

/* Bio */
.profile-bio {
    font-size: var(--text-base);
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    white-space: pre-wrap;
}

.profile-bio a {
    color: var(--fitness-teal);
}

.profile-bio .hashtag {
    color: var(--fitness-teal);
    cursor: pointer;
}

.profile-bio .mention {
    color: var(--creator-orange);
    cursor: pointer;
}

/* Meta Info */
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.profile-meta-item svg {
    width: 16px;
    height: 16px;
}

.profile-meta-item a {
    color: var(--fitness-teal);
}

.profile-meta-item a:hover {
    text-decoration: underline;
}

/* Stats */
.profile-stats {
    display: flex;
    gap: var(--space-xl);
}

.profile-stat {
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.profile-stat:hover {
    opacity: 0.8;
}

.profile-stat-value {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-white);
}

.profile-stat-label {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

/* Follow Button */
.profile-follow-btn {
    min-width: 120px;
}

.profile-follow-btn.following {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-white);
}

.profile-follow-btn.following:hover {
    border-color: var(--error);
    color: var(--error);
    background: var(--error-light);
}

.profile-follow-btn.following:hover .follow-text {
    display: none;
}

.profile-follow-btn.following:hover .unfollow-text {
    display: inline;
}

.profile-follow-btn .unfollow-text {
    display: none;
}

/* ==================== PROFILE TABS ==================== */
.profile-tabs {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
}

.profile-tab {
    flex: 1;
    min-width: 100px;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.profile-tab:hover {
    color: var(--text-white);
    background: var(--bg-hover);
}

.profile-tab.active {
    color: var(--text-white);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--fitness-teal);
    border-radius: var(--radius-full) var(--radius-full) 0 0;
}

.profile-tab-count {
    margin-left: var(--space-xs);
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
}

/* ==================== PROFILE CONTENT ==================== */
.profile-content {
    min-height: 300px;
}

.profile-tab-panel {
    display: none;
}

.profile-tab-panel.active {
    display: block;
    animation: fadeIn var(--transition-fast) ease-out;
}

/* ==================== FOLLOWERS/FOLLOWING LIST ==================== */
.user-list {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-default);
    transition: background var(--transition-fast);
}

.user-list-item:last-child {
    border-bottom: none;
}

.user-list-item:hover {
    background: var(--bg-hover);
}

.user-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
    cursor: pointer;
}

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

.user-list-name {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.user-list-display-name {
    font-weight: 600;
    color: var(--text-white);
    cursor: pointer;
}

.user-list-display-name:hover {
    text-decoration: underline;
}

.user-list-verified {
    color: var(--fitness-teal);
    width: 14px;
    height: 14px;
}

.user-list-username {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.user-list-bio {
    font-size: var(--text-sm);
    color: var(--text-gray);
    margin-top: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-list-follow-btn {
    padding: var(--space-xs) var(--space-md);
    min-width: 90px;
}

/* ==================== MEDIA GRID ==================== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.media-grid-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}

.media-grid-item img,
.media-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.media-grid-item:hover img,
.media-grid-item:hover video {
    transform: scale(1.05);
}

.media-grid-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.media-grid-item:hover .media-grid-overlay {
    opacity: 1;
}

.media-grid-stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-white);
    font-weight: 600;
    font-size: var(--text-sm);
}

.media-grid-stat svg {
    width: 18px;
    height: 18px;
}

.media-grid-video-icon {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    color: var(--text-white);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.media-grid-video-icon svg {
    width: 20px;
    height: 20px;
}

/* ==================== LIKES TAB ==================== */
.likes-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* ==================== EDIT PROFILE MODAL ==================== */
.edit-profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.edit-profile-cover {
    position: relative;
    height: 150px;
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.edit-profile-cover-btn {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    cursor: pointer;
}

.edit-profile-cover:hover .edit-profile-cover-btn {
    opacity: 1;
}

.edit-profile-cover-btn svg {
    width: 32px;
    height: 32px;
    color: var(--text-white);
}

.edit-profile-avatar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.edit-profile-avatar-preview {
    position: relative;
    width: 80px;
    height: 80px;
}

.edit-profile-avatar-preview img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
}

.edit-profile-avatar-btn {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    cursor: pointer;
}

.edit-profile-avatar-preview:hover .edit-profile-avatar-btn {
    opacity: 1;
}

.edit-profile-avatar-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-white);
}

.edit-profile-avatar-info {
    flex: 1;
}

.edit-profile-avatar-info p {
    font-size: var(--text-sm);
    color: var(--text-dim);
    margin-bottom: var(--space-sm);
}

/* ==================== EMPTY STATES ==================== */
.profile-empty {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
}

.profile-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    color: var(--text-dim);
}

.profile-empty-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: var(--space-sm);
}

.profile-empty-text {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

/* ==================== PROFILE NOT FOUND ==================== */
.profile-not-found {
    text-align: center;
    padding: var(--space-3xl);
}

.profile-not-found-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-xl);
    color: var(--text-dim);
}

.profile-not-found h1 {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: var(--space-md);
}

.profile-not-found p {
    font-size: var(--text-base);
    color: var(--text-dim);
    margin-bottom: var(--space-xl);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .profile-cover {
        height: 150px;
    }

    .profile-avatar-wrapper {
        top: -48px;
    }

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

    .profile-info {
        padding-top: 56px;
    }

    .profile-display-name {
        font-size: var(--text-xl);
    }

    .profile-stats {
        gap: var(--space-lg);
    }

    .profile-actions {
        top: var(--space-sm);
        right: var(--space-md);
    }

    .media-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }
}

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

    .profile-avatar-wrapper {
        top: -40px;
        left: var(--space-md);
    }

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

    .profile-info {
        padding: var(--space-md);
        padding-top: 48px;
    }

    .profile-meta {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .profile-stats {
        justify-content: space-between;
    }

    .profile-tabs {
        border-radius: var(--radius-lg);
    }

    .profile-tab {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--text-xs);
    }

    .user-list-item {
        padding: var(--space-sm) var(--space-md);
    }

    .user-list-bio {
        display: none;
    }
}

/* ==================== AVATAR UPLOAD MODAL ==================== */
.avatar-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md);
}

.avatar-upload-preview {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-section);
    border: 3px solid var(--border-default);
}

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

.avatar-crop-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.avatar-crop-circle {
    width: 180px;
    height: 180px;
    border: 2px dashed var(--text-white);
    border-radius: 50%;
    box-shadow: 0 0 0 100px rgba(0, 0, 0, 0.5);
}

.avatar-upload-info {
    text-align: center;
}

.avatar-upload-hint {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin: var(--space-xs) 0;
}

.avatar-choose-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ==================== COVER UPLOAD MODAL ==================== */
.cover-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md);
}

.cover-upload-preview {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 3 / 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-section);
    border: 2px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cover-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
}

.cover-preview-placeholder svg {
    opacity: 0.5;
}

.cover-upload-info {
    text-align: center;
}

.cover-upload-hint {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin: var(--space-xs) 0;
}

.cover-choose-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Button states in modal footer */
.modal-footer .btn-danger {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

.modal-footer .btn-danger:hover {
    background: color-mix(in srgb, var(--color-error) 85%, black);
}
