/* ── ForumPi Styles ─────────────────────────────────────── */

:root {
    --forum-primary: #5a6fd6;
    --forum-secondary: #6a4190;
    --forum-bg: #f1f3f8;
    --forum-text: #2d3748;
    --forum-muted: #718096;
    --forum-border: #dde1ea;
    --forum-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

body {
    background-color: var(--forum-bg);
    color: var(--forum-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: linear-gradient(135deg, var(--forum-primary), var(--forum-secondary)) !important;
    border-bottom: none;
}

.navbar-brand {
    font-size: 1.15rem;
    letter-spacing: -0.3px;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    border-radius: 10px;
    border: 1px solid var(--forum-border);
    box-shadow: var(--forum-card-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-body {
    font-size: 0.9rem;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ── Category Cards ─────────────────────────────────────── */
.category-card {
    border: 1px solid var(--forum-border);
    border-radius: 10px;
    transition: all 0.2s ease;
    background: white;
}

[data-bs-theme="light"] .category-card {
    background: white;
}

.category-card:hover {
    border-color: var(--forum-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── List Groups ────────────────────────────────────────── */
.list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0 !important;
    transition: background-color 0.15s ease;
}

.list-group-item:first-child {
    border-radius: 12px 12px 0 0 !important;
}

.list-group-item:last-child {
    border-radius: 0 0 12px 12px !important;
}

.list-group-item:hover {
    background-color: rgba(102, 126, 234, 0.04);
}

/* ── Avatars ────────────────────────────────────────────── */
.avatar img {
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ── Post Cards ─────────────────────────────────────────── */
.post-card {
    border-radius: 10px !important;
    overflow: hidden;
}

.post-sidebar {
    background: linear-gradient(180deg, var(--bg-tertiary, #f8f9fa) 0%, var(--bg-body, #ffffff) 100%);
}

/* ── Post Content ───────────────────────────────────────── */
.post-content {
    line-height: 1.7;
}

.post-content h1, .post-content h2, .post-content h3 {
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
}

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

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.25rem;
}

.post-content blockquote {
    border-left: 4px solid var(--forum-primary);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 0 8px 8px 0;
    color: var(--forum-muted);
}

.post-content code {
    background: rgba(102, 126, 234, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.post-content th, .post-content td {
    padding: 0.5rem 1rem;
    border: 1px solid var(--forum-border);
}

.post-content th {
    background: rgba(102, 126, 234, 0.05);
    font-weight: 600;
}

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

.post-content a {
    color: var(--forum-primary);
    text-decoration: underline;
}

.post-content hr {
    border-color: var(--forum-border);
    margin: 1.5rem 0;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--forum-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--forum-primary), var(--forum-secondary));
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6, #6a4190);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-outline-primary {
    border-color: var(--forum-primary);
    color: var(--forum-primary);
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background: var(--forum-primary);
    border-color: var(--forum-primary);
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    padding: 0.3em 0.55em;
    border-radius: 5px;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: var(--forum-card-shadow);
    font-size: 0.9rem;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.82rem;
}

.breadcrumb-item a {
    color: var(--forum-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--forum-muted);
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
    margin-top: auto;
    font-size: 0.82rem;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .post-sidebar {
        display: none !important;
    }

    .post-card .card-body {
        padding: 1rem !important;
    }

    .p-5 {
        padding: 2rem !important;
    }

    .d-flex.gap-4 {
        gap: 1rem !important;
    }

    img.rounded-circle {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.post-card {
    animation: fadeIn 0.3s ease forwards;
}

/* ── Heading sizes ──────────────────────────────────────── */
h1 { font-size: 1.25rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }
h4 { font-size: 0.9rem; }
h5 { font-size: 0.85rem; }
h6 { font-size: 0.8rem; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--forum-bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
