/* Mind Money - Современный дизайн с сайдбаром слева */

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основные переменные цветов */
:root {
    --primary-bg: #1a1a2e;        /* Тёмно-синий основной фон */
    --secondary-bg: #16213e;      /* Вторичный фон */
    --sidebar-bg: #0f1419;       /* Фон сайдбара */
    --accent-color: #ff6b35;     /* Оранжевый акцент */
    --accent-hover: #ff8c42;     /* Оранжевый при наведении */
    --text-color: #e8e8e8;       /* Светлый текст */
    --text-muted: #a0a0a0;       /* Приглушенный текст */
    --border-color: #2a2a3e;     /* Цвет границ */
    --shadow: rgba(0, 0, 0, 0.3); /* Тень */
    --gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Основные стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Контейнер */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.header {
    background: var(--gradient);
    padding: 1rem 0;
    box-shadow: 0 4px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.logo:hover {
    transform: scale(1.05);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

/* Навигация */
.nav-container {
    display: flex;
}

.nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav a:hover {
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* Бургер-меню */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.burger-line {
    width: 28px;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    position: absolute;
}

.burger-line:nth-child(1) {
    top: 8px;
}

.burger-line:nth-child(2) {
    top: 16px;
}

.burger-line:nth-child(3) {
    top: 24px;
}

/* Анимация бургер-меню */
.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(45deg);
    top: 16px;
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(-45deg);
    top: 16px;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    gap: 0;
    min-height: calc(100vh - 140px);
}

.main-content .container {
    display: flex;
    gap: 0;
    width: 100%;
    padding: 0;
}

/* Сайдбар слева */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    padding: 2rem 1.5rem;
    box-shadow: 4px 0 20px var(--shadow);
    position: sticky;
    top: 80px;
    height: fit-content;
    min-height: calc(100vh - 160px);
    border-right: 2px solid var(--border-color);
}

.sidebar h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    position: relative;
}

.sidebar h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--accent-hover);
}

/* Контент справа */
.content {
    flex: 1;
    background: var(--secondary-bg);
    padding: 2.5rem;
    margin-left: 0;
    min-height: calc(100vh - 160px);
    position: relative;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

/* Заголовки */
h1 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

h2 {
    color: var(--accent-color);
    margin-bottom: 1.2rem;
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Параграфы */
p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Недавние записи в сайдбаре */
.recent-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-posts li {
    margin-bottom: 1.2rem;
    padding: 1rem;
    background: var(--primary-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.recent-posts li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.recent-posts li:hover::before {
    transform: scaleY(1);
}

.recent-posts li:hover {
    transform: translateX(8px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.2);
}

.recent-posts li:last-child {
    margin-bottom: 0;
}

.recent-posts a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: block;
    font-size: 1rem;
    line-height: 1.5;
}

.recent-posts a:hover {
    color: var(--accent-color);
}

/* Кнопки */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
    background: var(--accent-color);
    color: white;
}

/* Footer */
.footer {
    background: var(--sidebar-bg);
    padding: 2rem 0;
    margin-top: auto;
    border-top: 2px solid var(--accent-color);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-nav a:hover {
    color: var(--accent-color);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Стили для записей на странице категории */
.posts-list {
    list-style: none;
    margin-top: 2rem;
}

.post-item {
    background: var(--primary-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.post-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.post-item:hover::before {
    transform: scaleX(1);
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow);
    border-color: var(--accent-color);
}

.post-item h3 {
    margin-bottom: 1rem;
}

.post-item h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item h3 a:hover {
    color: var(--accent-color);
}

.post-item p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.post-item .btn {
    margin-top: 1rem;
}

/* Стили для изображений в записях */
.post-item {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.post-image {
    flex-shrink: 0;
    width: 250px;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    position: relative;
}

.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.post-item:hover .post-image::before {
    opacity: 0.2;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-image img {
    transform: scale(1.1);
}

.post-content {
    flex: 1;
}

/* Стили для статей */
.article-content {
    position: relative;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow);
    transition: transform 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.02);
}

/* Стили для страницы 404 */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-code {
    font-size: 10rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.error-page h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.error-page p {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions {
    margin: 3rem 0;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .burger-menu {
        display: flex;
    }
    
    .nav-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--gradient);
        transition: right 0.3s ease;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-container.active {
        right: 0;
    }
    
    .nav {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .nav a {
        font-size: 1.3rem;
        padding: 1.2rem 2rem;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .main-content .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        min-height: auto;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        order: 2;
    }
    
    .content {
        order: 1;
        margin-left: 0;
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-nav {
        justify-content: center;
    }
    
    .post-item {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .post-image {
        width: 100%;
        height: 250px;
    }
    
    .error-code {
        font-size: 6rem;
    }
    
    .error-page h1 {
        font-size: 2.2rem;
    }
    
    .error-page p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .content,
    .sidebar {
        padding: 1rem;
    }
    
    .nav a {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .logo {
        font-size: 1.6rem;
    }
    
    .error-code {
        font-size: 4rem;
    }
    
    .error-page h1 {
        font-size: 1.8rem;
    }
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.content {
    animation: fadeInUp 0.8s ease-out;
}

.sidebar {
    animation: slideInLeft 0.8s ease-out;
}

/* Улучшения для доступности */
a:focus,
.btn:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Дополнительные эффекты */
.content::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Стили для таблиц */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--primary-bg);
    box-shadow: 0 4px 20px var(--shadow);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

table th {
    background: var(--gradient);
    color: white;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    border-bottom: 2px solid var(--accent-color);
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
}

table tbody tr:hover {
    background: rgba(255, 107, 53, 0.1);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Стили для списков */
ul, ol {
    margin: 20px 0;
    padding-left: 30px;
    line-height: 1.6;
}

ul li, ol li {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 1.1rem;
}

ul li {
    list-style-type: disc;
    color: var(--text-muted);
}

ol li {
    list-style-type: decimal;
    color: var(--text-muted);
}

ul ul, ol ol, ul ol, ol ul {
    margin: 10px 0;
    padding-left: 25px;
}

ul ul li {
    list-style-type: circle;
    color: var(--text-muted);
}

ol ol li {
    list-style-type: lower-alpha;
    color: var(--text-muted);
}

/* Мобильная адаптация для таблиц */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    table thead,
    table tbody,
    table th,
    table td,
    table tr {
        display: block;
    }
    
    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    table tr {
        border: 1px solid var(--border-color);
        margin-bottom: 10px;
        border-radius: 8px;
        padding: 10px;
        background: var(--secondary-bg);
    }
    
    table td {
        border: none;
        position: relative;
        padding-left: 50%;
        padding-top: 8px;
        padding-bottom: 8px;
        white-space: normal;
        text-align: left;
    }
    
    table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: var(--accent-color);
    }
    
    /* Альтернативный вариант для мобильных - горизонтальная прокрутка */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-container table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    ul, ol {
        padding-left: 20px;
    }
    
    ul li, ol li {
        margin-bottom: 10px;
        font-size: 1rem;
    }
    
    table td {
        padding-left: 40%;
        font-size: 13px;
    }
    
    table td:before {
        width: 35%;
        font-size: 12px;
    }
}