/* ========================================
   Profile CSS - Web 1.0 Simple Style
   ======================================== */

/* Profile Header Section */
.profile-header {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #ffffff;
    border-bottom: 1px solid #cccccc;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.profile-summary {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 20px 16px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    margin: 0 0 12px;
}

/* Banner-free identity block. Scope these rules to leave shared avatars,
   settings, user lists, and composer controls unchanged. */
.profile-summary .profile-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.profile-summary .profile-avatar-wrapper {
    flex: 0 0 72px;
}

.profile-summary .avatar-size-72 {
    width: 72px;
    height: 72px;
    min-width: 72px;
    max-width: 72px;
    flex: 0 0 72px;
    box-sizing: border-box;
    border: 0;
    font-size: 28px;
}

.profile-summary .profile-header-controls {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.profile-summary .inline-form {
    margin: 0;
    max-width: 100%;
}

.profile-summary .profile-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    box-sizing: border-box;
    border: 1px solid #cbd5cb;
    border-radius: 999px;
    background: #fff;
    color: #254a28;
    font: 600 12px/1.4 Verdana, Arial, sans-serif;
    text-decoration: none;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.profile-summary .profile-primary-action:hover {
    background: #f0f6ed;
    border-color: #5a9a3c;
}

.profile-summary .profile-follow-action {
    border-color: #5a9a3c;
    color: #376522;
}

.profile-summary .profile-primary-action.following {
    background: #f0f6ed;
}

.profile-summary a:focus-visible,
.profile-summary button:focus-visible {
    outline: 2px solid #376522;
    outline-offset: 3px;
}

.profile-summary .profile-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.profile-summary .profile-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.profile-summary .profile-username {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 21px;
    line-height: 1.3;
    letter-spacing: -0.4px;
}

.profile-summary .premium-star {
    flex-shrink: 0;
    font-size: 15px;
}

.profile-summary .profile-badges-row {
    gap: 6px;
    padding: 0;
}

.profile-summary .profile-badge,
.profile-summary .custom-badge {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 3px 8px;
    border-radius: 999px;
    box-sizing: border-box;
    font-size: 10px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: none;
}

.profile-summary .profile-bio {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.profile-summary .profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    color: #687168;
    font-size: 11px;
    line-height: 1.5;
}

.profile-summary .profile-joined {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.profile-summary .online-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: inherit;
    font-size: inherit;
    white-space: nowrap;
}

.profile-summary .profile-feed-link {
    color: inherit;
    text-decoration: none;
}

.profile-summary .profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0;
}

.profile-summary .profile-social-stats {
    margin-top: 4px;
}

.profile-summary .stat {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    padding: 0;
    color: #687168;
    font-size: 12px;
    line-height: 1.6;
    text-decoration: none;
}

.profile-summary .stat-value {
    color: #182218;
    font-size: inherit;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.profile-summary .stat-label {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.profile-summary .profile-content-stats {
    gap: 6px 16px;
}

.profile-summary .profile-content-stats .stat {
    font-size: 11px;
}

.profile-summary .profile-content-stats .stat-value {
    color: inherit;
    font-weight: 600;
}

.profile-summary .stat:hover,
.profile-summary .profile-feed-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profile-summary .profile-moderation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #7a4c24;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.profile-summary .profile-moderation-action {
    padding: 6px 10px;
    border: 1px solid #dfc8b5;
    border-radius: 6px;
    background: #fffaf5;
    color: #7a4c24;
    font: inherit;
    white-space: normal;
    cursor: pointer;
}

.profile-composer {
    min-width: 0;
    padding: 0 16px 16px;
}

@media (max-width: 400px) {
    .profile-summary {
        padding: 16px 12px;
    }

    .profile-summary .profile-primary-action {
        padding: 8px 12px;
        min-height: 44px;
    }

    .profile-summary .profile-stats {
        column-gap: 12px;
    }

    .profile-composer {
        padding-inline: 12px;
    }
}

/* Profile Avatar */
.profile-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: #666666;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: bold;
    flex-shrink: 0;
    border: 1px solid #999999;
    object-fit: cover;
}

.profile-upload-preview {
    display: block;
    margin-bottom: 8px;
}

.avatar-upload-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Profile Info */
.profile-info {
    flex: 1;
    min-width: 200px;
}

.profile-username {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    line-height: 1.4;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.profile-bio {
    margin: 0 0 8px 0;
    line-height: 1.4;
    color: #333333;
    word-wrap: break-word;
    font-size: 12px;
}

.profile-joined {
    margin: 0 0 10px 0;
    color: #666666;
    font-size: 11px;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.stat {
    text-decoration: none;
    color: #0000cc;
    padding: 4px 8px;
    font-size: 12px;
}

.stat-value {
    font-weight: bold;
    font-size: 1.1em;
    display: inline;
    color: #000000;
}

.stat-label {
    color: #666666;
    font-size: 11px;
    margin-left: 3px;
}

/* Profile card header wrapper — flex column, two rows */
.profile-username-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0 14px;
    border-bottom: 1px solid #eee;
    width: 100%;
}

/* Profile Actions */
.profile-actions {
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dotted #cccccc;
}

/* Row 1: identity left + actions right */
.profile-identity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

/* Left side of row 1: username h1 + star + RSS + online — all inline */
.profile-identity-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

/* Row 2: badges only */
.profile-badges-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-left: 2px;
}

/* Profile badges (compact) */
.profile-badge {
    display:inline-flex; align-items:center; padding:2px 8px; height:18px; line-height:18px; font-size:11px; border-radius:6px; background:#f0f0f0; color:#333; font-weight:600; }

/* Custom badge (premium) — true pill, auto width, do not truncate text */
.custom-badge {
    display:inline-flex; align-items:center; justify-content:center; padding:6px 12px; border-radius:999px; color:#fff; font-weight:700; font-size:12px; margin-left:8px; white-space:nowrap; box-sizing:border-box;
}


/* Make sure action items never grow or wrap */
.profile-action-buttons > * { flex: 0 0 auto; }
.profile-action-buttons .inline-form { flex: 0 0 auto; }

/* Keep action buttons aligned right */
.profile-action-buttons { justify-self: end; display:flex; gap:8px; align-items:center; }

/* Make forms inline so buttons appear next to each other */
.inline-form { display: inline-flex; align-items: center; gap:6px; margin:0; width:auto; }
.inline-form button { white-space: nowrap; }

/* Ensure badges do not shrink and remain visible */
.profile-badge, .custom-badge { flex: 0 0 auto; }

/* Custom badge color classes (used for custom-badge-{color}) */
.custom-badge-green { background: #2ecc71; color: #fff; }
.custom-badge-blue { background: #3498db; color: #fff; }
.custom-badge-red { background: #e74c3c; color: #fff; }
.custom-badge-orange { background: #f39c12; color: #fff; }
.custom-badge-purple { background: #9b59b6; color: #fff; }
.custom-badge-turquoise { background: #1abc9c; color: #fff; }
.custom-badge-darkgray { background: #34495e; color: #fff; }
.custom-badge-orangered { background: #e67e22; color: #fff; }

/* Slight visual polish */
.custom-badge-green, .custom-badge-blue, .custom-badge-red, .custom-badge-orange, .custom-badge-purple, .custom-badge-turquoise, .custom-badge-darkgray, .custom-badge-orangered { box-shadow: 0 1px 0 rgba(0,0,0,0.06); }

/* Base custom badge pill style */
.custom-badge { display:inline-flex; align-items:center; justify-content:center; padding:4px 10px; border-radius:999px; color:#fff; font-weight:700; font-size:11px; margin-left:8px; line-height:1; }

.profile-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    /* Force buttons to stay on a single line and allow horizontal scroll on narrow screens */
    flex-wrap: nowrap !important;
    white-space: nowrap;
    overflow-x: auto;
}

.profile-action-buttons .inline-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

/* If buttons cannot fit, keep them on one line and allow horizontal scroll on narrow viewports */
@media (max-width: 520px) {
    .profile-action-buttons { flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Compact button styles */
.btn-compact {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid #999;
    cursor: pointer;
    font-family: Verdana, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-weight: 500;
    vertical-align: middle;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
}

/* Follow button: green */
.follow-btn-compact {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid #27ae60;
    cursor: pointer;
    background: #2ecc71;
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    min-width: 72px; /* ensure consistent button width */
    justify-content: center;
    text-align: center;
}

/* More specific: ensure follow button appears green when NOT following, even if other rules exist */
.profile-action-buttons .follow-btn-compact:not(.following) {
    background: #2ecc71 !important;
    border-color: #27ae60 !important;
    color: #ffffff !important;
}

/* Confirm following state remains visually distinct */
.follow-btn-compact.following {
    background: #f5f5f5 !important;
    color: #333 !important;
    border-color: #ccc !important;
}
.follow-btn-compact:hover { filter: brightness(0.95); }

.follow-btn-compact:hover,
.btn-compact:hover {
    opacity: 0.9;
}

.follow-btn-compact.following {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.btn-warning-compact {
    background: #ff9800;
    color: #fff;
    border-color: #f57c00;
}

.suspended-badge-compact {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
}

.profile-controls { display:flex; gap:8px; align-items:center; margin-left:auto; }

/* Edit Profile Button */
.edit-profile-btn {
    background: #43a047;
    color: #fff;
    border: none;
    padding: 3px 8px;
    font-size: 9px;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
    display: inline-block;
    font-weight: normal;
}

/* When edit button is placed under the username */
.edit-profile-undername {
    grid-column: 1;
    margin-top: 6px;
}

.edit-profile-undername .edit-profile-btn {
    padding: 4px 10px;
    font-size: 11px;
}

/* Compact control box on the right */
.profile-controls-box { display:flex; gap:8px; align-items:center; background:#fafafa; border:1px solid #eee; padding:6px; border-radius:8px; }

/* Ensure action buttons in the box have the same size and visual weight */
.profile-controls .btn, .profile-controls .follow-btn {
    width:120px; /* fixed width for clean alignment */
    padding:8px 10px;
    text-align:center;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    border-radius:6px;
}

.profile-actions {
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dotted #cccccc;
}

.profile-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap; /* keep buttons on same row when space allows */
    margin-left: auto;
}

.profile-action-buttons .inline-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.profile-actions .inline-form {
    margin: 0;
}

.profile-actions .btn, .profile-actions .follow-btn, .profile-actions .btn-warning {
    display: inline-block;
}

.suspended-badge {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

/* Responsive: if space is tight, stack identity row */
@media (max-width: 720px) {
    .profile-identity-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    .profile-action-buttons {
        margin-left: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 520px) {
    .profile-identity-left {
        flex-wrap: wrap;
    }
    .profile-action-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Bio Form */
.bio-form textarea {
    width: 100%;
    min-height: 50px;
    padding: 5px;
    border: 1px solid #999999;
    resize: vertical;
    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.bio-form button {
    background: #cccccc;
    color: #000000;
    border: 1px solid #999999;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 12px;
    font-family: Verdana, Arial, sans-serif;
}

/* Follow Button */
.follow-btn {
    background: #cccccc;
    color: #000000;
    border: 1px solid #999999;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 12px;
    font-family: Verdana, Arial, sans-serif;
}

/* Profile Posts Section */
.profile-posts {
    margin-top: 10px;
}

.profile-posts h2 {
    border: none;
    padding: 0 0 10px 0;
    margin-bottom: 10px;
    font-size: 12px;
    background: #eeeeee;
    padding: 5px 10px;
}

/* Empty State */
.no-posts {
    text-align: center;
    color: #666666;
    padding: 20px;
    font-size: 12px;
}

/* ========================================
   Users List (Followers/Following) Styles
   ======================================== */

/* Back Link */
.back-link {
    display: inline-block;
    margin: 10px 0;
    color: #0000cc;
    text-decoration: underline;
    font-size: 12px;
}

/* Users List Section */
.users-list-section {
    padding: 10px;
}

.users-list-section h2 {
    border: none;
    padding: 0 0 10px 0;
    margin-bottom: 10px;
    font-size: 12px;
    background: #eeeeee;
    padding: 5px 10px;
}

/* Users List */
.users-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* User Item */
.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eeeeee;
}

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

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    background: #666666;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: bold;
    flex-shrink: 0;
    border: 1px solid #999999;
}

/* User Info */
.user-info {
    flex: 1;
    min-width: 0;
}

.user-username {
    display: block;
    color: #0000cc;
    text-decoration: underline;
    font-weight: normal;
    font-size: 12px;
    margin-bottom: 3px;
}

.user-bio {
    margin: 0 0 3px 0;
    color: #333333;
    font-size: 11px;
    line-height: 1.3;
    word-wrap: break-word;
}

.user-joined {
    margin: 0;
    color: #999999;
    font-size: 10px;
}

/* User Actions */
.user-actions {
    flex-shrink: 0;
}

.user-actions .follow-btn {
    padding: 4px 12px;
    font-size: 11px;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #666666;
    padding: 20px;
    font-size: 12px;
    border-bottom: 1px solid #cccccc;
}

} /* Preserve the legacy max-width: 520px block's existing scope. */

/* Password settings */
.password-settings .back-link {
    color: #335f30;
    font-size: 13px;
    margin: 0 0 22px;
    text-underline-offset: 3px;
}
.password-settings-heading { margin-bottom: 24px; }
.password-settings-eyebrow {
    margin: 0 0 8px;
    color: #335f30;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}
.password-settings-heading .section-title {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #222;
    font-size: 26px;
    line-height: 1.25;
}
.password-settings-form { margin-bottom: 16px; }
.password-settings-form .settings-card-title { margin-bottom: 8px; }
.password-settings-required,
.password-settings-hint,
.password-settings-footer {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}
.password-settings-required { margin: 0 0 24px; }
.password-settings-field { margin-bottom: 22px; }
.password-settings-field label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}
.password-settings-field input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #bbc5bc;
    border-radius: 7px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 16px;
}
.password-settings-field input:focus-visible {
    outline: 3px solid #d1e8d3;
    outline-offset: 2px;
    border-color: #335f30;
}
.password-settings-field input[aria-invalid="true"] { border-color: #b42318; }
.password-settings-new {
    border-top: 1px solid #eee;
    padding-top: 22px;
}
.password-settings-hint { margin: 8px 0 0; }
.password-settings-requirements {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid #dfe7d8;
    border-radius: 7px;
    background: #f4f8f2;
    color: #335333;
    font-size: 13px;
    line-height: 1.65;
}
.password-settings-requirements h3 { margin: 0 0 6px; font-size: 13px; }
.password-settings-requirements ul { margin: 0; padding-left: 18px; }
.password-settings-form .profile-settings-action-row { padding: 20px 0 0; }
.password-settings-footer { margin: 0; padding: 0 4px; }
.password-settings .profile-settings-errors ul { margin: 8px 0; padding-left: 20px; }
.password-settings .profile-settings-errors a { color: inherit; text-decoration: underline; }
.password-settings .profile-settings-errors p { margin: 8px 0 0; }
.password-settings .field-error { margin-bottom: 0; }
@media (max-width: 640px) {
    .password-settings-form { padding: 20px 16px; }
    .password-settings-heading .section-title { font-size: 24px; }
}
