:root {
    /* Colors - Medical Professional Theme (XenForo Style) */
    --bg-main: #E8ECEF; /* Soft silver-gray background */
    --bg-card: #ffffff;
    --bg-header: #1e3a5f; /* Deep trust-inspiring medical blue */
    --text-main: #2c3e50;
    --text-muted: #64748b;
    --text-light: #ffffff;
    --primary: #1e3a5f;
    --primary-light: #e2e8f0;
    --accent: #d32f2f;
    --border: #d1d9e0;
    --table-header-bg: #f4f6f8;
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 12px;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-light: #0ea5e9;
    --accent: #f87171;
    --border: #334155;
    --header-bg: #1e293b;
    --header-text: #f1f5f9;
    --table-header-bg: #0f172a;
}

* {
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-header);
    color: var(--text-light);
    border-bottom: 3px solid #142842;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-light);
    line-height: 1.1;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.logo span {
    font-size: 0.9rem;
    font-weight: 400;
    color: #a0aec0;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-nav a {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Navigation Bar */
.nav-bar {
    background: #142842;
    padding: 0;
}

.nav-bar .container {
    display: flex;
    align-items: center;
}

.nav-link {
    display: inline-block;
    padding: 12px 20px;
    color: #a0aec0;
    font-weight: 600;
    font-size: 0.95rem;
    border-top: 3px solid transparent;
}

.nav-link.active, .nav-link:hover {
    color: var(--text-light);
    background: rgba(255,255,255,0.05);
    border-top-color: #3182ce;
    text-decoration: none;
}

.search-box {
    margin-left: auto;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 6px 12px 6px 30px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    width: 200px;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-box .search-icon {
    position: absolute;
    left: 8px;
    color: rgba(255,255,255,0.5);
    width: 14px;
    height: 14px;
}

/* Main Layout: 2 Columns */
.forum-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    padding: 25px 0;
}

/* Blocks / Categories */
.block {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}

.block-header {
    background: var(--table-header-bg);
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Node List (Table representation) */
.node-list {
    list-style: none;
}

.node-item {
    display: grid;
    grid-template-columns: 60px 1fr 100px 250px;
    border-bottom: 1px solid var(--border);
    padding: 15px;
    align-items: center;
}

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

.node-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary);
}

.node-main {
    padding-right: 15px;
}

.node-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.node-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.node-stats {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.node-stats dl {
    display: flex;
    flex-direction: column;
}

.node-stats dt {
    font-size: 0.8rem;
    text-transform: uppercase;
}

.node-stats dd {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.node-latest {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.latest-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.latest-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latest-date {
    color: var(--text-muted);
}

/* Sidebar Widgets */
.widget {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.widget-header {
    background: var(--table-header-bg);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.widget-content {
    padding: 15px;
}

.widget-list {
    list-style: none;
}

.widget-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
}

.widget-list li:last-child {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #142842;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #142842;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

/* Threads List */
.thread-list {
    list-style: none;
}

.thread-item {
    display: grid;
    grid-template-columns: 50px 1fr 100px 200px;
    border-bottom: 1px solid var(--border);
    padding: 12px 15px;
    align-items: center;
}

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

.thread-icon {
    display: flex;
    justify-content: center;
}

.thread-main .thread-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.breadcrumb a {
    color: var(--text-muted);
}

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

/* Pagination Styles */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    gap: 5px;
    align-items: center;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--bg-main);
    cursor: not-allowed;
    opacity: 0.6;
}

.page-item .page-link:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

/* Professional Post Action Buttons (XenForo / Discourse style) */
.post-actions-bar {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-top: 1px solid var(--border);
    background: transparent;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-transform: capitalize;
}

.action-btn svg {
    stroke-width: 2.2px;
    transition: transform 0.15s ease;
}

.action-btn:hover:not(.disabled) {
    background: rgba(0,0,0,0.04);
    color: var(--text-main);
}

[data-theme="dark"] .action-btn:hover:not(.disabled) {
    background: rgba(255,255,255,0.05);
}

.action-btn:active:not(.disabled) {
    transform: translateY(1px);
}

.action-btn.text-danger:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.action-btn.text-warning:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.action-btn.liked {
    color: var(--primary);
    background: rgba(30, 58, 95, 0.05);
}

[data-theme="dark"] .action-btn.liked {
    color: var(--primary-light);
    background: rgba(56, 189, 248, 0.1);
}

.action-btn.liked svg {
    fill: currentColor;
    stroke: currentColor;
}

.action-btn.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Post Layout */
.post-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.post-author {
    background: var(--table-header-bg);
    padding: 20px 15px;
    border-right: 1px solid var(--border);
    text-align: center;
}

.author-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    margin: 0 auto 15px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
    border-radius: 50%;
    text-decoration: none;
    border: 3px solid #fff;
    box-shadow: var(--shadow-sm);
}

.author-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-main);
    word-break: break-word;
}

.author-badge {
    display: inline-block;
    background: rgba(30, 58, 95, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-content-wrap {
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-width: 0;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-content {
    flex-grow: 1;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.post-content p {
    margin-bottom: 1em;
}

.post-signature {
    margin-top: auto;
}

/* Quote Box inside Post Content */
.quote-block {
    background: var(--table-header-bg);
    border-left: 4px solid var(--primary);
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}



/* Responsive */
@media (max-width: 992px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .node-item {
        grid-template-columns: 50px 1fr;
    }
    .node-stats, .node-latest {
        display: none;
    }
    .thread-item {
        grid-template-columns: 40px 1fr;
    }
    .post-card {
        grid-template-columns: 1fr;
    }
    .post-author {
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 10px 15px;
    }
    .author-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin: 0 15px 0 0;
    }
    .author-badge {
        margin-bottom: 0;
    }
    .post-author > div:not(.author-avatar) {
        display: flex;
        flex-direction: column;
    }
}
