/* PROFILE MODULE STYLES */

.profile-header-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #E2E8F0;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease;
}

.skeleton-text {
    background-color: #E2E8F0;
    color: transparent !important;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    user-select: none;
    display: inline-block;
}

.skeleton-text::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-pulse 1.5s infinite;
}

.profile-avatar.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-pulse 1.5s infinite;
}

@keyframes skeleton-pulse {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.profile-avatar img.loaded {
    opacity: 1;
}

.profile-info {
    flex: 1;
}

.profile-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1.2;
}

.profile-handle {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

.profile-stats {
    display: flex;
    gap: 20px;
    border-top: 1px solid #F1F5F9;
    padding-top: 15px;
}

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

.profile-stats .stat strong {
    font-weight: 700;
    color: var(--brand-dark);
}

.profile-stats .stat span {
    color: var(--muted);
}

/* Avatar Upload Overlay */
.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    color: white;
}

.profile-avatar:hover .avatar-overlay {
    opacity: 1;
}

/* Only show overlay if it's my profile (handled by JS toggling a class usually, but for now CSS hover is fine, we'll hide it in JS if not me) */
/* Better: We will add 'editable' class to .profile-avatar via JS if it's me */
.profile-avatar:not(.editable) .avatar-overlay {
    display: none !important;
}

.profile-posts-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-date-picker-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 140px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
}

.profile-date-picker-label {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-date-placeholder {
    flex: 1;
    display: grid;
    place-items: center;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 12px;
}

.profile-feed-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px 0 8px;
}

.profile-feed-footer[hidden] {
    display: none !important;
}

.profile-load-more-btn {
    border: 1px solid var(--border, #cbd5e1);
    background: #fff;
    color: #0f172a;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.profile-load-more-btn:hover {
    background: #f8fafc;
}

.profile-load-more-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.profile-feed-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    color: var(--muted, #64748b);
    font-size: 13px;
    font-weight: 600;
}

.profile-feed-loading[hidden] {
    display: none !important;
}

.profile-feed-status-card {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted, #64748b);
}

.profile-feed-status-text {
    margin: 0;
    font-size: 14px;
}

.profile-feed-spinner {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    border-top-color: #0ea5e9;
    animation: profile-spin 0.8s linear infinite;
}

.profile-feed-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-feed-skeleton-card {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.profile-feed-skeleton-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.profile-feed-skeleton-avatar,
.profile-feed-skeleton-line,
.profile-feed-skeleton-pill {
    animation: profile-skeleton-shimmer 1.2s linear infinite;
    background: linear-gradient(90deg, #f1f5f9 20%, #e2e8f0 40%, #f1f5f9 60%);
    background-size: 220% 100%;
}

.profile-feed-skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.profile-feed-skeleton-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.profile-feed-skeleton-line {
    display: block;
    height: 12px;
    border-radius: 999px;
}

.profile-feed-skeleton-line-title {
    width: 38%;
    min-width: 140px;
}

.profile-feed-skeleton-line-sub {
    width: 56%;
    min-width: 180px;
}

.profile-feed-skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.profile-feed-skeleton-line-full {
    width: 100%;
}

.profile-feed-skeleton-line-short {
    width: 72%;
}

.profile-feed-skeleton-foot {
    display: flex;
    gap: 12px;
}

.profile-feed-skeleton-pill {
    width: 84px;
    height: 12px;
    border-radius: 999px;
}

.profile-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted, #64748b);
}

.profile-empty-state-icon {
    margin-bottom: 12px;
    opacity: 0.6;
}

.profile-empty-state-icon-primary {
    color: var(--primary);
}

.profile-empty-state-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.profile-empty-state-title-muted {
    font-weight: 500;
    color: var(--text);
}

.profile-empty-state-copy {
    margin: 6px 0 20px;
    font-size: 14px;
    opacity: 0.8;
}

.profile-empty-state-copy-tight {
    margin-top: 4px;
    margin-bottom: 0;
}

.profile-empty-state-action {
    margin: 0 auto;
}

@keyframes profile-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes profile-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile-feed-spinner,
    .profile-feed-skeleton-avatar,
    .profile-feed-skeleton-line,
    .profile-feed-skeleton-pill {
        animation: none;
    }
}
