/* Основные стили для тела страницы в современном лофт-стиле */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    font-size: 16px;
    color: #e9e9e9;
}

body {
    min-height: 100vh;
    transition: background 0.4s;
}

/* Заголовок в стиле лофт */
.loft-title {
    text-align: center;
    color: #bb86fc;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 8px rgba(187,134,252,0.10);
    transition: color 0.3s;
    animation: fadeIn 1s cubic-bezier(0.4,0,0.2,1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Секция для алфавитных ссылок */
.loft-section {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.2em 0.7em;
    background: linear-gradient(135deg, #23234a 60%, #2a2a40 100%);
    border-radius: 1.2em;
    box-shadow: 0 4px 16px rgba(26, 33, 62, 0.13);
    animation: fadeIn 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* Кнопки в стиле из owner.css (для алфавита) */
.button {
    display: inline-block;
    padding: 0.8em 1.7em;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #1e90ff 60%, #bb86fc 100%);
    text-decoration: none;
    border-radius: 0.8em;
    box-shadow: 0 2px 8px rgba(30,144,255,0.10);
    font-weight: 500;
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
    outline: none;
    border: none;
    cursor: pointer;
    margin: 0.2em 0.1em;
    letter-spacing: 0.01em;
}

.button:hover, .button:focus {
    background: linear-gradient(135deg, #bb86fc 60%, #1e90ff 100%);
    box-shadow: 0 4px 16px rgba(30,144,255,0.18);
    transform: translateY(-2px) scale(1.04);
    color: #fff;
}

/* Кнопка "Назад" в современном лофт-стиле */
.loft-button {
    display: block;
    margin: 1.5em auto 1em auto;
    padding: 0.8em 1.7em;
    background: linear-gradient(135deg, #8b7d6b 60%, #bb86fc 100%);
    color: #fff;
    border: none;
    border-radius: 0.8em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 125, 107, 0.13);
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
}

.loft-button:hover, .loft-button:focus {
    background: linear-gradient(135deg, #bb86fc 60%, #8b7d6b 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 12px rgba(139, 125, 107, 0.18);
}

.loft-button i {
    margin-right: 8px;
}

/* Таблица статистики в современном лофт-стиле */
.loft-table {
    width: 60%;
    margin: 2.2em auto 1.2em auto;
    border-collapse: collapse;
    border-radius: 1.2em;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(26, 33, 62, 0.13);
    background: linear-gradient(135deg, #23234a 60%, #2a2a40 100%);
    font-size: 1.1rem;
    animation: fadeIn 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* Заголовок таблицы */
.loft-table thead {
    background: linear-gradient(135deg, #8b7d6b 60%, #bb86fc 100%);
    color: #fff;
    text-align: left;
}

/* Ячейки таблицы */
.loft-table th, .loft-table td {
    padding: 1em 1.2em;
    border-bottom: 1px solid #4a4035;
    font-weight: 400;
}

/* Четные строки таблицы */
.loft-table tr:nth-child(even) {
    background: rgba(44,44,44,0.7);
    color: #e9e9e9;
}

/* Нечетные строки таблицы */
.loft-table tr:nth-child(odd) {
    background: rgba(60,60,60,0.7);
    color: #e9e9e9;
}

/* Эффект при наведении на строки таблицы */
.loft-table tr:hover {
    background: #4a4035;
    transform: scale(1.02);
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

/* Общее количество книг в современном лофт-стиле */
.loft-counter {
    font-weight: 600;
    color: #bb86fc;
    text-align: center;
    margin-top: 1.2em;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(187,134,252,0.10);
}

/* Контейнер для карточек книг в виде сетки */
.loft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 2em;
    padding: 1.5em 0.5em 2em 0.5em;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* Карточка книги в современном лофт-стиле */
.loft-card {
    background: linear-gradient(135deg, #23234a 60%, #2a2a40 100%);
    border-radius: 1.2em;
    box-shadow: 0 6px 16px rgba(26, 33, 62, 0.18);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    padding-bottom: 1.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 420px;
}

.loft-card:hover, .loft-card:focus-within {
    transform: translateY(-7px) scale(1.03);
    box-shadow: 0 12px 32px rgba(187,134,252,0.18);
}

/* Изображение в карточке */
.loft-card-image {
    width: 100%;
    height: 260px;
    object-fit: contain;
    border-bottom: 2px solid #4a4035;
    background: #23234a;
    transition: box-shadow 0.3s;
}

/* Текст в карточке */
.loft-card-text {
    margin: 1em 1.2em 0.5em 1.2em;
    font-size: 1.08rem;
    line-height: 1.5;
    color: #d9e0e8;
    font-weight: 400;
    text-align: left;
}

/* Светлая тема */
body.light-theme, html.light-theme {
    background: linear-gradient(135deg, #f5f5fa 0%, #e3e3f3 100%);
    color: #23234a;
}
body.light-theme .loft-title {
    color: #6200ea;
    text-shadow: 0 2px 8px rgba(98,0,234,0.10);
}
body.light-theme .loft-section {
    background: linear-gradient(135deg, #fff 60%, #e3e3f3 100%);
    box-shadow: 0 4px 16px rgba(187,134,252,0.10);
}
body.light-theme .button {
    background: linear-gradient(135deg, #6200ea 60%, #1e90ff 100%);
    color: #fff;
}
body.light-theme .button:hover, body.light-theme .button:focus {
    background: linear-gradient(135deg, #1e90ff 60%, #6200ea 100%);
    color: #fff;
}
body.light-theme .loft-button {
    background: linear-gradient(135deg, #bb86fc 60%, #8b7d6b 100%);
    color: #fff;
}
body.light-theme .loft-button:hover, body.light-theme .loft-button:focus {
    background: linear-gradient(135deg, #8b7d6b 60%, #bb86fc 100%);
    color: #fff;
}
body.light-theme .loft-table {
    background: linear-gradient(135deg, #fff 60%, #e3e3f3 100%);
    box-shadow: 0 4px 16px rgba(187,134,252,0.10);
}
body.light-theme .loft-table thead {
    background: linear-gradient(135deg, #bb86fc 60%, #8b7d6b 100%);
    color: #23234a;
}
body.light-theme .loft-table tr:hover {
    background: #e3e3f3;
    color: #23234a;
}
body.light-theme .loft-card {
    background: linear-gradient(135deg, #fff 60%, #e3e3f3 100%);
    box-shadow: 0 6px 16px rgba(187,134,252,0.10);
}
body.light-theme .loft-card:hover, body.light-theme .loft-card:focus-within {
    box-shadow: 0 12px 32px rgba(98,0,234,0.13);
}
body.light-theme .loft-card-image {
    background: #fff;
    border-bottom: 2px solid #bb86fc;
}
body.light-theme .loft-card-text {
    color: #23234a;
}

/* Адаптивность */
@media (max-width: 1200px) {
    html { font-size: 15px; }
    .loft-grid { max-width: 900px; }
}
@media (max-width: 900px) {
    html { font-size: 14px; }
    .loft-grid { max-width: 700px; }
}
@media (max-width: 700px) {
    html { font-size: 13px; }
    .loft-title { font-size: 1.3rem; margin-bottom: 1.2rem; }
    .loft-section {
        display: none !important;
    }
    .loft-table { width: 95%; font-size: 1em; }
    .loft-grid { grid-template-columns: 1fr; gap: 1.2em; padding: 0.7em 0.1em 1.2em 0.1em; }
    .loft-card { min-height: 340px; }
    .loft-card-image { height: 180px; }
    .loft-card-text { margin: 0.7em 0.5em 0.3em 0.5em; font-size: 1em; }
    .button, .loft-button { width: 100%; font-size: 1em; padding: 0.7em 0; margin: 0.2em 0; }
}
@media (max-width: 400px) {
    html { font-size: 12px; }
    .loft-title { font-size: 1.1rem; }
    .loft-section { padding: 0.3em 0.1em; }
}