/* Общие стили */
html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    color: #333;
    background: #f5f5dc;
}

/* Шапка сайта */
.site-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo-area {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo i {
    font-size: 28px;
    color: #4dabf7;
}

.logo-text {
    background: linear-gradient(90deg, #4dabf7, #74c0fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Главное меню - перемещено влево */
.main-nav {
    margin-left: 50px;
    flex-grow: 1;
}

.main-nav ul.mainmenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
    justify-content: flex-start;
}

.main-nav ul.mainmenu li {
    margin: 0;
}

.main-nav ul.mainmenu li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: block;
}

.main-nav ul.mainmenu li a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* User area - кнопка выхода в правом верхнем углу */
.user-area {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.user-info i {
    font-size: 22px;
    color: #74c0fc;
}

.user-info a.fas.fa-user-circle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
}

.user-info a.fas.fa-user-circle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: white;
}

.user-info .username {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.logout-form {
    display: inline;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.auth-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-login, .btn-register {
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-login {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.btn-register {
    background: #4dabf7;
    color: white;
    border: 1px solid #4dabf7;
}

.btn-register:hover {
    background: #339af0;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Основная структура */
.site-container {
    display: flex;
    min-height: calc(100vh - 70px);
    max-width: 1400px;
    margin: 0 auto;
}

/* Сайдбар */
.sidebar {
    width: 280px;
    background: #f5deb3;
    border-right: 1px solid #e9ecef;
    padding: 25px 20px;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 16px;
    color: #495057;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4dabf7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-title i {
    color: #4dabf7;
}

/* ИСПРАВЛЕНИЕ: Категории - делаем горизонтальные списки вертикальными */
.categories-list-wrapper .list-group.list-group-horizontal {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.categories-list-wrapper .list-group.list-group-horizontal li {
    width: 100% !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    float: none !important;
}

.categories-list-wrapper .list-group.list-group-horizontal .list-group-item {
    width: 100% !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
    border: 1px solid #e9ecef !important;
    background: #f8f9fa !important;
    padding: 12px 15px !important;
    color: #495057 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.categories-list-wrapper .list-group.list-group-horizontal .list-group-item:hover {
    background: #e7f5ff !important;
    color: #1e3c72 !important;
    border-color: #4dabf7 !important;
    transform: translateX(5px) !important;
    text-decoration: none !important;
}

/* Иконки в категориях */
.categories-list-wrapper .list-group.list-group-horizontal .list-group-item i {
    width: 20px;
    text-align: center;
    color: #868e96;
    font-size: 14px;
}

.categories-list-wrapper .list-group.list-group-horizontal .list-group-item:hover i {
    color: #4dabf7;
}

/* Активная/выбранная категория */
.categories-list-wrapper .list-group.list-group-horizontal .list-group-item.active {
    background: linear-gradient(90deg, #e7f5ff 0%, #d0ebff 100%) !important;
    color: #1e3c72 !important;
    border-color: #1e3c72 !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.1) !important;
}

/* Улучшенные стили для тегов */
.tags-wrapper ul.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tags-wrapper ul.tags-list li {
    margin: 0;
    padding: 0;
}

.tags-wrapper ul.tags-list li a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tags-wrapper ul.tags-list li a:hover {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    color: white;
    border-color: #4dabf7;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.3);
}

.tags-wrapper ul.tags-list li a:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(77, 171, 247, 0.2);
}

.sidebar-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: #868e96;
    font-size: 14px;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 30px;
    background: #faebd7;
}

.content-wrapper {
    background: ffe4c4;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    min-height: calc(100vh - 160px);
}

.content-area {
    margin-top: 20px;
}

/* Сохранение оригинальных стилей с обновлением */
a {
    color: #1e3c72;
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: #4dabf7;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

img.img-article-left {
    max-width: 300px;
    max-height: 400px;
    height: auto;
    float: left;
    padding: 0 20px 20px 0;
    border-radius: 8px;
    object-fit: cover;
}

img.img-article-left.thumb {
    max-width: 150px;
    height: auto;
}

/* Улучшенная кнопка "Читать статью" */
p.link-read-post {
    text-align: right;
    margin-top: 20px;
}

p.link-read-post a {
    padding: 12px 28px;
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.3);
    border: 2px solid transparent;
}

p.link-read-post a:hover {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 171, 247, 0.4);
    border-color: #1c7ed6;
}

p.link-read-post a:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(77, 171, 247, 0.3);
}

/* Добавляем иконку стрелки к кнопке "Читать статью" если есть Font Awesome */
p.link-read-post a::after {
    content: '→';
    font-size: 18px;
    transition: transform 0.3s ease;
}

p.link-read-post a:hover::after {
    transform: translateX(4px);
}

div.article-panel {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: inline-flex;
    gap: 20px;
    align-items: center;
    color: #495057;
    border-left: 4px solid #4dabf7;
    font-size: 14px;
}

ul.list-articles {
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.list-articles li {
    padding: 25px 0;
    border-bottom: 1px solid #e9ecef;
    overflow: hidden;
    clear: both;
}
ul.list-articles li:last-child {
    border-bottom: none;
}

/* Хлебные крошки */
ul.breadcrumbs {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

ul.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 10px;
}

ul.breadcrumbs li a {
    color: #495057;
    text-decoration: none;
}
ul.breadcrumbs li a:hover {
    color: #1e3c72;
}

ul.breadcrumbs li:after {
    content: "›";
    color: #868e96;
}

ul.breadcrumbs li.last:after {
    content: "";
}

/* Исправленная пагинация - кликабельна вся область */
.list-pages {
    text-align: center;
    margin: 40px 0 20px 0;
}

.list-pages ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.list-pages li {
    margin: 0;
    padding: 0;
}

.list-pages a {
    color: #495057;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    font-weight: 500;
}

.list-pages a:hover {
    border-color: #4dabf7;
    color: #1e3c72;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.list-pages .page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    font-weight: 500;
}

.list-pages .page-num-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
}

/* Формы */
.form-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-error ul {
    list-style: none;
    padding: 15px;
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 6px;
    color: #c92a2a;
}

.form-button {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.2);
}

/* Адаптивность */
@media (max-width: 992px) {
    .site-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .main-content {
        padding: 20px;
    }

    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px;
    }

    .main-nav {
        margin-left: 0;
        width: 100%;
        order: 3;
    }

    .main-nav ul.mainmenu {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        margin: 10px 0;
    }
}

@media (max-width: 768px) {
    .user-info, .auth-links {
        flex-direction: column;
        gap: 10px;
    }

    .content-wrapper {
        padding: 20px;
    }

    /* Категории на мобильных */
    .categories-list-wrapper .list-group.list-group-horizontal .list-group-item {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }

    /* Теги на мобильных */
    .tags-wrapper ul.tags-list li a {
        padding: 6px 12px;
        font-size: 13px;
    }
}
