/* --- Root Variables --- */
:root {
    --bg-color: #1a1a1d;
    --panel-bg-color: #2c2c31;
    --text-color: #f5f5f5;
    --text-muted-color: #9e9e9e;
    --accent-color: #00d1b2;
    --accent-color-hover: #00ffe1;
    --border-color: #444;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* --- General Styles & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-wrap: break-word; /* <--- ВОТ ИСПРАВЛЕНИЕ. Эта строка решает проблему с прокруткой. */
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5rem; margin-top: 2rem;}
h3 { font-size: 1.6rem; }

p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color-hover);
    text-decoration: underline;
}

ul, ol {
    padding-left: 20px;
    margin-bottom: 1.2rem;
}

li {
    margin-bottom: 0.5rem;
}

code {
    background-color: var(--panel-bg-color);
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* --- Layout --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-layout {
    display: grid;
    grid-template-columns: 220px 1fr 240px;
    gap: 30px;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* --- Header --- */
header {
    background-color: var(--panel-bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin-bottom: 0; /* Override default margin */
}

header nav a {
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

header nav a:hover {
    color: var(--accent-color-hover);
    border-bottom-color: var(--accent-color-hover);
}

/* --- Sidebars --- */
.left-sidebar, .right-sidebar {
    background-color: var(--panel-bg-color);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    align-self: start; /* Sticks to the top */
    min-width: 0; /* Fix for grid children overflow */
}

.left-sidebar h3, .right-sidebar h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.left-sidebar ul {
    list-style: none;
    padding-left: 0;
}

.left-sidebar li {
    margin-bottom: 10px;
}

.right-sidebar .news-item {
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.right-sidebar .news-item:last-child {
    border-bottom: none;
}
.right-sidebar p {
    font-size: 0.95rem;
    color: var(--text-muted-color);
}

/* --- Main Content --- */
main section {
    margin-bottom: 3rem;
}
main {
    min-width: 0; /* Fix for grid children overflow */
}


.feature-block {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 2rem;
}

.feature-image {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.faq-item, blockquote {
    background-color: var(--panel-bg-color);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

blockquote footer {
    margin-top: 1rem;
    font-style: normal;
    font-weight: 600;
    color: var(--text-muted-color);
}


/* --- Form Styles --- */
.contact-form {
    background-color: var(--panel-bg-color);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 209, 178, 0.3);
}
.contact-form button {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.contact-form button:hover {
    background-color: var(--accent-color-hover);
}

/* --- Widgets --- */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.chat-widget:hover {
    transform: scale(1.1);
}

/* --- Footer --- */
footer {
    background-color: var(--panel-bg-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted-color);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr; /* Теперь только одна колонка */
    }
    
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    
    /* Сайдбары и основной контент теперь идут друг под другом */
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }

    .feature-block {
        flex-direction: column;
        text-align: center;
    }
}