* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    transition: none;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    display: grid;
    grid-template-columns: 350px 1fr 200px;
    min-height: 100vh;
}

/* Левая секция - поиск (увеличена ширина) */
.left-section {
    background-color: #ffffff;
    padding: 25px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

/* Центральная секция - основной контент */
.center-section {
    padding: 40px;
    background-color: #f9f9f9;
    overflow-y: auto;
    min-width: 0; /* Для корректного сжатия */
}

/* Правая секция - навигация по страницам */
.right-section {
    background-color: #ffffff;
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

/* Навигация по страницам */
.pages-nav {
    margin-bottom: 20px;
}

.pages-nav h3 {
    margin-bottom: 15px;
    color: #6c757d;
    text-align: center;
    font-size: 18px;
}

.pages-list {
    list-style: none;
}

.pages-list li {
    margin-bottom: 10px;
}

.pages-list a {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: #4a90e2;
    border-radius: 6px;
    transition: all 0.3s;
    text-align: center;
    font-size: 15px;
    border: 1px solid #e1e8ed;
    transition: opacity 0.4s ease;
}

.pages-list a:hover {
    background-color: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

/* Поиск в левой секции - увеличен */
.search-container {
    display: flex;
    width: 100%;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 25px;
    background-color: #f8f9fa;
    border: 1px solid #e1e8ed;
}

#search-input {
    flex-grow: 1;
    padding: 16px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    background-color: transparent;
    color: #333;
}

#search-input::placeholder {
    color: #6c757d;
}

#search-button {
    background-color: #4a90e2;
    border: none;
    padding: 16px 22px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

#search-button:hover {
    background-color: #3a7bc8;
}

/* Стили для div с id - растягивается до низа с прокруткой */
#search-results {
    flex: 1;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    overflow-y: auto;
    min-height: 0;
    font-size: 14px;
    line-height: 1.5;
}

#search-result {
  margin-bottom: 1em;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.highlight {
  display: block;
  margin-top: 5px;
  color: #333;
}

/* Дополнительные стили для лучшего отображения */
.search-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.search-suggestion {
    padding: 10px 15px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
    cursor: pointer;
    transition: all 0.2s;
}

.search-suggestion:hover {
    background-color: #e3f2fd;
    transform: translateX(5px);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 32px;
}

h2 {
    text-align: center;
    font-weight: bold;
    color: #4a90e2;
    margin: 25px 0 15px 0;
    padding: 12px;
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
}

p {
    margin-bottom: 15px;
    text-align: justify;
    font-size: 16px;
    line-height: 1.7;
}

ul {
    margin-bottom: 15px;
    padding-left: 25px;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
}

a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 22px; /* Увеличен padding */
    text-decoration: none;
    color: #333;
    border-radius: 10px; /* Мягкие закругления */
    transition: all 0.3s ease;
    font-size: 17px; /* Увеличен размер шрифта */
    font-weight: 500;
    background-color: #f0f4ff; /* Лёгкий фон */
    border: 1px solid #d0e0ff;
    position: relative;
    overflow: hidden;
}

a:hover {
    background-color: #4a90e2;
    color: white;
    border-color: #4a90e2;
    transform: translateY(-2px); /* Подъём при наведении */
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3); /* Тень */
}

#search-results a::before {
    content: "🔍"; /* Пример иконки (можно заменить) */
    margin-right: 8px;
    font-size: 18px;
    transition: all 0.3s ease;
}

#search-results a:hover::before {
    transform: rotate(15deg);
}

.no-find-results {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 20px;
    background-color: #fff3f3;
    border: 2px dashed #ffcccc;
    border-radius: 12px;
    color: #d9534f;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(255, 77, 76, 0.15);
    transition: all 0.3s ease;
    transition: opacity 0.4s ease;
}

.no-find-results:hover {
    background-color: #d9534f;
}

/* СТИЛИ ДЛЯ ТАБЛИЦ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 16px;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    transition: background-color 0.3s ease;
}

th {
    background-color: #4a90e2;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 14px;
}

td {
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

tr:nth-child(even) {
    background-color: #f8fbff;
}

tr:hover {
    background-color: #edf5ff;
    transform: scale(1.005);
    transition: all 0.2s ease;
}

select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    outline: none;
    background-color: white;
    color: #333;
    transition: all 0.3s ease;
}

select:focus { /* 1e90ff */
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}


button {
    background-color: #f9f9f9;
    border: 1px solid #4a90e2;
    border-radius: 5px;
}

/* Адаптивность: для маленьких экранов */
@media screen and (max-width: 768px) {
    table {
        font-size: 15px;
    }

    th,
    td {
        padding: 12px 10px;
    }
}

@media screen and (max-width: 600px) {
    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 10px 8px;
    }

    th {
        font-size: 13px;
    }
}

#themeChange {
    width: 100%;
    padding: 5px;
    text-align: center;
}

#themeChange:active {
    transform: scale(0.9);
}


/* 🌙 Тёмная тема */
[theme="dark"] {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }

    .left-section,
    .center-section,
    .right-section {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    .left-section {
        box-shadow: rgba(255, 255, 255, 0.1);
    }

    .center-section {
        background-color: #2a2a2a;
    }

    .right-section {
        box-shadow: rgba(255, 255, 255, 0.1);
    }

    .search-container {
        background-color: #2a2a2a;
        border-color: #444;
    }

    #search-input {
        color: #e0e0e0;
        background-color: #2a2a2a;
        border: none;
    }

    #search-input::placeholder {
        color: #aaa;
    }

    #search-button {
        background-color: #4a90e2;
        color: #fff;
    }

    #search-button:hover {
        background-color: #3a7bc8;
    }

    #search-results {
        background-color: #2a2a2a;
        border-color: #444;
    }

    .search-suggestion {
        background-color: #333;
        border-left-color: #4a90e2;
    }

    .search-suggestion:hover {
        background-color: #444;
    }

    h1, h2, h3 {
        color: #e0e0e0;
    }

    h2 {
        background-color: rgba(74, 144, 226, 0.2);
        border-left-color:#4a90e2;
    }

    p, ul, li {
        color: #e0e0e0;
    }

    a {
        color: #4a90e2;
        background-color: #333;
        border-color: #444;
        box-shadow: rgba(74, 144, 226, 0.3);
    }

    a:hover {
        background-color: #4a90e2;
        color: #fff;
        border-color: #4a90e2;
    }

    .pages-list a {
        color: #4a90e2;
        border-color: #444;
    }

    .pages-list a:hover {
        background-color: #4a90e2;
        color: #fff;
        border-color: #4a90e2;
    }

    .no-find-results {
        background-color: #333;
        border-color: #ffcccc;
        color: #d9534f;
        box-shadow: rgba(217, 83, 79, 0.5);
    }

    .no-find-results::before {
        color: #d9534f;
    }

    select {
        background-color: #333;
        color: #e0e0e0;
        border-color: #555;
    }

    select:focus {
        border-color: #4a90e2;
        box-shadow: rgba(74, 144, 226, 0.2);
        background-color: #444;
    }

    button {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    /* === СТИЛИ ДЛЯ ТАБЛИЦ В ТЁМНОЙ ТЕМЕ === */
    table {
        background-color: #2d2d2d;
        border-color: #444;
        box-shadow: rgba(0, 0, 0, 0.3);
    }

    th {
        background-color: #3a7bc8;
        color: white;
        border-bottom-color: #555;
    }

    td {
        color: #e0e0e0;
        border-bottom-color: #444;
    }

    tr:nth-child(even) {
        background-color: #252525;
    }

    tr:hover {
        background-color: #333;
    }

    #themeChange:hover {
        box-shadow: rgba(74, 144, 226, 0.3);
    }
}

/* Адаптивность для очень маленьких экранов */
@media screen and (orientation: portrait) {
    .container {
        grid-template-columns: 1fr; /* Все элементы в один столбец */
        padding: 10px;
    }

    .left-section, .right-section {
        grid-column: 1; /* Размещаем все в первом столбце */
        margin-bottom: 20px;
    }

    .search-container {
        flex-direction: column;
        width: 100%;
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
        border-radius: 25px;
        overflow: hidden;
        background-color: #f8f9fa;
        border: 1px solid #e1e8ed;
        margin-bottom: 30px; /* Увеличен отступ */
    }

    #search-input {
        width: 100%;
        padding: 20px 25px; /* Увеличен padding */
        font-size: 18px; /* Увеличен шрифт */
        border-bottom: 1px solid #ddd;
    }

    #search-button {
        width: 100%;
        padding: 20px 25px; /* Увеличен padding */
        font-size: 20px; /* Увеличен шрифт */
        margin-top: 0;
        border-top: 1px solid #ddd;
    }

    .pages-list a {
        font-size: 16px; /* Увеличен шрифт */
        padding: 15px 20px; /* Увеличен padding */
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .pages-list a:hover {
        transform: translateY(-3px); /* Подъём при наведении */
        box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25); /* Тень */
    }

    .center-section {
        min-height: 200vh;
        padding: 25px;
    }

    h1, h2, h3 {
        font-size: 1.4em;
    }

    ul, ol {
        padding-left: 18px;
    }

    code {
        font-size: 15px;
    }
}