/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    color: #333;
    line-height: 1.6;
}

/* Фоновое изображение */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    z-index: -1;
}

/* Затемнение фона для лучшей читаемости */
.background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
}

/* Основной контейнер */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Шапка */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: #1a252f;
    transform: translateX(-3px);
}

.page-title {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 18px;
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto;
}

/* Фильтры */
.filters-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    background-color: #ecf0f1;
    border: none;
    border-radius: 20px;
    color: #2c3e50;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #d5dbdb;
}

.filter-btn.active {
    background-color: #3498db;
    color: white;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 12px;
    min-width: 250px;
}

.search-box i {
    color: #95a5a6;
    margin-right: 10px;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

/* Секция историй */
.stories-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 28px;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #3498db;
}

.section-description {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Контейнер для историй */
.stories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Карточки историй */
.story-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.story-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-card:hover .story-image img {
    transform: scale(1.05);
}

.story-rating {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 20px;
    display: flex;
    gap: 3px;
}

.story-rating i {
    color: #f39c12;
    font-size: 14px;
}

.story-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.story-profession {
    background-color: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.story-country {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.story-name {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.3;
}

.story-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #7f8c8d;
}

.detail i {
    color: #3498db;
    width: 20px;
    text-align: center;
}

.story-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.story-quote {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.story-quote i {
    color: #3498db;
    margin-right: 10px;
    font-size: 20px;
}

.story-quote p {
    color: #2c3e50;
    font-style: italic;
    margin: 0;
    display: inline;
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.story-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #7f8c8d;
}

.stat i {
    color: #3498db;
}

/* Секция добавления истории */
.add-story-section {
    margin-bottom: 50px;
}

.add-story-card {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.add-story-content h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-story-content h3 i {
    color: #3498db;
}

.add-story-content p {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 16px;
}

.add-story-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.submit-story-btn {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.submit-story-btn:hover {
    background-color: #1a252f;
}

/* Мотивационная секция */
.motivation-section {
    margin-bottom: 50px;
}

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.lesson-card {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-5px);
}

.lesson-card i {
    font-size: 40px;
    color: #3498db;
    margin-bottom: 20px;
}

.lesson-card h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.lesson-card p {
    color: #7f8c8d;
    line-height: 1.5;
}

/* Футер */
.footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
    font-size: 14px;
}

.footer p {
    margin: 5px 0;
}

/* Анимация при загрузке */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* Адаптивность */
@media (max-width: 992px) {
    .stories-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .main-container {
        padding: 15px;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .page-title {
        font-size: 26px;
        margin-top: 50px;
    }
    
    .back-button {
        position: static;
        margin-bottom: 20px;
        display: inline-block;
    }
    
    .header {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .stories-container {
        grid-template-columns: 1fr;
    }
    
    .story-name {
        font-size: 22px;
    }
    
    .lessons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 22px;
    }
    
    .story-name {
        font-size: 20px;
    }
    
    .story-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .add-story-card {
        padding: 20px;
    }
    
    .story-stats {
        flex-direction: column;
        gap: 10px;
    }
}