﻿/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/*ФИКСИРОВАННАЯ ШАПКА */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.8rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header__logos {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Логотипы */
.logo {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Заголовок */
.header__title {
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: right;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Основное содержимое */
.main {
    padding: 1.5rem 0;
    margin-top: 80px;
}

.books__title {
    text-align: center;
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Сетка книг */
.books__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

/* Карточка книги */
.book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #1fe168 0%, #1357f1 100%);
}

/* Обложка книги */
.book__cover {
    display: flex;
    width: 180px;
    height: 250px;
    position: relative;
    perspective: 1000px;
    flex-shrink: 0;
}

.book__spine {
    width: 15px;
    height: 100%;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    border-radius: 3px 0 0 3px;
    box-shadow: inset -2px 0 5px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.book__front {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 6px 6px 0;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    box-shadow: 3px 0 8px rgba(0,0,0,0.2);
}

.book__title {
    font-size: 1.0rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Ссылка на Документ */
.book__link {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
    font-size: 0.9rem;
}

.book__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.6);
}

/* Подвал */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Анимация для плавного изменения размера */
.book__cover,
.book__spine,
.book__front {
    transition: all 0.3s ease;
}

/* Анимация появления книг */
@keyframes bookAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    animation: bookAppear 0.5s ease forwards;
}

.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.2s; }
.book-card:nth-child(4) { animation-delay: 0.3s; }
.book-card:nth-child(5) { animation-delay: 0.4s; }
.book-card:nth-child(6) { animation-delay: 0.5s; }

/* АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ */
@media (max-width: 768px) {
    .header {
        padding: 0.6rem 0;
    }
    
    .header__content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .header__title {
        text-align: center;
        font-size: 1.2rem;
    }
    
    .header__logos {
        justify-content: center;
    }
    
    .logo {
        width: 45px;
        height: 45px;
    }
    
    .main {
        margin-top: 110px;
        padding: 1rem 0;
    }
    
    .books__title {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .books__grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem;
    }
    
    .book__cover {
        width: 160px;
        height: 220px;
        min-width: 175px;
    }
    
    .book__spine {
        width: 15px;
        min-width: 15px;
    }
    
    .book__front {
        padding: 1rem 0.8rem;
    }
    
    .book-card {
        padding: 1.2rem;
        gap: 1.2rem;
    }
    
    .book__title {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
        position: relative;
        z-index: 1;
    }
    
    .header__logos {
        gap: 0.8rem;
    }
    
    .logo {
        width: 40px;
        height: 40px;
    }
    
    .header__title {
        font-size: 1.1rem;
    }
    
    .main {
        margin-top: 100px;
    }
    
    .books__title {
        font-size: 1.6rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .books__grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0 0.5rem;
    }
    
    .book-card {
        padding: 1rem;
    }
    
    .book__cover {
        width: 140px;
        height: 200px;
        min-width: 155px;
    }
    
    .book__spine {
        width: 15px;
        min-width: 15px;
    }
    
    .book__title {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .book__link {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
    }
}

/* АДАПТИВНОСТЬ ДЛЯ ТЕЛЕФОНОВ 360 */
@media (max-width: 360px) {
    .book__cover {
        width: 130px;
        height: 190px;
        min-width: 145px;
    }
    
    .book__spine {
        width: 15px;
    }
    
    .books__title {
        font-size: 1.5rem;
    }
}