/* Base Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #7f8c8d;
    --white: #fff;
    --gray: #95a5a6;
    --light-gray: #f5f5f5;
    --border-radius: 4px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-gray);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    color: var(--primary-color);
    position: relative;
    font-size: clamp(1.5rem, 4vw, 2rem); /* Минимум 1.5rem, максимум 2rem, адаптивно по 4% ширины viewport */
    margin-bottom: clamp(1rem, 3vh, 2.5rem);

}

.section-title::after {
    content: "";
    display: block;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 0.5rem auto;
    position: center;
    bottom: -10px; /* Отступ подчеркивания от текста */
    left: 0;
    width: 60%; /* Ширина равна ширине текста */
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #2980b9;
    color: var(--white);
}

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #c0392b;
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Header Styles */
.header {
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    margin-right: 1rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
    color: var(--primary-color);
}

.logo-text p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.header-contacts {
    display: flex;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.contact-item i {
    color: var(--secondary-color);
}

.main-nav ul {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--light-gray);
    padding: 1rem 0;
}

.main-nav li {
    margin: 0 1rem;
    position: relative;
}

.main-nav a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 0;
    text-decoration: none;
    display: inline-block;
}

.main-nav a:focus {
    outline: none;
}

.main-nav a:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

.main-nav a:hover {
    color: var(--secondary-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.main-nav a:hover::after {
    width: 100%;
}

.search-icon {
    margin-left: auto;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('hero-bg.jpg') no-repeat center center/cover;
    color: var(--white);
    padding: 5rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* About Section */
.about {
    padding: 5rem 0;
    background-color: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.about-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--border-radius);
    background-color: var(--light-gray);
    transition: var(--transition);
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.about-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.about-card h3 {
    margin-bottom: 1rem;
}

/* Topics Section */
.topics {
    padding: 5rem 0;
    background-color: var(--light-gray);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.topic-card {
    padding: 2rem;
    border-radius: var(--border-radius);
    color: var(--white);
    box-shadow: var(--box-shadow);
}

.topic-card.tech {
    background: linear-gradient(135deg, #3498db, #2c3e50);
}

.topic-card.social {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.topic-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.topic-card ul {
    margin-top: 1.5rem;
}

.topic-card li {
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.5rem;
}

.topic-card li::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--white);
}

/* Дополнительные стили для современного дизайна */

/* Анимации и переходы */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-animate {
    animation: fadeIn 0.8s ease forwards;
}

/* Модернизация шапки */
.header.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Улучшенные карточки */
.about-card, .editorial-card, .topic-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.about-card::before, .editorial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.about-card:hover::before, .editorial-card:hover::before {
    opacity: 1;
}

/* Эффекты для карточек редакции */
.editorial-photo {
    transition: all 0.3s ease;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.editorial-card:hover .editorial-photo {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Улучшенные кнопки */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn:hover::after {
    width: 100%;
}

.btn-outline:hover {
    box-shadow: 0 0 0 2px var(--secondary-color);
}

/* Стили для формы поиска */
.search-container {
    position: relative;
    max-width: 300px;
    margin: 0 auto 2rem;
}

.search-container input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid var(--gray);
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

/* Стили для хлебных крошек */
.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--text-light);
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: var(--secondary-color);
}

.breadcrumbs span {
    margin: 0 0.5rem;
    color: var(--gray);
}

/* Стили для таблиц (например, архив номеров) */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.pagination a {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border: 1px solid var(--light-gray);
    color: var(--dark-color);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.pagination a.active, .pagination a:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Стили для формы подачи статей */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-upload-label {
    padding: 0.6rem 1.2rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-label:hover {
    background-color: #ddd;
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--accent-color);
}

/* Адаптивные улучшения */
@media (max-width: 992px) {
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .header-contacts {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .hero {
        padding: 3rem 0;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    .contacts-map {
        height: 300px;
    }
}

/* Специальные эффекты для научной тематики */
.science-icon {
    position: absolute;
    opacity: 0.05;
    z-index: 0;
}

.icon-atom {
    top: 10%;
    right: 5%;
    font-size: 10rem;
    color: var(--secondary-color);
}

.icon-book {
    bottom: 10%;
    left: 5%;
    font-size: 8rem;
    color: var(--accent-color);
}

/* Кастомные скроллбары */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Стили для tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    border-radius: var(--border-radius);
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Стили для лоадера */
.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}
/* Анимация перехода между страницами */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Отключаем скачки при загрузке */
html {
    scroll-behavior: smooth;
    overflow-anchor: none;
}
