body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

header {
    background: #333;
    color: #fff;
    padding-top: 20px;
    min-height: 70px;
    border-bottom: #0779e4 3px solid;
}

header a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 16px;
}

header h1 {
    float: left;
    margin-top:0;
}
header h1 a {
    font-size: 24px;
}

header nav {
    float: right;
    margin-top: 10px;
}

header nav a {
    padding: 0 10px;
}

main {
    padding: 20px 0;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.error, .error-messages { /* Объединил .error и .error-messages */
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.error-messages ul {
    margin: 0;
    padding-left: 20px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* Стили для списка категорий и форумов */
.category-box {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.category-box h2 {
    margin-top: 0;
    color: #0779e4;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.category-description {
    font-size: 0.9em;
    color: #666;
    margin-bottom:15px;
}

.forum-list, .topic-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.forum-list th, .topic-list th {
    background: #eef;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
}

.forum-list td, .topic-list td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top; /* Для лучшего выравнивания, если контент разной высоты */
}

.forum-info h3, .topic-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}
.forum-info h3 a, .topic-info h3 a {
    text-decoration: none;
    color: #337ab7;
}
.forum-info h3 a:hover, .topic-info h3 a:hover {
    text-decoration: underline;
}
.forum-description, .topic-info small {
    font-size: 0.85em;
    color: #777;
}
.forum-stats, .topic-stats {
    text-align: center;
    width: 80px;
}
.forum-last-post, .topic-last-post {
    font-size: 0.85em;
    color: #555;
    width: 220px; /* Увеличил ширину для нового контента */
    line-height: 1.4;
}
.forum-last-post a, .topic-last-post a { /* Ссылки внутри .forum-last-post и .topic-last-post */
    font-weight: bold;
    color: #337ab7;
    text-decoration: none;
}
.forum-last-post a:hover, .topic-last-post a:hover {
    text-decoration: underline;
}
.forum-last-post small, .topic-last-post small {
    display: block;
    color: #777;
}


/* Стили для постов */
.post-list {
    margin-top: 20px;
}
.post-item {
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    border-radius: 4px;
    display: flex;
}
.post-author {
    padding: 15px;
    background: #f9f9f9;
    border-right: 1px solid #eee;
    width: 180px;
    min-width: 180px;
    font-size: 0.9em;
}
.post-author strong {
    color: #0779e4;
    font-size: 1.1em;
}
.post-author .admin-badge {
    color: red;
    font-weight: bold;
}
.post-content {
    padding: 15px;
    flex-grow: 1;
    word-wrap: break-word;
}
.post-actions {
    padding: 5px 15px;
    text-align: right;
    font-size: 0.9em;
    border-top: 1px solid #f0f0f0;
}
.post-actions .action-link {
    margin-left: 10px;
    color: #007bff;
    text-decoration: none;
}
.post-actions .action-link:hover {
    text-decoration: underline;
}
.post-actions .delete-link {
    color: #dc3545;
}
.text-muted {
    color: #6c757d !important;
    font-size: 0.8em;
}


.button {
    display: inline-block;
    background: #0779e4;
    color: #fff !important; /* !important чтобы перебить другие стили ссылок */
    padding: 8px 15px;
    text-decoration: none !important;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}
.button:hover {
    background: #055aab;
    color: #fff !important;
    text-decoration: none !important;
}

.button-small { /* Для кнопок администрирования темы */
    padding: 5px 10px;
    font-size: 0.9em;
    margin-left: 10px;
}

/* Стили для форм */
.form-styled div {
    margin-bottom: 10px;
}
.form-styled label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-styled input[type="text"],
.form-styled input[type="email"],
.form-styled input[type="password"],
.form-styled textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-styled textarea {
    min-height: 150px;
    resize: vertical;
}

/* Пагинация */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    margin-top: 20px;
    justify-content: center;
}
.page-item {
    margin: 0 2px;
}
.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}
.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    /* margin-left: -1px; Убрал, т.к. есть page-item margin */
    line-height: 1.25;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
}
.page-link:hover {
    z-index: 2;
    color: #0056b3;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Стили для BBCode */
.blockquote {
    border-left: 4px solid #ccc;
    padding: 10px 15px;
    margin: 15px 0;
    background-color: #f9f9f9;
    font-style: italic;
}
.blockquote-author {
    font-style: normal;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.code-block {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 10px;
    margin: 10px 0;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.inline-code {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 1px 4px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    border-radius: 3px;
}

/* Стили для модераторских действий */
.topic-sticky td {
    background-color: #f8f9fa;
}
.sticky-icon, .locked-icon {
    margin-right: 5px;
    color: #6c757d;
    cursor: default;
}
.notice-locked {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 10px 15px;
    margin-top: 20px;
    border-radius: 4px;
    text-align: center;
}
.topic-admin-actions {
    margin: 15px 0;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
}


.bbcode-toolbar {
    margin-bottom: 5px;
    padding: 5px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-bottom: none; 
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.bbcode-toolbar button {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 3px 7px;
    margin-right: 3px;
    cursor: pointer;
    font-size: 0.9em;
    border-radius: 3px;
}
.bbcode-toolbar button:hover {
    background-color: #e9e9e9;
    border-color: #bbb;
}

.form-styled textarea.with-bbcode-toolbar { /* Применяется к textarea, у которых есть панель */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: -1px; /* Чтобы плотнее прилегало, если есть border у toolbar */
}

/* Стили для BBCode (если еще не добавлены полностью) */
.blockquote {
    border-left: 4px solid #ccc;
    padding: 10px 15px;
    margin: 15px 0;
    background-color: #f9f9f9;
    font-style: italic;
}
.blockquote-author {
    font-style: normal;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.code-block {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 10px;
    margin: 10px 0;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    overflow-x: auto; 
    white-space: pre-wrap; 
    word-wrap: break-word; 
}
.inline-code {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 1px 4px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    border-radius: 3px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.admin-table th,
.admin-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.admin-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.admin-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
}
.admin-nav ul li {
    display: inline-block; /* Расположить пункты меню в ряд */
    margin-right: 15px;
}
.admin-nav ul li a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}
.admin-nav ul li a:hover {
    text-decoration: underline;
}

.admin-content {
    margin-top: 20px;
}
.button-secondary {
    background-color: #6c757d; /* Серый цвет, например */
    /* Унаследует остальные стили от .button */
}
.button-secondary:hover {
    background-color: #5a6268;
}
/* style.css */
.profile-container {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.profile-info p {
    margin-bottom: 8px;
}
.profile-info strong {
    min-width: 150px; /* Чтобы метки были одной ширины */
    display: inline-block;
}

/* style.css */
.profile-edit-forms form {
    margin-bottom: 30px;
}
.profile-edit-forms hr {
    margin: 30px 0;
}