/* ═══════════════════════════════════════════════════════════════════════
   EvoRealm UO — Modern Forum Styles
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Forum App Layout ─────────────────────────────────────────────── */
.forum-app {
    padding-top: 100px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.forum-app::before {
    content: '';
    position: fixed;
    inset: -15%;
    background: url('images/forum-bg.jpg') no-repeat center center;
    background-size: cover;
    animation: bgCinematic 30s ease-in-out infinite,
               bgSway 40s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.forum-app::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 30% 20%, rgba(124, 92, 255, 0.12) 0%, transparent 100%),
        radial-gradient(ellipse 500px 350px at 70% 80%, rgba(56, 182, 255, 0.08) 0%, transparent 100%),
        rgba(10, 10, 26, 0.78);
    background-size: 200% 200%, 200% 200%, 100% 100%;
    animation: overlayShift 25s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

.forum-app > * {
    position: relative;
    z-index: 1;
}

@keyframes bgCinematic {
    0%   { filter: brightness(0.85) saturate(1.0) contrast(1.0) hue-rotate(0deg); }
    15%  { filter: brightness(1.0)  saturate(1.2) contrast(1.05) hue-rotate(4deg); }
    30%  { filter: brightness(0.9) saturate(1.1) contrast(1.0) hue-rotate(-2deg); }
    50%  { filter: brightness(1.1)  saturate(1.3) contrast(1.08) hue-rotate(8deg); }
    70%  { filter: brightness(0.92) saturate(1.15) contrast(1.02) hue-rotate(3deg); }
    85%  { filter: brightness(1.05) saturate(1.25) contrast(1.06) hue-rotate(-3deg); }
    100% { filter: brightness(0.85) saturate(1.0) contrast(1.0) hue-rotate(0deg); }
}

@keyframes bgSway {
    0%   { transform: rotate(0deg)   scale(1.02); }
    20%  { transform: rotate(4deg)   scale(1.05); }
    40%  { transform: rotate(-3deg)  scale(1.03); }
    60%  { transform: rotate(6deg)   scale(1.06); }
    80%  { transform: rotate(-4deg)  scale(1.04); }
    100% { transform: rotate(0deg)   scale(1.02); }
}

@keyframes overlayShift {
    0%   { background-position: 20% 20%, 80% 80%, center; }
    25%  { background-position: 60% 30%, 40% 60%, center; }
    50%  { background-position: 80% 60%, 20% 40%, center; }
    75%  { background-position: 40% 80%, 60% 20%, center; }
    100% { background-position: 20% 20%, 80% 80%, center; }
}

/* ── Auth UI ──────────────────────────────────────────────────────── */
.user-bar-right {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.user-bar-email {
    font-size: .78rem;
    color: var(--text-dim);
}

.auth-badge {
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.auth-badge.verified {
    background: var(--success);
    color: var(--bg);
}

.auth-badge.unverified {
    background: var(--danger);
    color: #fff;
}

.forum-verify-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(248, 113, 113, .1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
    font-size: .88rem;
    color: var(--danger);
    flex-wrap: wrap;
}

.forum-verify-banner.hidden {
    display: none;
}

.auth-error {
    background: rgba(248, 113, 113, .1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--danger);
}

.auth-error.hidden {
    display: none;
}

.modal-footer-col {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.modal-switch {
    text-align: center;
    font-size: .82rem;
    color: var(--text-dim);
}

.modal-switch a {
    color: var(--accent-light);
    font-weight: 600;
}

.modal-switch a:hover {
    color: var(--gold);
}

.text-dim {
    color: var(--text-dim);
    font-size: .88rem;
}

.btn[disabled],
.btn.loading {
    opacity: .6;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}

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

.guest-posting-notice {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: .9rem;
}

.guest-posting-notice .btn {
    margin-top: .75rem;
}

/* ── Forum Header ─────────────────────────────────────────────────── */
.forum-header {
    background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg-card) 50%, var(--bg-alt) 100%);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.forum-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 0%, var(--accent-glow) 0%, transparent 60%);
    pointer-events: none;
}

.forum-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: .5rem;
    position: relative;
}

.forum-subtitle {
    color: var(--text-dim);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.forum-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.forum-search {
    flex: 1;
    min-width: 220px;
    max-width: 480px;
    position: relative;
}

.forum-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.forum-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: .95rem;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
    outline: none;
}

.forum-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.forum-search input::placeholder {
    color: var(--text-dim);
}

.btn-new-thread {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ── User Bar ─────────────────────────────────────────────────────── */
.forum-user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    margin-bottom: 1.5rem;
}

.user-bar-left {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.user-bar-label {
    color: var(--text-dim);
    font-size: .85rem;
}

.user-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: var(--bg);
    flex-shrink: 0;
}

.btn-sm {
    font-size: .8rem;
    padding: 6px 14px;
}

/* ── Breadcrumb ───────────────────────────────────────────────────── */
.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .75rem 0;
    font-size: .85rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.forum-breadcrumb a {
    color: var(--accent-light);
    transition: color .2s;
}

.forum-breadcrumb a:hover {
    color: var(--gold);
}

.forum-breadcrumb .sep {
    color: var(--text-dim);
    user-select: none;
}

/* ── View Management ──────────────────────────────────────────────── */
.forum-view {
    margin-bottom: 3rem;
}

.forum-view.hidden {
    display: none;
}

/* ── Category Grid ────────────────────────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--gap);
    margin-bottom: 2rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: transform .2s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cat-color, var(--accent));
    opacity: 0;
    transition: opacity .3s var(--ease);
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: var(--cat-color, var(--accent));
    box-shadow: 0 8px 30px rgba(0,0,0,.3), 0 0 20px var(--cat-glow, var(--accent-glow));
}

.category-card:hover::before {
    opacity: 1;
}

.category-card-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: .75rem;
}

.category-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: .25rem;
}

.category-desc {
    font-size: .88rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.category-meta {
    display: flex;
    gap: 1.25rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}

.category-stat {
    font-size: .8rem;
    color: var(--text-dim);
}

.category-stat strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Forum Stats Bar ──────────────────────────────────────────────── */
.forum-stats-bar {
    display: flex;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.forum-stat-item {
    font-size: .85rem;
    color: var(--text-dim);
}

.forum-stat-item strong {
    color: var(--accent-light);
    font-weight: 700;
}

/* ── Thread List Header ───────────────────────────────────────────── */
.thread-list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.thread-list-header .cat-icon {
    font-size: 1.8rem;
}

.thread-list-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
}

.thread-list-header p {
    color: var(--text-dim);
    font-size: .9rem;
}

/* ── Sort Bar ─────────────────────────────────────────────────────── */
.thread-sort-bar {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-dim);
    font-size: .82rem;
    cursor: pointer;
    transition: all .2s var(--ease);
}

.sort-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.sort-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Thread List ──────────────────────────────────────────────────── */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.thread-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}

.thread-row:hover {
    border-color: var(--accent);
    background: var(--bg-card-alt);
}

.thread-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: var(--bg);
    flex-shrink: 0;
}

.thread-info {
    min-width: 0;
}

.thread-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-info-meta {
    font-size: .78rem;
    color: var(--text-dim);
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}

.thread-tag {
    display: inline-block;
    padding: 1px 8px;
    background: var(--surface);
    border-radius: var(--radius-pill);
    font-size: .7rem;
    color: var(--accent-light);
}

.thread-replies {
    text-align: center;
    min-width: 60px;
}

.thread-replies strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-bright);
}

.thread-replies span {
    font-size: .7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.thread-last-activity {
    font-size: .78rem;
    color: var(--text-dim);
    text-align: right;
    min-width: 80px;
}

.thread-list-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-size: .95rem;
}

.thread-list-empty .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: .5;
}

/* ── Pinned thread ────────────────────────────────────────────────── */
.thread-row.pinned {
    border-left: 3px solid var(--gold);
}

.thread-row.pinned .pin-badge {
    font-size: .7rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ── Thread Detail ────────────────────────────────────────────────── */
.thread-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.thread-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.thread-detail-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--bg);
    flex-shrink: 0;
}

.thread-detail-info {
    flex: 1;
}

.thread-detail-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: .4rem;
    line-height: 1.3;
}

.thread-detail-meta {
    font-size: .82rem;
    color: var(--text-dim);
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}

.thread-detail-body {
    color: var(--text);
    line-height: 1.8;
    font-size: .95rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.thread-detail-body p {
    margin-bottom: 1rem;
}

.thread-detail-tags {
    display: flex;
    gap: .5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.thread-detail-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: .82rem;
    cursor: pointer;
    transition: all .2s var(--ease);
}

.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.action-btn.liked {
    border-color: var(--danger);
    color: var(--danger);
}

/* ── Replies Section ──────────────────────────────────────────────── */
.replies-section {
    margin-bottom: 1.5rem;
}

.replies-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.reply-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .5rem;
}

.reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
    color: var(--bg);
    flex-shrink: 0;
}

.reply-content {
    min-width: 0;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}

.reply-author {
    font-weight: 600;
    color: var(--text-bright);
    font-size: .9rem;
}

.reply-time {
    font-size: .78rem;
    color: var(--text-dim);
}

.reply-body {
    color: var(--text);
    font-size: .9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.reply-actions {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
}

/* ── Reply Composer ───────────────────────────────────────────────── */
.reply-composer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.reply-composer h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: .75rem;
}

.reply-composer textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.reply-composer textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.reply-composer textarea::placeholder {
    color: var(--text-dim);
}

.composer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: .75rem;
}

/* ── Search Results ───────────────────────────────────────────────── */
.search-results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1rem;
}

/* ── Modals ────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn .2s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .25s var(--ease);
}

.modal-sm {
    max-width: 380px;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color .2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* ── Form Elements ────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .4rem;
    margin-top: 1rem;
}

.form-label:first-child {
    margin-top: 0;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239594b0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text);
}

.form-textarea {
    resize: vertical;
    line-height: 1.6;
}

.form-tags {
    margin-top: .5rem;
}

/* ── Forum-specific button overrides ──────────────────────────────── */
.nav-forum {
    background: linear-gradient(135deg, #7c5cff 0%, #5c3cdf 100%) !important;
    color: #fff !important;
    border: none !important;
}

.nav-admin {
    background: linear-gradient(135deg, #c9a55a 0%, #a07830 100%) !important;
    color: #1a0e05 !important;
    border: none !important;
}

/* ── Toast Notifications ──────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.toast {
    padding: .75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .85rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.4);
    animation: toastIn .3s var(--ease);
    max-width: 340px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .forum-header {
        padding: 2rem 0 1.5rem;
    }

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

    .thread-row {
        grid-template-columns: auto 1fr;
        gap: .75rem;
    }

    .thread-replies,
    .thread-last-activity {
        display: none;
    }

    .thread-detail {
        padding: 1.25rem;
    }

    .reply-card {
        grid-template-columns: 1fr;
    }

    .reply-avatar {
        display: none;
    }

    .forum-stats-bar {
        flex-direction: column;
        gap: .75rem;
    }

    .thread-list-header {
        flex-direction: column;
        gap: .5rem;
    }

    .forum-user-bar {
        flex-direction: column;
        gap: .75rem;
        text-align: center;
    }

    .user-bar-left {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .forum-toolbar {
        flex-direction: column;
    }

    .forum-search {
        max-width: none;
    }

    .btn-new-thread {
        width: 100%;
        justify-content: center;
    }

    .thread-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .thread-detail-meta {
        justify-content: center;
    }
}

/* ── Role Badges ─────────────────────────────────── */
.role-tag {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.role-tag.admin {
    background: rgba(124, 92, 255, 0.2);
    color: #a98dff;
    border: 1px solid rgba(124, 92, 255, 0.3);
}
.role-tag.mod {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

/* ── Thread Locked Message ───────────────────────── */
.thread-locked-msg {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: .9rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin-top: 1rem;
}

/* ── Danger / Mod Action Buttons ─────────────────── */
.action-btn.danger {
    color: #f87171;
}
.action-btn.danger:hover {
    background: rgba(248, 113, 113, 0.12);
}
.action-btn.small {
    font-size: .72rem;
    padding: 2px 8px;
}

/* ── Lock Badge in Thread List ───────────────────── */
.lock-badge {
    margin-right: 4px;
}

/* ── Modal Desc ──────────────────────────────────── */
.modal-desc {
    font-size: .88rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* ── Pagination ──────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    flex-wrap: wrap;
}

/* ── User Profile ────────────────────────────── */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: .25rem;
}

.profile-meta {
    font-size: .85rem;
    color: var(--text-dim);
}

.profile-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

.profile-stat strong {
    display: block;
    font-size: 1.4rem;
    color: var(--accent-light);
    font-weight: 700;
}

.profile-stat span {
    font-size: .78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.profile-threads-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1rem;
}

.profile-link {
    color: var(--accent-light);
    text-decoration: none;
    transition: color .2s;
}

.profile-link:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ── Reply Edit Inline ───────────────────────── */
.reply-edit-textarea {
    margin-bottom: .5rem;
}

.reply-edit-actions {
    display: flex;
    gap: .5rem;
}

/* ── Online Indicator ────────────────────────── */
.online-indicator strong {
    color: var(--success) !important;
}

/* ── Notification Bell ─────────────────────────────── */
.notif-bell {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 3px;
}

.notif-badge.hidden { display: none; }

/* ── Notification Panel ────────────────────────────── */
.notif-panel {
    position: fixed;
    top: 72px;
    right: 1rem;
    width: 360px;
    max-height: 60vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp .2s var(--ease);
}

.notif-panel.hidden { display: none; }

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notif-panel-header h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 0;
}

.notif-list {
    overflow-y: auto;
    flex: 1;
    max-height: 50vh;
}

.notif-item {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}

.notif-item:hover { background: var(--bg-card-alt); }

.notif-item.unread {
    border-left: 3px solid var(--accent);
    background: rgba(124, 92, 255, .06);
}

.notif-msg {
    font-size: .85rem;
    color: var(--text);
    margin-bottom: .25rem;
}

.notif-time {
    font-size: .72rem;
    color: var(--text-dim);
}

.notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-dim);
    font-size: .85rem;
}

/* ── Bookmark Button State ────────────────────────── */
.action-btn.bookmarked {
    border-color: var(--gold);
    color: var(--gold);
}

/* ── Formatting Toolbar ────────────────────────────── */
.formatting-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    margin-top: .5rem;
}

.formatting-toolbar + .form-textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}

.fmt-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: .82rem;
    min-width: 28px;
    text-align: center;
    transition: all .15s;
    font-family: inherit;
}

.fmt-btn:hover {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-bright);
}

/* ── Rich Text Body Styles ─────────────────────────── */
.thread-detail-body code,
.reply-body code {
    background: var(--surface);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .85em;
    color: var(--accent-light);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
}

.thread-detail-body pre.code-block,
.reply-body pre.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    font-size: .82rem;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    color: var(--text);
    margin: 1rem 0;
    white-space: pre-wrap;
}

.thread-detail-body blockquote.forum-quote,
.reply-body blockquote.forum-quote {
    border-left: 3px solid var(--accent);
    padding: .5rem 1rem;
    margin: .75rem 0;
    background: rgba(124, 92, 255, .06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-dim);
    font-style: italic;
}

.thread-detail-body ul.forum-list,
.reply-body ul.forum-list {
    padding-left: 1.25rem;
    margin: .5rem 0;
}

.thread-detail-body ul.forum-list li,
.reply-body ul.forum-list li {
    margin-bottom: .25rem;
    color: var(--text);
}

.thread-detail-body h3,
.reply-body h3,
.thread-detail-body h4,
.reply-body h4 {
    color: var(--text-bright);
    margin: 1rem 0 .5rem;
}

.body-link {
    color: var(--accent-light);
    text-decoration: underline;
    text-decoration-color: rgba(169, 141, 255, .4);
    transition: color .2s;
}

.body-link:hover {
    color: var(--gold);
}

@media (max-width: 480px) {
    .notif-panel {
        right: 0;
        left: 0;
        width: auto;
        top: 60px;
        border-radius: 0 0 var(--radius) var(--radius);
    }
}

/* ── Avatar Images ── */
.avatar-img {
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-mini-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-upload-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.avatar-upload-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border);
}

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

.avatar-upload-btn {
    cursor: pointer;
}

/* ── Private Messages ── */
.msg-modal-body {
    padding: 0 !important;
    min-height: 400px;
    max-height: 65vh;
    display: flex;
    flex-direction: column;
}

.msg-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
}

.msg-conversation {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
}

.msg-conversation:hover { background: var(--bg-card-alt); }

.msg-conversation.unread {
    background: rgba(124, 92, 255, .06);
    border-left: 3px solid var(--accent);
}

.msg-conv-info { flex: 1; min-width: 0; }

.msg-conv-name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-bright);
}

.msg-conv-preview {
    font-size: .78rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-conv-time {
    font-size: .68rem;
    color: var(--text-dim);
}

.msg-unread-badge {
    background: var(--accent);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.msg-back-row {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
}

.msg-thread {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-height: 45vh;
}

.msg-bubble {
    max-width: 80%;
    padding: .6rem .9rem;
    border-radius: 12px;
    word-wrap: break-word;
}

.msg-mine {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-theirs {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.msg-text {
    font-size: .85rem;
    line-height: 1.4;
}

.msg-text p { margin: 0; }

.msg-time {
    font-size: .62rem;
    opacity: .6;
    margin-top: .2rem;
    text-align: right;
}

.msg-compose {
    display: flex;
    gap: .5rem;
    padding: .75rem;
    border-top: 1px solid var(--border);
    align-items: flex-end;
}

.msg-compose textarea {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: .5rem;
    font-size: .85rem;
    resize: none;
    font-family: inherit;
}

.msg-compose textarea:focus {
    border-color: var(--accent);
    outline: none;
}
/* ── Subscribed Button ── */
.action-btn.subscribed {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(124, 92, 255, .08);
}

/* ── Edited Tag ── */
.edited-tag {
    font-size: .7rem;
    color: var(--text-dim);
    font-style: italic;
    margin-left: .3rem;
}

/* ── Profile Bio ── */
.profile-bio {
    color: var(--text-dim);
    font-size: .85rem;
    line-height: 1.5;
    margin: .5rem 0;
    max-width: 600px;
    white-space: pre-wrap;
}

/* ── Reply Signature ── */
.reply-signature {
    border-top: 1px solid var(--border);
    margin-top: .75rem;
    padding-top: .5rem;
    font-size: .75rem;
    color: var(--text-dim);
    font-style: italic;
}

/* ── Block Button ── */
.btn-danger-outline {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}
.btn-danger-outline:hover {
    background: rgba(231, 76, 60, .12) !important;
}

