/* ==============================================================================
 * CIPD Assignment Help Community Forum - Custom Styles
 * Matches CIPD Assignment UK Design Language
 * ============================================================================== */

:root {
    --cipd-primary: #0b6291;
    --cipd-primary-dark: #08486b;
    --cipd-purple: #85439a;
    --cipd-green: #84b81b;
    --cipd-green-dark: #0f8217;
    --cipd-text: #1e293b;
    --cipd-muted: #64748b;
    --cipd-light-bg: #f8fafc;
    --cipd-border: #e2e8f0;
    --cipd-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body.forum-body {
    background-color: var(--cipd-light-bg);
    color: var(--cipd-text);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
}

/* Forum Header Hero */
.forum-hero {
    background: linear-gradient(135deg, #0b6291 0%, #08486b 60%, #85439a 100%);
    color: #ffffff;
    padding: 45px 0 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(11, 98, 145, 0.15);
}

.forum-hero h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.forum-hero,
.forum-hero h1,
.forum-hero p {
    color: #ffffff !important;
}

.forum-hero p {
    font-size: 16px;
    color: #ffffff !important;
    opacity: 0.95;
    margin-bottom: 25px;
    max-width: 720px;
    line-height: 1.6;
}

/* Search Box */
.forum-search-box {
    position: relative;
    max-width: 650px;
}

.forum-search-box input {
    height: 52px;
    border-radius: 26px;
    padding-left: 24px;
    padding-right: 120px;
    font-size: 15px;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    color: #1e293b;
    width: 100%;
}

.forum-search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(132, 184, 27, 0.5);
}

.forum-search-box button {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 42px;
    border-radius: 21px;
    padding: 0 24px;
    background: var(--cipd-green);
    color: #ffffff;
    border: none;
    font-weight: 700;
    transition: all 0.2s;
}

.forum-search-box button:hover {
    background: var(--cipd-green-dark);
}

/* Filter Bar & Pills */
.forum-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--cipd-border);
    margin-bottom: 20px;
    box-shadow: var(--cipd-card-shadow);
}

.forum-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.forum-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cipd-muted);
    background: #f1f5f9;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.forum-pill:hover,
.forum-pill.active {
    background: var(--cipd-primary);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(11, 98, 145, 0.25);
}

.forum-pill.level-3.active { background: #0284c7; }
.forum-pill.level-5.active { background: var(--cipd-purple); }
.forum-pill.level-7.active { background: #d97706; }

/* Tabs (Latest, Most Answered, Popular) */
.forum-tabs {
    display: flex;
    gap: 15px;
    border-bottom: 2px solid var(--cipd-border);
    margin-bottom: 20px;
}

.forum-tab-link {
    padding: 10px 16px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--cipd-muted);
    text-decoration: none;
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.forum-tab-link:hover,
.forum-tab-link.active {
    color: var(--cipd-primary);
    border-bottom-color: var(--cipd-primary);
    text-decoration: none;
}

/* Question Cards */
.forum-q-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--cipd-border);
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: var(--cipd-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.forum-q-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(11, 98, 145, 0.08);
    border-color: #cbd5e1;
}

.forum-q-card.is-pinned {
    border-left: 4px solid var(--cipd-purple);
    background: #faf8fc;
}

.forum-q-card.is-resolved {
    border-left: 4px solid var(--cipd-green);
}

.forum-q-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}

.forum-q-author-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forum-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13.5px;
    flex-shrink: 0;
}

.forum-author-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 13.5px;
}

.forum-role-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 5px;
}

.forum-role-badge.tutor { background: #e0f2fe; color: #0369a1; }
.forum-role-badge.moderator { background: #f3e8ff; color: #7e22ce; }
.forum-role-badge.admin { background: #fef2f2; color: #b91c1c; }
.forum-role-badge.member { background: #f1f5f9; color: #475569; }

.forum-post-date {
    color: var(--cipd-muted);
    font-size: 12.5px;
}

/* Badges */
.badge-level {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-level.level-3 { background: #e0f2fe; color: #0284c7; }
.badge-level.level-5 { background: #f3e8ff; color: #85439a; }
.badge-level.level-7 { background: #fef3c7; color: #d97706; }

.badge-category {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Question Title & Content */
.forum-q-title {
    font-size: 18px;
    font-weight: 700;
    color: #0b6291;
    margin: 0 0 10px;
    line-height: 1.4;
}

.forum-q-title a {
    color: #0b6291;
    text-decoration: none;
    transition: color 0.15s;
}

.forum-q-title a:hover {
    color: var(--cipd-purple);
    text-decoration: none;
}

.forum-q-snippet {
    color: #475569;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Question Footer & Stats */
.forum-q-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--cipd-muted);
}

.forum-tags-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.forum-tag-item {
    font-size: 12px;
    background: #f8fafc;
    color: #0b6291;
    padding: 2px 9px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
}

.forum-tag-item:hover {
    background: #e0f2fe;
    text-decoration: none;
}

.forum-stats-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.forum-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.forum-stat-item.answers-highlight {
    color: var(--cipd-green-dark);
    font-weight: 700;
}

/* Sidebar Widgets */
.forum-widget {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--cipd-border);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--cipd-card-shadow);
}

.forum-widget-title {
    font-size: 16px;
    font-weight: 800;
    color: #0b6291;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* CTA Ask Question Button */
.btn-ask-forum {
    background: linear-gradient(135deg, #84b81b 0%, #0f8217 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 15px rgba(15, 130, 23, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-ask-forum:hover {
    background: linear-gradient(135deg, #0f8217 0%, #09590f 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 130, 23, 0.35);
}

/* Threaded Discussions (Answers & Replies) */
.forum-answer-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--cipd-border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--cipd-card-shadow);
}

.forum-answer-card.is-accepted {
    border-left: 4px solid var(--cipd-green);
    background: #fcfffa;
}

.forum-accepted-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.forum-reply-thread {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    margin-left: 30px;
}

.forum-reply-item {
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 13.5px;
}

/* Upvote Buttons */
.btn-upvote {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-upvote:hover,
.btn-upvote.voted {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #0284c7;
}

/* Breadcrumbs */
.forum-breadcrumb {
    background: transparent;
    padding: 12px 0;
    margin-bottom: 0;
    font-size: 13px;
}

.forum-breadcrumb a {
    color: var(--cipd-primary);
    text-decoration: none;
}

.forum-breadcrumb a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .forum-hero h1 { font-size: 24px; }
    .forum-hero p { font-size: 14px; }
    .forum-reply-thread { margin-left: 10px; }
    .forum-filter-bar { flex-direction: column; gap: 12px; align-items: flex-start; }
    .forum-q-footer { flex-direction: column; gap: 10px; align-items: flex-start; }
}
