/* Палитра в стиле DOS Лексикон */
:root {
    --dos-blue: #0000aa;
    --dos-white: #ffffff;
    --dos-gray: #aaaaaa;
    --dos-black: #000000;
    --dos-cyan: #00aaaa;
    --dos-yellow: #ffff55;
}

body {
    font-family: "Courier New", Courier, Consolas, monospace;
    background-color: var(--dos-blue);
    color: var(--dos-white);
    margin: 0;
    padding: 0;
    font-size: 18px;
    image-rendering: pixelated; /* Отключаем сглаживание для ретро-эффекта */
}

/* Верхняя панель меню */
header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--dos-gray);
    color: var(--dos-black);
    padding: 4px 15px;
    border-bottom: 2px solid var(--dos-white);
    z-index: 10;
    font-weight: bold;
}

header button {
    font-family: inherit;
    font-size: 16px;
    background: var(--dos-gray);
    color: var(--dos-black);
    border: 1px solid var(--dos-black);
    padding: 2px 8px;
    cursor: pointer;
}

header button:active {
    background: var(--dos-black);
    color: var(--dos-gray);
}

.brand-label {
    font-size: 14px;
    color: #555555;
}

.controls {
    display: flex;
    gap: 10px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px 15px 60px 15px; /* Отступ снизу для статус-бара */
}

.hidden { 
    display: none !important; 
}

/* Поиск и Каталог */
.menu-title {
    color: var(--dos-yellow);
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.search-box {
    width: 100%;
    font-family: inherit;
    font-size: 18px;
    padding: 6px;
    margin: 15px 0;
    background: var(--dos-black);
    color: var(--dos-yellow);
    border: 2px solid var(--dos-gray);
    box-sizing: border-box;
}

ul {
    list-style: none;
    padding-left: 2ch;
    margin: 0;
}

li {
    margin: 8px 0;
}

.category-title {
    color: var(--dos-yellow);
    font-weight: bold;
}

.book-link {
    cursor: pointer;
    text-decoration: underline;
}

.book-link:hover {
    color: var(--dos-cyan);
}

.bookmark-label {
    color: var(--dos-cyan);
    font-size: 14px;
}

.empty-search {
    text-align: center;
    color: var(--dos-gray);
    margin-top: 20px;
}

/* Экран читалки */
#reader-screen h2 {
    font-size: 20px;
    color: var(--dos-yellow);
    text-align: center;
    margin: 10px 0;
}

#text-content {
    font-family: "Courier New", Courier, Consolas, monospace;
    white-space: pre-wrap;
    line-height: 1.5;
    margin-top: 15px;
    word-wrap: break-word;
    text-align: justify;
    text-indent: 5%;
}

/* Нижний статус-бар */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--dos-cyan);
    color: var(--dos-black);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-top: 2px solid var(--dos-white);
    font-weight: bold;
    box-sizing: border-box;
}

.status-btn {
    background: transparent;
    border: none;
    color: var(--dos-black);
    font-family: inherit;
    font-size: 18px;
    font-weight: bold;
    padding: 0 20px;
    cursor: pointer;
}

.status-btn:hover {
    background: var(--dos-white);
}

#status-info {
    flex-grow: 1;
    text-align: center;
}

/* Всплывающее DOS-окно оглавления */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Затемнение фона */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.dos-modal {
    background-color: var(--dos-gray);
    color: var(--dos-black);
    border: 4px double var(--dos-white); /* Двойная ретро-рамка */
    width: 90%;
    max-width: 450px;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.5); /* Грубая тень */
}

.modal-header {
    background-color: var(--dos-cyan);
    color: var(--dos-white);
    text-align: center;
    padding: 4px;
    font-weight: bold;
}

.modal-body {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.toc-item {
    padding: 6px;
    cursor: pointer;
    font-weight: bold;
}

.toc-item:hover {
    background-color: var(--dos-blue);
    color: var(--dos-white);
}

.toc-item.active {
    color: var(--dos-blue);
}

.modal-footer {
    font-size: 14px;
    color: #555555;
    text-align: center;
    padding: 6px;
    border-top: 1px dashed var(--dos-black);
}
