/* styles.css - Основные стили сайта */

* {
    -webkit-tap-highlight-color: transparent;
}
/* Анимацию применять только к конкретным элементам */
a, button, .card-hover, .nav-item {
    transition: all 0.2s ease;
}

body {
    font-family: 'Montserrat', sans-serif;
}

.hero-title {
    font-family: 'Playfair Display', serif;
}

.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.gradient-blue {
    background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
}

.card-hover:hover {
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

/* Стили для выпадающего меню */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 260px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-top: 3px solid #1e3a8a;
    top: 100%;
}

.nav-item:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 10px 20px;
    font-size: 13px;
    color: #4a5568;
    border-bottom: 1px solid #f7fafc;
    transition: all 0.2s;
    text-transform: none;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: #1e3a8a;
    padding-left: 25px;
}

.book-spine {
    width: 12px;
    background: #1e3a8a;
}

.lang-active {
    color: #1e3a8a;
    border-bottom: 2px solid #1e3a8a;
}

/* Стили для обложек книг */
.book-card {
    transition: all 0.4s ease;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.book-card:hover {
    transform: translateY(-10px);
}

.book-card .book-spine {
    width: 30px;
    background: linear-gradient(to right, #1e3a8a, #3b82f6);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
}

.lang-link {
    position: relative;
    padding-bottom: 2px;
}

.lang-link.active {
    color: #1e3a8a;
    font-weight: 700;
    border-bottom: 2px solid #1e3a8a;
}

.lab-item {
    position: relative;
    padding-left: 1.5rem;
}

.lab-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

/* Модальное окно поиска */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1001;
    backdrop-filter: blur(8px);
}

.search-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-results {
    max-height: 60vh;
    overflow-y: auto;
}

.search-highlight {
    background-color: #fbbf24;
    color: #1e3a8a;
    padding: 0 2px;
    border-radius: 4px;
}

/* Кнопка "Наверх" */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    border: 2px solid white;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.scroll-to-top:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
}

.scroll-to-top i {
    color: white;
    font-size: 22px;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
    }
}
* {
    -webkit-tap-highlight-color: transparent;
}

/* Адаптация hero секции */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 1.8rem !important;
    }
    
    .flex.space-x-4 {
        flex-direction: column;
        gap: 1rem;
    }
    
    .flex.space-x-4 a {
        text-align: center;
    }
}

/* Адаптация карточек новостей */
@media (max-width: 768px) {
    .grid.md\\:grid-cols-3 {
        gap: 1rem;
    }
}

/* Адаптация лабораторий */
@media (max-width: 1024px) {
    .grid.md\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid.md\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Адаптация футера */
@media (max-width: 768px) {
    footer .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
}
