/* ===== Основные стили для блога ===== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Шапка ===== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img { height: 40px; }
.nav-center { display: flex; gap: 30px; }
.nav-center a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
.nav-center a:hover { color: #2A6DF4; }
.nav-right { display: flex; gap: 15px; }
.btn-outline-small {
    padding: 8px 20px;
    border: 2px solid #2A6DF4;
    border-radius: 50px;
    color: #2A6DF4;
    font-weight: 600;
    background: none;
    cursor: pointer;
}
.btn-outline-small:hover { background: #e8f0fe; }
.btn-primary-small {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn-primary-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.3);
}

/* ===== Hero блога ===== */
.blog-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0 50px;
    text-align: center;
}
.blog-hero h1 { font-size: 40px; font-weight: 800; margin-bottom: 16px; }
.blog-hero p { font-size: 20px; opacity: 0.95; max-width: 700px; margin: 0 auto 30px; }
.blog-controls { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.blog-controls .search-input {
    padding: 12px 20px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    min-width: 250px;
    flex: 1;
    max-width: 400px;
}
.blog-controls .btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}
.blog-controls .btn-outline:hover { background: white; color: #667eea; }

/* ===== Сетка статей ===== */
.blog-posts { padding: 40px 0; }
#postsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.blog-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    cursor: pointer;
}
.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}
.blog-card .card-body { padding: 20px; }
.blog-card .card-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.4;
}
.blog-card .card-body p {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 12px;
}
.blog-card .card-footer .badge {
    background: #e8f0fe;
    color: #2A6DF4;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* ===== Пагинация ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination-container button {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.pagination-container button.active {
    background: #2A6DF4;
    color: white;
    border-color: #2A6DF4;
}
.pagination-container button:hover:not(.active) { background: #f1f3f5; }

/* ===== Подписка ===== */
.blog-subscribe {
    background: #f8f9fa;
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.blog-subscribe h2 { font-size: 28px; margin: 0 0 10px; }
.blog-subscribe p { font-size: 18px; color: #666; margin-bottom: 20px; }
.blog-subscribe form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}
.blog-subscribe input[type="email"] {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #ced4da;
    border-radius: 30px;
    font-size: 16px;
}
.blog-subscribe .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}
.blog-subscribe .btn-primary:hover { transform: translateY(-2px); }
.blog-subscribe .consent {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
#subscribeMessage { margin-top: 8px; font-size: 14px; }

/* ===== Модалка ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    max-width: 500px;
    width: 90%;
    border-radius: 20px;
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { margin: 0; }
.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}
.filter-group { margin-bottom: 24px; }
.filter-group h4 { font-size: 16px; margin: 0 0 10px; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
    padding: 6px 16px;
    border: 1px solid #dee2e6;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}
.filter-btn.active {
    background: #2A6DF4;
    color: white;
    border-color: #2A6DF4;
}
.filter-checkboxes label,
.filter-radios label {
    display: inline-block;
    margin-right: 16px;
    font-size: 14px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}
.modal-footer .btn {
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.modal-footer .btn-secondary { background: #f1f3f5; color: #333; }
.modal-footer .btn-primary { background: #2A6DF4; color: white; }

/* ===== Страница статьи ===== */
.blog-article-section { padding: 40px 0; }
.article-header { margin-bottom: 30px; }
.article-header h1 { font-size: 34px; font-weight: 700; margin: 0 0 16px; }
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}
.article-meta .article-author { font-weight: 600; color: #333; }
.article-share {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.article-share button {
    background: #f1f3f5;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
}
.article-share button:hover { background: #e8f0fe; }
#articleContent {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}
#articleContent h2 { font-size: 26px; margin: 30px 0 16px; }
#articleContent h3 { font-size: 20px; margin: 24px 0 12px; }
#articleContent p { margin-bottom: 16px; }
#articleContent ul, #articleContent ol { margin: 16px 0 16px 24px; }
#articleContent img { max-width: 100%; border-radius: 8px; margin: 20px 0; }
.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.article-rating {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}
.article-rating p { margin: 0; }
.article-rating .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 18px;
}
.article-rating .btn-success { background: #d4edda; }
.article-rating .btn-danger { background: #f8d7da; }
.article-rating .btn:disabled { opacity: 0.5; cursor: default; }
.similar-posts { margin-top: 30px; }
.similar-posts h3 { margin-bottom: 20px; }
#similarPostsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
#similarPostsContainer .blog-card { cursor: pointer; }

/* ===== Загрузка ===== */
.loading { text-align: center; padding: 40px 0; }
.spinner {
    border: 3px solid #f3f3f3;
    border-top-color: #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Футер ===== */
.footer {
    padding: 60px 0 30px;
    background: #333;
    color: white;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h5 {
    font-size: 16px;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.9);
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s;
}
.footer-col ul li a:hover { color: white; }
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

/* ===== Стили для обратной связи (feedback) ===== */
.feedback-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.feedback-reason-btn {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.feedback-reason-btn:hover {
    background: #f1f3f5;
}
.feedback-reason-btn.selected {
    background: #2A6DF4;
    color: white;
    border-color: #2A6DF4;
}
.feedback-comment {
    margin-bottom: 20px;
}
.feedback-comment label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}
.feedback-comment textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

/* ===== Адаптив ===== */
@media (max-width: 768px) {
    .blog-hero h1 { font-size: 30px; }
    .blog-hero p { font-size: 16px; }
    #postsContainer { grid-template-columns: 1fr; }
    #similarPostsContainer { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 26px; }
    .article-share { flex-wrap: wrap; }
    .modal-content { padding: 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .navbar .container { flex-wrap: wrap; gap: 10px; }
    .nav-center { order: 3; width: 100%; justify-content: center; gap: 15px; flex-wrap: wrap; }
    .nav-right { margin-left: auto; }
}