/* ============================================
   БАЗОВЫЕ СТИЛИ
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f4f9;
    padding-bottom: 20px;
    color: #1a202c;
}

/* ============================================
   НАВБАР
   ============================================ */
.navbar {
    padding: 8px 0;
    min-height: 56px;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.navbar-brand {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, #2b6cb0, #4299e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0;
    letter-spacing: -0.3px;
}

.navbar-nav .nav-link {
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    color: #4a5568 !important;
    transition: all 0.2s;
    margin: 0 2px;
}

.navbar-nav .nav-link:hover {
    background: #edf2f7;
    color: #2b6cb0 !important;
}

.navbar-nav .nav-link.active {
    background: #ebf4ff;
    color: #2b6cb0 !important;
    font-weight: 600;
}

.navbar .btn-outline-danger {
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    border-color: #e2e8f0;
    color: #4a5568;
    transition: all 0.2s;
}

.navbar .btn-outline-danger:hover {
    background: #fff5f5;
    border-color: #fc8181;
    color: #e53e3e;
}

/* ============================================
   КОНТЕЙНЕР
   ============================================ */
.container {
    max-width: 1400px;
    padding-left: 16px;
    padding-right: 16px;
}

/* ============================================
   КАРТОЧКИ
   ============================================ */
.card {
    border-radius: 16px;
    border: none;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.card-body {
    padding: 16px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f4f9;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 16px;
}

/* ============================================
   КНОПКИ
   ============================================ */
.btn {
    border-radius: 10px;
    font-weight: 500;
    font-size: 13px;
    padding: 6px 16px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #2b6cb0, #4299e1);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.35);
    background: linear-gradient(135deg, #2a5f9e, #3182ce);
}

.btn-success {
    background: linear-gradient(135deg, #276749, #38a169);
    border: none;
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.35);
}

.btn-outline-secondary {
    border-color: #e2e8f0;
    color: #4a5568;
}

.btn-outline-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.btn-warning {
    background: #f6e05e;
    border: none;
    color: #744210;
    font-weight: 600;
}

.btn-warning:hover {
    background: #f6c90e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(246, 224, 94, 0.4);
}

.btn-danger {
    background: #fc8181;
    border: none;
    color: white;
    font-weight: 600;
}

.btn-danger:hover {
    background: #f56565;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.btn-sm-mobile {
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 8px;
}

/* ============================================
   ТАБЛИЦЫ
   ============================================ */
.table {
    font-size: 14px;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table thead th {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #4a5568;
    padding: 10px 12px;
    border-top: none;
}

.table td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
    background: white;
}

.table tbody tr {
    transition: background 0.15s;
}

.table tbody tr:hover td {
    background: #f7fafc;
}

/* ============================================
   ФОРМЫ
   ============================================ */
.form-control,
.form-select {
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    padding: 8px 14px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 4px;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #edf2f7;
    padding: 16px 20px;
}

.modal-footer {
    border-top: 1px solid #edf2f7;
    padding: 16px 20px;
}

.modal-title {
    font-weight: 700;
    font-size: 18px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #a0aec0;
    transition: color 0.2s;
    padding: 0 4px;
}

.btn-close:hover {
    color: #4a5568;
}

/* ============================================
   АНИМАЦИИ
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.3s ease forwards;
}

.hover-lift {
    transition: transform 0.15s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* ============================================
   СТИЛИ ДЛЯ ПОСТОВ
   ============================================ */
.period-badge {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #ebf4ff;
    color: #2b6cb0;
    font-weight: 500;
}

.stat-card {
    background: white;
    padding: 10px 8px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f4f9;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #2b6cb0, #4299e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 11px;
    color: #a0aec0;
    font-weight: 500;
    margin-top: 2px;
}

.post-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #f0f4f9;
    transition: all 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    border-color: #bee3f8;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.08);
    transform: translateY(-2px);
}

.post-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.post-title a {
    color: #2d3748;
    text-decoration: none;
}

.post-title a:hover {
    color: #2b6cb0;
}

.post-meta {
    font-size: 12px;
    color: #a0aec0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.post-text {
    font-size: 13px;
    color: #4a5568;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    flex: 1;
}

.post-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #a0aec0;
    padding-top: 8px;
    border-top: 1px solid #f0f4f9;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 2px;
}

.badge-confidence {
    background: #ebf4ff;
    color: #2b6cb0;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.authors-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.authors-scroll::-webkit-scrollbar {
    height: 3px;
}

.authors-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.authors-scroll .btn {
    flex-shrink: 0;
    border-radius: 20px;
    font-size: 12px;
    padding: 4px 14px;
}

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.no-authors {
    padding: 20px;
    text-align: center;
    color: #a0aec0;
}

/* ============================================
   МЕДИА-ЗАПРОСЫ
   ============================================ */
@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar {
        padding: 4px 0;
        min-height: 48px;
    }

    .navbar-brand {
        font-size: 15px;
    }

    .table {
        font-size: 12px;
    }

    .table thead th,
    .table td {
        padding: 6px 8px;
    }

    .btn {
        font-size: 12px;
        padding: 4px 12px;
    }

    .card-body {
        padding: 12px;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 576px) {
    .post-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 992px) {
    .post-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ============================================
   УТИЛИТЫ
   ============================================ */
.gap-2 {
    gap: 0.5rem;
}
.gap-3 {
    gap: 1rem;
}
.gap-4 {
    gap: 1.5rem;
}