/* Основные стили */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: #333;
    color: #fff;
    padding: 10px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Отступы по бокам */
}

.logo .logo-img {
    width: 50px;
    height: 50px;
    /*background: url('{% static 'notes/images/logo.png' %}') no-repeat center;*/
    background-size: contain;
}

.mainmenu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.mainmenu ul li {
    margin-left: 20px;
}

.mainmenu ul li a {
    color: #fff;
    text-decoration: none;
}

.main-content {
    display: flex;
    flex: 1;
/*    padding: 20px; /* Отступы по бокам */
    gap: 10px
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
/*    height: 100vh; /* Высота боковой панели будет равна высоте окна браузера */
}

.content {
    flex: 1;
    margin-top: 6px; /* Добавляем отступ от шапки */
}

.footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    margin-top: auto;
}


/* Основные стили для списка статей */
.list-articles {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.article-panel {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.article-panel .first,
.article-panel .last {
    margin: 0;
}

.article-image {
    margin-bottom: 15px;
}

.article-image img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    float: left;
    padding: 0 10px 10px 0;
}

.article-title {
    margin-top: 0;
    margin-bottom: 15px;
}

.article-title-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.article-title-link:hover {
    opacity: 0.8;
}


.article-title a {
    color: #333;
    text-decoration: none;
}

.article-title a:hover {
    color: #007bff;
}

.article-content {
    margin-bottom: 20px; /* Отступ снизу */
    padding: 15px; /* Внутренние отступы */
    background: #fff; /* Фон */
    border: 1px solid #ddd; /* Граница */
    border-radius: 8px; /* Скругление углов */
    overflow: hidden; /* Скрывает содержимое, выходящее за пределы блока */
}


.link-read-post {
    text-align: right;
}

.link-read-post a {
    color: #007bff;
    text-decoration: none;
}

.link-read-post a:hover {
    text-decoration: underline;
}

/* Стили для пагинации */
.list-pages {
    text-align: center;
    margin-top: 20px;
}

.list-pages ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 10px;
}

.list-pages .page-num {
    display: inline-block;
}

.list-pages .page-num a,
.list-pages .page-num-selected {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.list-pages .page-num a:hover {
    background: #f8f9fa;
}

.list-pages .page-num-selected {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}


/* Общий контейнер для категорий и тегов */
.scrollable-sidebar {
    /*height: 80vh; /* Ограничиваем высоту контейнера */
    overflow-y: auto; /* Включаем вертикальную прокрутку */
    display: flex;
    flex-direction: column;
}

/* Категории */
.categories {
    position: sticky;
    top: 0;
/*    margin-top: 10px;
    margin-bottom: 20px; */
    padding: 10px;
}

.categories p {
    font-weight: bold;
    margin-bottom: 10px;
}

.categories-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    word-wrap: break-word;
    white-space: normal;
}

.categories-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-container ul li {
    margin-bottom: 10px;
}

.categories-container ul li a {
    text-decoration: none;
    color: #333;
}

.categories-container ul li a:hover {
    color: #007bff;
}

.categories-container ul li.selected {
    font-weight: bold;
    color: #007bff;
}


/* Теги */
.tags {
    position: sticky;
    bottom: 0;
    margin-top: 20px;
    padding: 10px;
}

.tags p {
    font-weight: bold;
    margin-bottom: 10px;
}

.tags-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    word-wrap: break-word;
    white-space: normal;
    max-width: 200px; /* Ограничиваем максимальную ширину контейнера с тегами */
}

.tags-container span {
    display: inline-block;
    margin-right: 10px;
    cursor: pointer;
}

.tags-container span:hover {
    color: #007bff;
}
/* Стили для списка тегов */
.tags-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tags-list li {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
}

.tags-list li a {
    text-decoration: none;
    color: #333;
}

.tags-list li a:hover {
    color: #007bff;
}

.ck-content {
    overflow: hidden; /* Скрывает содержимое, выходящее за пределы блока */
    padding-bottom: 20px; /* Добавляет отступ снизу */
}

.ck-content img {
    max-width: 100%; /* Ограничивает ширину картинки */
    max-height: 100%; /* Ограничивает высоту картинки */
    height: auto; /* Сохраняет пропорции */
    object-fit: cover; /* Обрезает картинку, чтобы она не выходила за пределы */
}

.actions {
    display: flex;
    justify-content: flex-end;
}

.actions > * + * {
    margin-left: 10px; /* Разделяет ссылки небольшим промежутком */
}



/* Стили для формы */
form {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Отступ между элементами формы */
}

.form-field {
    margin-bottom: 5px; /* Отступ между полями */
}

.form-label {
    display: block; /* Метка занимает всю ширину */
    font-weight: bold;
    margin-bottom: 5px; /* Отступ между меткой и полем ввода */
}


form p {
/*    display: flex; */
    align-items: center; /* Выравнивание по вертикали */
    margin: 0; /* Убираем отступы у параграфов */
}

form input,
form textarea {
/*    flex: 1; /* Поля ввода занимают оставшееся пространство */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

form textarea {
    resize: both; /* Разрешаем изменение высоты textarea по вертикали и горизонтали*/
    width: 600px;
    height: 200px;
}


.form-error {
    color: red;
    font-size: 0.9em;
    margin-top: 5px;
}


.

.hidden-field {
    display: none;
}

.alert {
    padding: 10px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-error {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* Стили для комментариев */
.comments-section {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.comment {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
    color: #6c757d;
}

/* Стили для тела комментария */
.comment-body {
    padding: 15px;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    line-height: 1.5;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Дополнительные стили для статуса модерации */
.comment-body small {
    display: block;
    margin-top: 10px;
    color: #dc3545;
    font-style: italic;
}

.add-comment textarea {
    width: 100%;
    min-height: 100px;
    margin-bottom: 10px;
}

/* Стили для сообщений */
.messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.alert {
    position: relative;
    padding: 15px 35px 15px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    opacity: 1;
    transition: opacity 0.5s;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* кнопки */
.comment-actions {
    display: flex;
    gap: 8px; /* Отступ между кнопками */
    margin-top: 10px;
    flex-wrap: wrap; /* Если не хватает места - перенос на новую строку */
}

.comment-actions a {
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

/* Стандартный стиль (старый) */
button[type="submit"] {
    align-self: flex-start;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

/* Компактный стиль (новый) */
.btn-compact-danger {
    text-decoration: none;
    padding: 0.25rem 0.5rem !important; 
    font-size: 0.875rem !important;
    line-height: 1.5;
    border-radius: 0.2rem !important;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    color: #fff;
    background-color: #dc3545 !important; /* Красный цвет */
    border-color: #dc3545;
}


.btn-compact-green {
    text-decoration: none;
    padding: 0.25rem 0.5rem !important; 
    font-size: 0.875rem !important;
    line-height: 1.5;
    border-radius: 0.2rem !important;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-compact-blue {
    text-decoration: none;
    padding: 0.25rem 0.5rem !important; 
    font-size: 0.875rem !important;
    line-height: 1.5;
    border-radius: 0.2rem !important;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}


.btn-compact:hover {
    filter: brightness(90%);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}



.btn-danger:hover {
    background-color: #c82333 !important; /* Тёмно-красный при наведении */
}


/* Эффекты при наведении */
.comment-actions a:hover {
    filter: brightness(90%);
}


/* Основные стили страницы "О проекте" */
.about-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-subtitle {
    color: #666;
    font-size: 1.2rem;
}

.about-section {
    margin-bottom: 3rem;
}

.section-title {
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Стили для технологического стека */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tech-category {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.tech-title {
    color: #2c3e50;
    margin-top: 0;
}

/* Стили для timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-date {
    font-weight: bold;
    color: #3498db;
}

/* Новые стили для ошибок 403\404\500 */
/* Стили для страниц ошибок */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem;
    text-align: center;
}

.error-content {
    max-width: 600px;
    margin: 0 auto;
}

.error-code {
    font-size: 6rem;
    font-weight: bold;
    color: #e74c3c;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.error-message {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    border: 1px solid #3498db;
    color: #3498db;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
}

.error-debug {
    margin-top: 3rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: left;
    font-family: monospace;
    font-size: 0.9rem;
}


.views-icon {
    display: inline-block;
    margin-right: 3px;
    font-size: 0.9em;
    opacity: 0.7;
}