/* Современный строгий дизайн */

:root {
    --bg-primary: #0e0a1a;
    --bg-secondary: #1a1625;
    --bg-card: #2a2438;
    --text-primary: #ffffff;
    --text-secondary: #b8b5c0;
    --text-muted: #8a8594;
    --accent: #3b82f6;
    --accent-hover: #1d4ed8;
    --border: #3a3547;
    --gradient-accent: linear-gradient(135deg, #3b82f6, #1d4ed8);
    --gradient-primary: linear-gradient(135deg, #667eea, #764ba2);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-width: 320px;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Навигация */
.navbar {
    background: rgba(14, 10, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-pyramids {
    width: 28px;
    height: 18px;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-pyramids svg {
    width: 100%;
    height: 100%;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Основной контент */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero секция */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(124, 58, 237, 0.05));
    border-radius: 20px;
    margin-bottom: 4rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-actions {
    margin-top: 2rem;
}

/* Features секция */
.features {
    margin-bottom: 4rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-accent);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: white;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* About секция */
.about-section {
    margin-bottom: 4rem;
}

.about-content {
    text-align: center;
}

/* Карточки */
.card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-accent);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
}

.btn-primary {
    background: var(--gradient-accent);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Сетка книг */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    transform: translate(50%, -50%);
    transition: all 0.4s ease;
    opacity: 0;
}

.book-card:hover::before {
    transform: scaleX(1);
}

.book-card:hover::after {
    opacity: 1;
    transform: translate(30%, -30%);
}

.book-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(59, 130, 246, 0.1);
}

.book-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
}

.book-card:hover .book-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.3);
}

.book-content {
    flex: 1;
}

.book-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.book-content h3 a {
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(90deg, var(--text-primary), var(--accent));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease;
}

.book-content h3 a:hover {
    background-size: 100% 2px;
}

.book-content p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.book-content p strong {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.book-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.book-actions .btn {
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.book-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.book-actions .btn:hover::before {
    left: 100%;
}

.book-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* Категории */
.book-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.book-category:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* Поиск и фильтры */
.search-info {
    padding: 1.5rem;
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 2rem;
    backdrop-filter: blur(10px);
}

.search-info p {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.search-info span {
    color: var(--accent);
    font-weight: 700;
}

.filter-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.filter-controls .form-group {
    flex: 1;
    margin-bottom: 0;
}

.filter-controls .form-control {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-controls .form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-controls .form-control:hover {
    border-color: var(--accent);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.book-card {
    animation: slideInUp 0.6s ease forwards;
}

.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }
.book-card:nth-child(4) { animation-delay: 0.4s; }
.book-card:nth-child(5) { animation-delay: 0.5s; }
.book-card:nth-child(6) { animation-delay: 0.6s; }

.filter-controls {
    animation: scaleIn 0.5s ease forwards;
}

/* Адаптивность */
@media (max-width: 768px) {
    .navbar-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        white-space: nowrap;
        display: inline-block;
    }
    
    .hero h1 {
        font-size: 2.5rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .hero .lead {
        font-size: 1.2rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .book-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin: 0 0.5rem;
    }
    
    .book-card h3 {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .book-card p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .filter-controls .form-control {
        font-size: 16px; /* Предотвращает зум на iOS */
        width: 100%;
    }
    
    .book-actions {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .book-actions .btn {
        width: 100%;
        font-size: 14px;
        padding: 0.75rem 1rem;
    }
    
    .hero-stats {
        padding: 0 0.5rem;
    }
    
    .hero-stats span {
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .logo-pyramids {
        width: 24px;
        height: 16px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero .lead {
        font-size: 1rem !important;
        line-height: 1.4;
    }
    
    .card {
        padding: 1.5rem;
        margin: 0 0.25rem;
    }
    
    .book-card {
        padding: 1.5rem;
        margin: 0 0.25rem;
    }
    
    .book-card h3 {
        font-size: 1rem;
    }
    
    .book-card p {
        font-size: 0.85rem;
    }
    
    .btn {
        font-size: 13px;
        padding: 0.6rem 1rem;
    }
    
    .hero-stats span {
        font-size: 0.8rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .nav-link {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .hero h1 {
        font-size: 1.8rem !important;
    }
    
    .hero .lead {
        font-size: 0.9rem !important;
    }
    
    .card {
        padding: 1rem;
        margin: 0 0.125rem;
    }
    
    .book-card {
        padding: 1rem;
        margin: 0 0.125rem;
    }
    
    .book-card h3 {
        font-size: 0.9rem;
    }
    
    .book-card p {
        font-size: 0.8rem;
    }
    
    .btn {
        font-size: 12px;
        padding: 0.5rem 0.8rem;
    }
    
    .hero-stats span {
        font-size: 0.75rem;
    }
    
    .section-title h2 {
        font-size: 1.6rem;
    }
    
    .filter-controls {
        padding: 0 0.25rem;
    }
    
    .books-grid {
        padding: 0 0.25rem;
    }
}

/* Футер */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer-section a {
    color: var(--accent);
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Утилиты */
.text-center {
    text-align: center;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title .lead {
    font-size: 1.1rem;
    color: var(--text-muted);
}
