@import url(default.css);
@import url(navbar.css);

body {
    color: #263238;
}

a {
    color: #0d6efd;
}

.page-container {
    max-width: 1100px;
    min-height: calc(100vh - 130px);
    margin: 0 auto;
    padding: 36px 20px;
}

.narrow-container,
.form-container {
    max-width: 850px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-heading h1,
.discussion-card h1,
.topic-form-card h1 {
    margin-bottom: 8px;
}

.page-heading p,
.topic-form-card > p {
    color: #5d6873;
}

.button,
.secondary-button {
    display: inline-block;
    padding: 11px 18px;
    border: 1px solid #0d6efd;
    border-radius: 6px;
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.button {
    background-color: #0d6efd;
    color: #ffffff;
}

.button:hover,
.button:focus {
    background-color: #0b5ed7;
}

.secondary-button {
    background-color: #ffffff;
    color: #0d6efd;
}

.forum-tools {
    margin-bottom: 34px;
    padding: 18px;
    display: flex;
    align-items: end;
    gap: 14px;
    background-color: #ffffff;
    border: 1px solid #d8dee5;
    border-radius: 8px;
}

.forum-tools .button,
.forum-tools .secondary-button {
    white-space: nowrap;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.search-field {
    flex: 1;
}

.form-field label,
#reply-form label {
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #aeb7c0;
    border-radius: 5px;
    background-color: #ffffff;
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #80b3ff;
    border-color: #0d6efd;
}

.input-error {
    border-color: #dc3545;
}

.field-help,
.field-error,
.form-message,
.forum-status,
.replying-to {
    min-height: 18px;
    font-size: 13px;
}

.field-help,
.forum-status {
    color: #6c757d;
}

.field-error,
.form-message {
    color: #b42318;
}

.forum-status {
    margin: -8px 0 12px;
}

.section-title {
    margin: 30px 0 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.category-card,
.topic-row,
.discussion-card,
.reply-card,
.reply-form-section,
.topic-form-card {
    background-color: #ffffff;
    border: 1px solid #d8dee5;
    border-radius: 8px;
}

.category-card {
    width: 100%;
    padding: 20px;
    font: inherit;
    text-align: left;
    color: #263238;
    text-decoration: none;
    cursor: pointer;
}

.category-card:hover,
.category-card:focus {
    border-color: #0d6efd;
}

.category-card p {
    margin: 8px 0 14px;
    color: #5d6873;
    line-height: 1.4;
}

.category-card span,
.post-meta,
.topic-row p,
.reply-header span {
    color: #6c757d;
    font-size: 14px;
}

.topic-list,
.reply-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-row[hidden],
.empty-state[hidden] {
    display: none;
}

.topic-row {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topic-row h3 {
    margin: 8px 0;
}

.topic-row h3 a {
    color: #263238;
    text-decoration: none;
}

.topic-row h3 a:hover,
.topic-row h3 a:focus {
    color: #0d6efd;
    text-decoration: underline;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #e8f1ff;
    color: #0b5ed7;
    font-size: 13px;
    font-weight: bold;
}

.topic-counts {
    min-width: 130px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: #5d6873;
    font-size: 13px;
    text-align: center;
}

.topic-counts strong {
    display: block;
    color: #263238;
    font-size: 17px;
}

.breadcrumb {
    margin-bottom: 18px;
    color: #6c757d;
}

.discussion-card,
.reply-form-section,
.topic-form-card {
    padding: 26px;
}

.discussion-card > p:not(.post-meta),
.reply-card p {
    margin-top: 20px;
    line-height: 1.6;
}

.post-meta {
    margin-top: 8px;
}

.post-actions {
    margin-top: 22px;
    display: flex;
    gap: 16px;
}

.post-actions button,
.post-actions a,
.reply-link {
    border: 0;
    background: none;
    color: #0d6efd;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.delete-form {
    display: inline;
}

.post-image {
    width: 100%;
    max-height: 300px;
    margin-top: 18px;
    border-radius: 7px;
    object-fit: cover;
}

.reply-card {
    padding: 20px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.reply-header p {
    margin-top: 4px;
    color: #6c757d;
    font-size: 13px;
}

.reply-content {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

.reply-content p {
    margin-top: 0;
}

.reply-image {
    width: 110px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
}

.reply-actions {
    display: inline-flex;
    gap: 12px;
    margin-left: 16px;
}

.reply-actions a,
.reply-actions button {
    border: 0;
    background: none;
    color: #0d6efd;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.reply-link {
    display: inline-block;
    margin-top: 14px;
}

.nested-reply {
    margin-left: calc(var(--reply-depth) * 45px);
    border-left: 4px solid #0d6efd;
}

.replying-to-posted {
    color: #5f6b7a;
    font-size: 0.9rem;
    margin: 8px 0;
}

.reply-form-section {
    margin-top: 28px;
}

.reply-form-section h2 {
    margin-bottom: 16px;
}

#reply-form {
    display: grid;
    gap: 10px;
}

.replying-to {
    margin-bottom: 10px;
    color: #0b5ed7;
    font-weight: bold;
}

.empty-state {
    padding: 22px;
    border: 1px dashed #aeb7c0;
    border-radius: 8px;
    background: #ffffff;
    color: #5d6873;
    text-align: center;
}

.topic-form-card > p {
    margin-bottom: 24px;
}

#topic-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-field input {
    width: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}


@media (max-width: 700px) {
    .page-heading,
    .forum-tools,
    .topic-row {
        align-items: stretch;
        flex-direction: column;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .topic-counts {
        justify-content: flex-start;
    }

    .reply-header {
        flex-direction: column;
        gap: 4px;
    }

    .nested-reply {
        margin-left: calc(var(--reply-depth) * 20px);
    }

    .reply-content {
        grid-template-columns: 1fr;
    }

    .reply-image {
        width: 100%;
        height: 180px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }
}
