/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c5f7f;
    --secondary-color: #e8a838;
    --accent-color: #d9534f;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 25px rgba(0,0,0,0.15);
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3a4d 100%);
    color: var(--white);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 3rem;
}

.site-title h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.main-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.btn-login {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #d4952e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(232, 168, 56, 0.3);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="rgba(255,255,255,0.1)"></path></svg>') no-repeat;
    background-size: cover;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 900;
    font-family: 'Merriweather', serif;
}

.stat-label {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Section Styles */
.section-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

/* News Section */
.news-section {
    padding: 5rem 0;
    background: var(--bg-light);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.news-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 5px solid var(--secondary-color);
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.news-date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.news-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.news-card p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--primary-color);
}

.vk-link {
    text-align: center;
    margin-top: 3rem;
}

.btn-vk {
    display: inline-block;
    background: #4a76a8;
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-vk:hover {
    background: #3d6591;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 118, 168, 0.3);
}

/* Books Section */
.books-section {
    padding: 5rem 0;
    background: var(--white);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.book-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.book-card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}

.book-card.featured {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 3px solid var(--secondary-color);
}

.book-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(217, 83, 79, 0.3);
}

.book-cover {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-align: center;
}

.book-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.book-author {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.book-description {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.book-reason {
    background: rgba(255,255,255,0.7);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--secondary-color);
}

.book-reason strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.book-genre {
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: right;
}

.catalog-link {
    text-align: center;
    margin-top: 3rem;
}

.btn-catalog {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-catalog:hover {
    background: #1a3a4d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 95, 127, 0.3);
}

/* Events Section */
.events-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.events-timeline {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.event-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.event-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

.event-date-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 5px 15px rgba(44, 95, 127, 0.3);
}

.event-date-badge .day {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'Merriweather', serif;
    line-height: 1;
}

.event-date-badge .month {
    display: block;
    font-size: 1rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-content {
    flex: 1;
}

.event-content h3 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.event-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.event-content p {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.btn-register-event {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-register-event:hover {
    background: #d4952e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(232, 168, 56, 0.3);
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.about-text h3 {
    color: var(--primary-color);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.services-list {
    list-style: none;
    padding: 0;
}

.services-list li {
    padding: 0.7rem 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.work-schedule {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
    border-left: 4px solid var(--secondary-color);
}

.work-schedule p {
    margin-bottom: 0.5rem;
}

.about-image {
    text-align: center;
}

.library-illustration {
    font-size: 8rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    transform: translateX(10px);
}

.feature-icon {
    font-size: 2.5rem;
}

.feature-text {
    font-weight: 600;
    color: var(--text-dark);
}

/* Contact Section */
.contact-section {
    padding: 5rem 0;
    background: var(--bg-light);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    display: grid;
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-hover);
}

.contact-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-details h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.contact-details p {
    color: var(--text-dark);
    line-height: 1.6;
}

.contact-details a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details a:hover {
    color: var(--secondary-color);
}

.map-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: var(--white);
    padding: 3rem 0 1rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.social-links {
    margin-bottom: 1rem;
}

.social-link {
    display: inline-block;
    background: #4a76a8;
    color: var(--white);
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #3d6591;
    transform: translateY(-2px);
}

.copyright {
    margin-top: 1rem;
    opacity: 0.7;
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    opacity: 0.8;
}

.footer-bottom a {
    color: var(--secondary-color);
    text-decoration: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    transition: all 0.3s ease;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

/* Auth Container */
.auth-container {
    margin-top: 2rem;
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    background: var(--bg-light);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.tab-btn:hover:not(.active) {
    background: #e0e0e0;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.auth-form h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 127, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: #1a3a4d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 95, 127, 0.3);
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-footer a:hover {
    color: var(--secondary-color);
}

/* Privacy Policy */
.privacy-policy {
    line-height: 1.8;
}

.privacy-policy h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.policy-date {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 2rem;
}

.privacy-policy h2 {
    color: var(--primary-color);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.privacy-policy p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.privacy-policy ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.privacy-policy ul li {
    margin-bottom: 0.5rem;
}

.privacy-policy a {
    color: var(--primary-color);
    text-decoration: none;
}

.privacy-policy a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-content,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .event-card {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-title h1 {
        font-size: 1.3rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .news-grid,
    .books-grid {
        grid-template-columns: 1fr;
    }
}
