/* ============================================
   forum.css — Professional Career Club Forum
   ============================================ */

/* Theme Colors & Global Typography */
:root {
    --primary: #19293D;
    --primary-dark: #101c2b;
    --accent: #F2930E;
    --accent-light: #ffaa33;
    --text: #3a4a5c;
    --text-muted: #5a6a7a;
    --bg: #ffffff;
    --bg-soft: #f0f4f8;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --success: #2e7d5f;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(25, 41, 61, 0.09);
    --shadow-lg: 0 12px 48px rgba(25, 41, 61, 0.13);

    --primary-color: #F2930E;
    /* enhanced vibrant orange */
    --primary-hover: #d6800c;
    --secondary-color: #19293D;
    /* dark navy */
    --bg-color: #f8f9fa;
    /* light grey background */
    --card-bg: #ffffff;
    --text-dark: #333333;
}

body.forum-page {
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background: var(--bg-soft);
    line-height: 1.6;
    overflow-x: hidden;
}

.forum-page-main {
    width: 100%;
    margin: 0 auto;
}

/* Tailwind utility mappings for Bootstrap 5 */
.rounded-xl {
    border-radius: 0.75rem !important;
}

.transition-shadow {
    transition: box-shadow 0.2s ease-in-out;
}

.hover-shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-orange-50 {
    background-color: #fff7ed !important;
}

.bg-orange-100 {
    background-color: #ffedd5 !important;
}

.text-primary {
    color: #F2930E !important;
}

/* FORUM HERO */
.forum-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #22527a 100%);
    padding: 80px 48px 0;
    color: #fff;
}

.forum-hero-inner {
    max-width: 1240px;
    margin: 0 auto;
}

.forum-hero-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 40px;
    flex-wrap: wrap;
}

.forum-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(242, 147, 14, 0.18);
    border: 1px solid rgba(242, 147, 14, 0.35);
    color: var(--accent-light);
    padding: 5px 13px;
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 14px;
}

.forum-hero h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(28px, 3.5vw, 46px);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: 12px;
    color: #fff;
}

.forum-hero p {
    font-size: 15.5px;
    color: rgba(255, 255, 255, 0.75);
    max-width: 480px;
}

.forum-hero-stats {
    display: flex;
    gap: 36px;
}

.fhs-num {
    font-family: 'DM Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-light);
}

.fhs-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

/* COMPOSE BAR */
.compose-bar-wrapper {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(25, 41, 61, 0.08);
}

.compose-bar {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 48px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.compose-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.compose-input-fake {
    flex: 1;
    padding: 11px 18px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 14.5px;
    color: var(--text-muted);
    background: var(--bg-soft);
    cursor: pointer;
    transition: border-color .2s;
    user-select: none;
}

.compose-input-fake:hover {
    border-color: var(--primary);
    background: #fff;
}

.btn-gold {
    padding: 10px 22px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    display: inline-block;
    white-space: nowrap;
}

.btn-gold:hover {
    background: #d9840d;
    color: #fff;
}

/* MAIN LAYOUT */
.forum-body {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 48px 64px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

/* ── FILTERS / SORT ── */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.sort-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 4px;
}

.sort-tab {
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    border: none;
    background: transparent;
    text-decoration: none;
}

.sort-tab.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.sort-tab:hover:not(.active) {
    background: var(--bg-soft);
    color: var(--primary-dark);
}

.results-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* POST CARDS */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 12px;
    transition: all .2s;
    cursor: pointer;
    display: flex;
    gap: 16px;
    position: relative;
}

.post-card:hover {
    box-shadow: var(--shadow);
    border-color: #8ea4bc;
    transform: translateY(-1px);
}

.post-vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 38px;
    padding-top: 2px;
}

.vote-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all .15s;
}

.vote-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.vote-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.post-main {
    flex: 1;
}

.post-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.post-cat-tag {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: rgba(25, 41, 61, 0.08);
    color: var(--primary);
    text-decoration: none;
}

.post-author {
    font-size: 12.5px;
    color: var(--text-muted);
}

.post-author a {
    color: inherit;
    text-decoration: none;
}

.post-author a:hover {
    color: var(--primary-color);
}

.post-time {
    font-size: 12px;
    color: var(--text-muted);
}

.post-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.35;
    margin-bottom: 5px;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 12px;
    font-weight: 400;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
}

.post-reactions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.reaction {
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 12.5px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reaction:hover {
    background: #fff;
    border-color: var(--primary);
}

/* PINNED / FEATURED POST */
.featured-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    background: rgba(242, 147, 14, 0.12);
    padding: 2px 9px;
    border-radius: 100px;
}

/* ── SIDEBAR ── */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.sc-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-body {
    padding: 14px 18px;
}

/* Categories sidebar */
.cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Custom Scrollbar for Cat List */
.cat-list::-webkit-scrollbar {
    width: 5px;
}

.cat-list::-webkit-scrollbar-track {
    background: var(--bg-soft);
    border-radius: 10px;
}

.cat-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.cat-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    color: var(--text);
}

.cat-item:hover {
    background: var(--bg-soft);
}

.cat-item.active {
    background: rgba(25, 41, 61, 0.07);
}

.cat-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-emoji {
    font-size: 16px;
}

.cat-name {
    font-size: 13.5px;
    font-weight: 500;
}

.cat-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 2px 9px;
    border-radius: 100px;
}

/* Rules sidebar */
.rule-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.rule-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rule-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    min-width: 20px;
}

.rule-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Stats sidebar */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-soft);
    border-radius: 8px;
}

.stat-num {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Custom Pagination */
.pagination-wrapper nav {
    width: 100%;
    display: flex;
    justify-content: center;
}

.pagination-wrapper .d-sm-flex.align-items-sm-center.justify-content-sm-between>div:first-child,
.pagination-wrapper p.text-muted,
.pagination-wrapper p.leading-5 {
    display: none !important;
    /* Hides the 'Showing 1 to 10...' text */
}

.pagination-wrapper .d-sm-flex.align-items-sm-center.justify-content-sm-between>div:last-child {
    width: 100%;
    display: flex;
    justify-content: center;
}

.pagination {
    margin: 0;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-item .page-link {
    border-radius: 8px !important;
    border: 1px solid var(--border);
    color: var(--primary);
    background: var(--bg-card);
    font-weight: 600;
    font-size: 13.5px;
    padding: 8px 16px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.page-item:not(.active):not(.disabled) .page-link:hover {
    background: var(--bg-soft);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 10px rgba(242, 147, 14, 0.25);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--bg-soft);
    border-color: var(--border);
    opacity: 0.7;
}

/* Pagination Info Text (Showing X to Y...) */
.d-flex.justify-content-between.flex-fill.d-sm-none {
    display: none !important;
}

.pagination-wrapper .text-muted {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted) !important;
}

@media (max-width: 576px) {
    .pagination {
        gap: 4px;
    }

    .page-item .page-link {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Compose Modal */
.forum-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 28, 43, 0.55);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.forum-modal-overlay.open {
    display: flex;
}

.forum-modal {
    margin: auto;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: block;
}

.forum-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forum-modal-header h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #19293D;
    margin-bottom: 0;
}

.forum-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    font-size: 20px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.forum-modal-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.forum-modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.form-select,
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: all .2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-file {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    color: #1e293b;
    background: #fff;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    border-color: #19293D;
    box-shadow: 0 0 0 3px rgba(25, 41, 61, 0.08);
}

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

.forum-modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal-ghost {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all .2s;
}

.btn-modal-ghost:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-modal-primary {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    cursor: pointer;
    transition: all .2s;
}

.btn-modal-primary:hover {
    background: #d9840d;
    box-shadow: 0 4px 10px rgba(242, 147, 14, 0.25);
    transform: translateY(-1px);
}

@media (max-width: 960px) {
    .forum-hero {
        padding: 40px 20px 0;
    }

    .compose-bar {
        padding: 14px 20px;
    }

    .forum-body {
        padding: 24px 20px 48px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .sidebar {
        order: -1;
        width: 100%;
    }

    .forum-feed {
        width: 100%;
        order: 2;
    }

    .cat-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .forum-hero-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .forum-hero-stats {
        width: 100%;
        justify-content: space-between;
    }

    .compose-bar {
        flex-direction: column;
        padding: 16px;
    }

    .compose-bar form {
        width: 100%;
    }

    .btn-gold {
        width: 100%;
        text-align: center;
    }

    .feed-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        justify-content: space-between;
    }

    .cat-list {
        grid-template-columns: 1fr;
    }

    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .post-reactions {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
}


/* Existing Reaction Picker Styling integrated */
.reaction-container {
    position: relative;
    display: inline-block;
}

.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border-radius: 40px;
    padding: 5px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: row;
    gap: 8px;
    z-index: 1000;
    margin-bottom: 15px;
    border: 1px solid #eee;
    animation: slideUpFade 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reaction-container:hover .reaction-picker,
.reaction-picker.show {
    display: flex;
}

.reaction-option {
    position: relative;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
    border: none;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-option:hover {
    transform: scale(1.6) translateY(-12px);
    background: rgba(0, 0, 0, 0.03);
}

/* Custom Black Tooltip for Reaction */
.reaction-option::after {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 1100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.reaction-option:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-15px);
}

.like-btn-main {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
    cursor: pointer;
}

.like-btn-main:hover {
    background: #f1f5f9;
    color: var(--secondary-color);
}

.like-btn-main.active {
    color: var(--primary-color);
}