/* =============================================
   WoltLab Forum – Frontend Styles
   ============================================= */

:root {
    --wf-primary: #2c3e50;
    --wf-accent:  #3498db;
    --wf-bg:      #f5f6fa;
    --wf-white:   #ffffff;
    --wf-border:  #dce0ea;
    --wf-text:    #2d3436;
    --wf-muted:   #636e72;
    --wf-radius:  6px;
    --wf-shadow:  0 1px 4px rgba(0,0,0,.08);
}

/* ─── Wrap ─────────────────────────────────── */
.wf-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--wf-text);
    font-size: 15px;
}

/* ─── Breadcrumb ─────────────────────────────*/
.wf-breadcrumb {
    padding: 10px 0;
    color: var(--wf-muted);
    font-size: 13px;
    margin-bottom: 12px;
}
.wf-breadcrumb a { color: var(--wf-accent); text-decoration: none; }
.wf-breadcrumb a:hover { text-decoration: underline; }
.wf-bc-sep { margin: 0 6px; }

/* ─── Category Block ─────────────────────────*/
.wf-category { margin-bottom: 32px; }
.wf-category-header {
    background: var(--wf-primary);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--wf-radius) var(--wf-radius) 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.wf-category-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}
.wf-cat-desc { font-size: 12px; opacity: 0.75; }

/* ─── Forum Item ─────────────────────────────*/
.wf-forum-list { background: var(--wf-white); border: 1px solid var(--wf-border); border-top: none; border-radius: 0 0 var(--wf-radius) var(--wf-radius); }
.wf-forum-item {
    display: grid;
    grid-template-columns: 52px 1fr auto 220px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wf-border);
    transition: background .15s;
}
.wf-forum-item:last-child { border-bottom: none; }
.wf-forum-item:hover { background: #f8f9fb; }
.wf-forum-closed { opacity: 0.7; }
.wf-forum-icon {
    width: 48px; height: 48px;
    background: var(--wf-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--wf-accent);
}
.wf-forum-icon .dashicons { font-size: 24px; width: 24px; height: 24px; }
.wf-forum-title { font-size: 16px; font-weight: 600; }
.wf-forum-title a { color: var(--wf-text); text-decoration: none; }
.wf-forum-title a:hover { color: var(--wf-accent); }
.wf-forum-desc { color: var(--wf-muted); font-size: 13px; margin-top: 3px; }
.wf-forum-stats { font-size: 12px; color: var(--wf-muted); margin-top: 5px; display: flex; gap: 14px; }
.wf-forum-last-post { font-size: 12px; color: var(--wf-muted); text-align: right; }
.wf-last-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #aaa; margin-bottom: 3px; }
.wf-last-thread-title { display: block; color: var(--wf-text); font-size: 12px; text-decoration: none; }
.wf-last-thread-title:hover { color: var(--wf-accent); }
.wf-last-meta a { color: var(--wf-accent); text-decoration: none; }
.wf-no-posts { color: #aaa; font-size: 12px; }

/* ─── Forum Footer ───────────────────────────*/
.wf-forum-footer {
    margin-top: 20px;
    background: var(--wf-white);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
    color: var(--wf-muted);
}
.wf-forum-footer a { color: var(--wf-accent); text-decoration: none; }

/* ─── Thread List ────────────────────────────*/
.wf-threadlist-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}
.wf-threadlist-header h2 { margin: 0 0 4px; font-size: 22px; }
.wf-thread-table {
    background: var(--wf-white);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    overflow: hidden;
}
.wf-thread-row {
    display: grid;
    grid-template-columns: 48px 1fr 90px 180px;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--wf-border);
    align-items: center;
}
.wf-thread-row:last-child { border-bottom: none; }
.wf-thread-row:hover { background: #f8f9fb; }
.wf-pinned { background: #fffbf0; }
.wf-thread-closed { opacity: 0.7; }
.wf-thread-icon { text-align: center; color: var(--wf-muted); }
.wf-thread-title { font-size: 15px; font-weight: 600; color: var(--wf-text); text-decoration: none; }
.wf-thread-title:hover { color: var(--wf-accent); }
.wf-thread-meta { font-size: 12px; color: var(--wf-muted); margin-top: 3px; }
.wf-thread-meta a { color: var(--wf-accent); text-decoration: none; }
.wf-thread-stats { font-size: 13px; color: var(--wf-muted); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.wf-thread-lastpost { font-size: 12px; color: var(--wf-muted); text-align: right; }
.wf-last-user { display: block; color: var(--wf-accent); text-decoration: none; font-weight: 600; }
.wf-last-date { font-size: 11px; }

/* ─── Thread View ────────────────────────────*/
.wf-thread-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.wf-thread-title-main { font-size: 22px; margin: 0; }
.wf-thread-actions-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ─── Post ───────────────────────────────────*/
.wf-posts-list { display: flex; flex-direction: column; gap: 0; }
.wf-post {
    display: grid;
    grid-template-columns: 160px 1fr;
    border: 1px solid var(--wf-border);
    border-bottom: none;
    background: var(--wf-white);
}
.wf-post:first-child { border-radius: var(--wf-radius) var(--wf-radius) 0 0; }
.wf-post:last-child { border-bottom: 1px solid var(--wf-border); border-radius: 0 0 var(--wf-radius) var(--wf-radius); }
.wf-post-author {
    background: #f5f6fa;
    padding: 18px 14px;
    border-right: 1px solid var(--wf-border);
    text-align: center;
}
.wf-avatar {
    border-radius: 50%;
    width: 70px; height: 70px;
    object-fit: cover;
    border: 3px solid var(--wf-border);
}
.wf-author-name { font-weight: 700; font-size: 14px; margin-top: 8px; }
.wf-author-name a { color: var(--wf-text); text-decoration: none; }
.wf-author-name a:hover { color: var(--wf-accent); }
.wf-author-title { font-size: 12px; color: var(--wf-muted); }
.wf-author-rank {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: .5px;
}
.wf-author-stats { font-size: 11px; color: var(--wf-muted); margin-top: 6px; line-height: 1.7; }
.wf-post-body { padding: 16px 20px; display: flex; flex-direction: column; }
.wf-post-header {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--wf-muted);
    border-bottom: 1px solid var(--wf-border);
    padding-bottom: 8px; margin-bottom: 14px;
}
.wf-post-num { margin-left: auto; font-weight: 600; }
.wf-edited { font-style: italic; font-size: 11px; }
.wf-post-content { line-height: 1.7; flex: 1; }
.wf-post-content pre.wf-code { background: #1e2228; color: #abb2bf; padding: 14px; border-radius: 4px; overflow-x: auto; font-size: 13px; }
.wf-post-content blockquote.wf-quote { border-left: 4px solid var(--wf-accent); padding: 8px 14px; margin: 10px 0; background: #f8f9ff; border-radius: 0 4px 4px 0; }
.wf-post-content blockquote.wf-quote cite { font-size: 12px; color: var(--wf-muted); font-style: normal; font-weight: 600; display: block; margin-bottom: 4px; }
.wf-post-content img.wf-bbimg { max-width: 100%; border-radius: 4px; }
.wf-post-content details.wf-spoiler summary { cursor: pointer; color: var(--wf-accent); font-size: 13px; }
.wf-signature { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--wf-border); font-size: 13px; color: var(--wf-muted); }
.wf-sig-divider { display: none; }
.wf-post-actions { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-like-btn {
    background: none; border: 1px solid var(--wf-border);
    border-radius: 50px; padding: 4px 12px; cursor: pointer;
    font-size: 13px; transition: all .2s;
    display: flex; align-items: center; gap: 5px;
}
.wf-like-btn:hover, .wf-like-btn.wf-liked { background: #ffedf0; border-color: #e74c3c; color: #e74c3c; }
.wf-like-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wf-edit-form { margin-top: 14px; }

/* ─── Quick Reply ────────────────────────────*/
.wf-quick-reply {
    margin-top: 24px;
    background: var(--wf-white);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 20px;
}
.wf-quick-reply h3 { margin: 0 0 12px; font-size: 16px; }

/* ─── BBCode Editor ──────────────────────────*/
.wf-editor-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 6px;
    background: #f0f1f4;
    border: 1px solid var(--wf-border);
    border-bottom: none;
    border-radius: var(--wf-radius) var(--wf-radius) 0 0;
}
.wf-bbcode-btn {
    padding: 4px 10px;
    background: var(--wf-white);
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}
.wf-bbcode-btn:hover { background: var(--wf-accent); color: #fff; border-color: var(--wf-accent); }
.wf-editor {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid var(--wf-border);
    border-radius: 0 0 var(--wf-radius) var(--wf-radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}
.wf-editor:focus { outline: none; border-color: var(--wf-accent); }

/* ─── Buttons ────────────────────────────────*/
.wf-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 16px;
    border-radius: var(--wf-radius);
    border: 1px solid var(--wf-border);
    background: var(--wf-white);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: var(--wf-text);
    transition: all .15s;
}
.wf-btn:hover { border-color: var(--wf-accent); color: var(--wf-accent); }
.wf-btn-primary { background: var(--wf-accent); color: #fff; border-color: var(--wf-accent); }
.wf-btn-primary:hover { background: #2980b9; color: #fff; }
.wf-btn-danger { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.wf-btn-danger:hover { background: #c0392b; }
.wf-btn-sm { padding: 4px 10px; font-size: 12px; }
.wf-btn-lg { padding: 12px 24px; font-size: 15px; }

/* ─── Badges ─────────────────────────────────*/
.wf-badge {
    display: inline-flex; align-items: center;
    font-size: 10px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: #f0f0f0; color: #555;
}
.wf-closed { background: #fdf1f1; color: #e74c3c; }
.wf-open   { background: #edfbf5; color: #27ae60; }
.wf-private{ background: #f0f4ff; color: #3498db; }
.wf-featured{background: #fffbf0; color: #e67e22; }

/* ─── Pagination ─────────────────────────────*/
.wf-pagination { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px 0; }
.wf-pagination-inline { margin: 0; }
.wf-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 8px;
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    text-decoration: none;
    color: var(--wf-text); font-size: 13px;
    background: var(--wf-white);
}
.wf-page-btn:hover { border-color: var(--wf-accent); color: var(--wf-accent); }
.wf-page-active { background: var(--wf-accent); color: #fff; border-color: var(--wf-accent); }

/* ─── Notices ────────────────────────────────*/
.wf-notice {
    padding: 12px 16px;
    border-radius: var(--wf-radius);
    background: #edf5ff;
    border: 1px solid #c5deff;
    color: #1a5276;
    margin: 12px 0;
    font-size: 14px;
}
.wf-notice-success { background: #edfbf5; border-color: #a3e0c1; color: #1e8449; }
.wf-notice-warn    { background: #fffbf0; border-color: #f9d87c; color: #7d6608; }
.wf-notice-error   { background: #fdf1f1; border-color: #f5a9a9; color: #922b21; }

/* ─── Profile ────────────────────────────────*/
.wf-welcome {
    background: linear-gradient(135deg, var(--wf-primary), var(--wf-accent));
    color: #fff; padding: 20px 24px; border-radius: var(--wf-radius);
    margin-bottom: 24px; line-height: 1.6;
}
.wf-profile-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.wf-profile-card {
    background: var(--wf-white); border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius); padding: 24px; text-align: center;
}
.wf-profile-avatar-wrap { margin-bottom: 12px; }
.wf-profile-avatar-wrap .wf-avatar { width: 120px; height: 120px; }
.wf-profile-name { font-size: 20px; margin: 0 0 4px; }
.wf-profile-title { color: var(--wf-muted); font-size: 13px; margin: 0 0 8px; }
.wf-profile-rank {
    display: inline-block; border: 2px solid; padding: 2px 12px;
    border-radius: 50px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; margin-bottom: 14px;
}
.wf-profile-stats { display: flex; justify-content: center; gap: 20px; margin-bottom: 14px; }
.wf-profile-stats div { display: flex; flex-direction: column; }
.wf-profile-stats strong { font-size: 22px; color: var(--wf-accent); }
.wf-profile-stats span { font-size: 11px; color: var(--wf-muted); }
.wf-profile-info-list { list-style: none; margin: 0 0 16px; padding: 0; font-size: 13px; color: var(--wf-muted); text-align: left; line-height: 2; }
.wf-profile-info-list a { color: var(--wf-accent); text-decoration: none; }
.wf-profile-edit-btn { width: 100%; justify-content: center; margin-bottom: 14px; }
.wf-profile-link label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--wf-muted); }
.wf-profile-link input { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 11px; border: 1px solid var(--wf-border); border-radius: 4px; background: #f8f9fb; }
.wf-profile-main { display: flex; flex-direction: column; gap: 20px; }
.wf-profile-section { background: var(--wf-white); border: 1px solid var(--wf-border); border-radius: var(--wf-radius); padding: 20px; }
.wf-profile-section h3 { margin: 0 0 14px; font-size: 16px; border-bottom: 1px solid var(--wf-border); padding-bottom: 8px; }
.wf-recent-threads { list-style: none; margin: 0; padding: 0; }
.wf-recent-threads li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--wf-border); font-size: 13px; }
.wf-recent-threads li:last-child { border-bottom: none; }
.wf-recent-threads a { color: var(--wf-accent); text-decoration: none; }
.wf-date { color: var(--wf-muted); font-size: 12px; white-space: nowrap; }
.wf-no-data { color: var(--wf-muted); font-size: 13px; }

/* ─── Forms ──────────────────────────────────*/
.wf-form-table { width: 100%; border-collapse: collapse; }
.wf-form-table th { width: 160px; text-align: left; padding: 10px 12px 10px 0; font-size: 13px; vertical-align: top; }
.wf-form-table td { padding: 8px 0; }
.wf-form-group { margin-bottom: 16px; }
.wf-form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.wf-input { padding: 8px 12px; border: 1px solid var(--wf-border); border-radius: var(--wf-radius); font-size: 14px; font-family: inherit; }
.wf-input:focus { outline: none; border-color: var(--wf-accent); }
.wf-input-full { width: 100%; box-sizing: border-box; }
.wf-form-hint { font-size: 12px; color: var(--wf-muted); margin-top: 4px; }
.wf-form-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; }

/* ─── New Thread ─────────────────────────────*/
.wf-new-thread-wrap { max-width: 780px; }
.wf-new-thread-wrap h2 { margin: 0 0 20px; font-size: 20px; }
select { padding: 8px 10px; border: 1px solid var(--wf-border); border-radius: var(--wf-radius); font-size: 14px; }

/* ─── Responsive ─────────────────────────────*/
@media (max-width: 768px) {
    .wf-forum-item { grid-template-columns: 44px 1fr; }
    .wf-forum-last-post { display: none; }
    .wf-thread-row { grid-template-columns: 36px 1fr; }
    .wf-thread-lastpost { display: none; }
    .wf-post { grid-template-columns: 1fr; }
    .wf-post-author { display: flex; flex-direction: row; gap: 12px; align-items: center; text-align: left; border-right: none; border-bottom: 1px solid var(--wf-border); }
    .wf-profile-layout { grid-template-columns: 1fr; }
}
