/* ========================================
   NOVA SAPIENS UNIFIED CSS
   Унифицированные стили для всей платформы
   ======================================== */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-dark: #2c3e50;
    --primary-light: #34495e;
    --accent-blue: #3498db;
    --accent-green: #27ae60;
    --accent-orange: #f39c12;
    --accent-purple: #667eea;
    --text-gray: #6c757d;
    --bg-light: #f8f9fa;
    --border-light: #e9ecef;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--primary-dark);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ===== NAVIGATION STYLES ===== */
.navigation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: static;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-brand {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.nav-brand h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.nav-stats {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-stat-item {
    background: rgba(255,255,255,0.15);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.nav-stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.nav-stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.nav-login .nav-stat-label {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Login Button */
.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-btn:enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== MAIN CONTENT AREA ===== */
.main-content {
    min-height: calc(100vh - 180px);
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0; /* Убраны горизонтальные отступы */
}

/* ===== RESEARCH PAGE SPECIFIC STYLES ===== */
.back-navigation {
    margin-bottom: 30px;
}

.back-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.research-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
}

.research-meta {
    margin-top: 20px;
}

.meta-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-top: 15px;
}

.meta-label {
    font-weight: 600;
    color: var(--text-gray);
    font-size: 0.9em;
}

.meta-value {
    color: var(--primary-dark);
    font-weight: 500;
}

.key-result-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-green);
    width: 100%;
    display: block;
}

.key-result-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.key-result-text {
    color: #064e3b;
    line-height: 1.6;
    font-size: 1.05em;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5e8 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-green);
    margin-bottom: 20px;
}

.categories-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.categories-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.roles-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.roles-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.research-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.research-content h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.content-wrapper {
    line-height: 1.7;
    color: var(--primary-dark);
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4,
.content-wrapper h5,
.content-wrapper h6 {
    color: var(--primary-dark);
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.content-wrapper h1 { font-size: 1.8em; }
.content-wrapper h2 { font-size: 1.5em; }
.content-wrapper h3 { font-size: 1.3em; }
.content-wrapper h4 { font-size: 1.1em; }

.content-wrapper p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.content-wrapper ul,
.content-wrapper ol {
    margin: 15px 0;
    padding-left: 20px;
}

.content-wrapper li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.content-wrapper a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

.content-wrapper a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.content-wrapper pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

.content-wrapper code {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.pdf-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.pdf-block {
    text-align: center;
}

.pdf-block h3 {
    color: var(--primary-dark);
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
}

.pdf-link-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.pdf-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    text-decoration: none;
}

/* ===== MODAL STYLES ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
}

.modal-header {
    padding: 20px 30px 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    color: var(--primary-dark);
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: var(--primary-dark);
}

.modal-body {
    padding: 20px 30px 30px 30px;
}

/* ===== AUTH POPUP STYLES ===== */
.nova-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.auth-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.auth-popup-content {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 2001;
}

.auth-popup-header {
    padding: 25px 30px 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
}

.auth-popup-header h3 {
    color: var(--primary-dark);
    font-size: 1.4em;
    font-weight: 600;
    margin: 0;
}

.auth-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auth-popup-close:hover {
    background: #f8f9fa;
    color: var(--primary-dark);
}

.auth-popup-body {
    padding: 30px;
}

.auth-info h4 {
    color: var(--primary-dark);
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
}

.auth-info p {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.auth-benefits {
    margin: 20px 0;
}

.auth-benefit {
    color: var(--primary-dark);
    padding: 8px 0;
    font-size: 0.95em;
}

.auth-widget {
    margin-top: 25px;
    text-align: center;
}

.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== COPY NOTIFICATION ===== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RESEARCH PAGE STYLES ===== */
.header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
}

.breadcrumb {
    font-size: 0.9em;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.research-title {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
    line-height: 1.3;
}

.research-title-en {
    font-size: 1.2em;
    color: #718096;
    margin-bottom: 25px;
    font-style: italic;
}



.meta-info-compact {
    flex: 1;
}

.meta-details {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.95em;
    color: var(--text-gray);
}

.separator {
    color: #ccc;
}

.pdf-link-simple {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.pdf-link-simple:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Rating Display */
.rating-large {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    border: 2px solid var(--border-light);
    min-width: 120px;
}

.rating-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Rating Colors */
.rating-low { border-color: #e74c3c; background: #fdf2f2; }
.rating-medium { border-color: var(--accent-orange); background: #fef9f0; }
.rating-good { border-color: var(--accent-green); background: #f0f9f4; }
.rating-excellent { border-color: var(--accent-purple); background: #f7f5ff; }

/* Meta Grid */
.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.meta-item {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
}

.meta-item.key-result {
    border-left: 4px solid var(--accent-green);
}





/* Categories Section */
.categories-compact {
    margin-bottom: 30px;
}

.categories-row {
    margin-bottom: 20px;
}

.category-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.category-group {
    margin-bottom: 15px;
}

.category-group h4 {
    margin: 0 0 10px 0;
    color: var(--primary-dark);
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    background: var(--border-light);
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.category-tag:hover {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-1px);
}

.category-tag.main {
    background: var(--accent-purple);
    color: white;
    font-weight: 600;
    border: 1px solid #5a6fd8;
}



.roles-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary-dark);
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-tag-clickable {
    background: var(--bg-light);
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    user-select: none;
}

.role-tag-clickable:hover {
    background: #17a2b8;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* Content Section */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 30px;
}

.content-container {
    line-height: 1.7;
    font-size: 1.05em;
}

.content-container h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    margin: 30px 0 15px 0;
    font-weight: 600;
}

.content-container h3 {
    color: var(--primary-dark);
    font-size: 1.3em;
    margin: 25px 0 12px 0;
    font-weight: 600;
}

.content-container p {
    margin-bottom: 15px;
    color: #4a5568;
}

.content-container ul, .content-container ol {
    margin: 15px 0;
    padding-left: 25px;
}

.content-container li {
    margin-bottom: 8px;
}

/* Code Blocks */
.example-block {
    background: #2d3748;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow-x: auto;
}

.example-block pre {
    margin: 0;
    color: #e2e8f0;
    font-size: 18px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
}

.copy-btn.copied {
    background: var(--accent-green);
    color: white;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.role-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .role-modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-content {
    padding: 20px 25px;
}

.modal-content p {
    margin: 0;
    line-height: 1.6;
    color: #4a5568;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.modal-btn {
    background: var(--accent-purple);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Footer Styles - СОВРЕМЕННЫЙ ДИЗАЙН */
.page-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 50%, #34495e 100%);
    color: white;
    padding: calc(var(--spacing-xl) * 1.5) 0 var(--spacing-xl);
    margin-top: calc(var(--spacing-xl) * 2);
    position: relative;
    overflow: hidden;
}

.page-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
}

.footer-info {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.footer-info p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.footer-info p:first-child {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.footer-info p:nth-child(2) {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.footer-cta {
    margin: 0;
    display: flex;
    justify-content: center;
}

.telegram-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.telegram-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.telegram-cta:hover::before {
    left: 100%;
}

.telegram-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Адаптивность футера */
@media (max-width: 768px) {
    .page-footer {
        padding: var(--spacing-xl) 0 var(--spacing-lg);
        margin-top: var(--spacing-xl);
    }
    
    .footer-info {
        padding: 0 var(--spacing-md);
        gap: var(--spacing-md);
    }
    
    .telegram-cta {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.9rem;
    }
}

/* Старые стили для совместимости */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    padding: var(--spacing-xs) 0;
}

.footer-link:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Action Buttons */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-purple);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.back-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== CATALOG STYLES ===== */

/* Header Controls */
.header-controls {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.control-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary-dark);
    white-space: nowrap;
}

/* Search Components */
.search-container {
    position: relative;
    display: flex;
    gap: 8px;
}

.search-input {
    width: 250px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.clear-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    opacity: 1;
}

.clear-btn:disabled {
    display: none;
}

.control-select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    min-width: 120px;
    cursor: pointer;
}

.mobile-filters-btn {
    display: none;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Main Layout */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 200px);
}

/* Sidebar - АККУРАТНАЯ ГОРИЗОНТАЛЬНАЯ ПОЛОСА С STICKY ПОВЕДЕНИЕМ */
.sidebar {
    width: 100%;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) var(--spacing-lg);
    overflow: visible; /* Убрали прокрутку, разрешили тултипы */
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap; /* Разрешили перенос на узких экранах */
    min-height: 60px;
    /* Sticky поведение */
    position: sticky;
    top: 0;
    z-index: 100; /* Поверх контента */
    transition: box-shadow 0.3s ease; /* Плавная анимация тени */
}

/* Тень при прилипании (опционально для визуального эффекта) */
.sidebar.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.sidebar-header h2 {
    font-size: 1.2em;
    color: var(--primary-dark);
    margin: 0;
}

.close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-gray);
}

/* Filter Components - РАСТЯНУТЫЕ НА ВСЮ ШИРИНУ */
.filter-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
    position: relative;
}

/* Кнопка сброса не растягивается */
.filter-group:has(.reset-btn) {
    flex: none;
    min-width: auto;
}

.filter-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.filter-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    white-space: nowrap;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Month Filter Specific - РАСТЯНУТЫЙ НА ВСЮ ШИРИНУ */
.month-filter-container {
    width: 100%;
}

.month-selection-display {
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: border-color 0.3s;
    width: 100%;
    font-size: 0.9rem;
    white-space: nowrap;
}

.month-selection-text {
    flex: 1; /* Займет все доступное место слева */
}

.month-count {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    margin-right: var(--spacing-xs); /* Отступ от иконки */
}

.month-selection-display:hover {
    border-color: var(--accent-blue);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

/* Month Dropdown - ГОРИЗОНТАЛЬНЫЙ ПОЗИЦИОНИНГ */
.month-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 280px; /* Увеличена ширина для длинных названий месяцев */
    margin-top: 4px;
    max-width: calc(100vw - 40px); /* Не превышаем ширину экрана */
}

.month-checkboxes {
    margin-top: 0;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0; /* Убираем внутренние отступы для кнопок */
    max-height: 300px;
    overflow-y: auto; /* Вертикальная прокрутка при превышении высоты */
    overflow-x: hidden; /* Скрываем горизонтальную прокрутку */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Каждый месяц - отдельная строка */
.month-checkbox {
    display: block !important;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
    transition: background-color 0.2s;
    word-wrap: break-word; /* Перенос длинных слов */
    overflow-wrap: break-word; /* Современный синтаксис */
    white-space: nowrap; /* Предотвращаем перенос строк */
    text-overflow: ellipsis; /* Многоточие для очень длинных названий */
    overflow: hidden; /* Скрываем переполнение */
}

.month-checkbox:hover {
    background-color: var(--bg-light);
    border-radius: 4px;
}

.month-checkbox input {
    margin-right: var(--spacing-sm);
}

.month-checkbox span {
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Адаптивные стили для месячного фильтра */
@media (max-width: 768px) {
    .month-dropdown {
        width: calc(100vw - 20px); /* На мобильных занимаем почти всю ширину */
        left: -10px; /* Центрируем относительно родителя */
        max-width: 320px;
    }
    
    .month-checkboxes {
        max-height: 250px; /* Уменьшаем высоту на мобильных */
    }
    
    .month-checkbox {
        padding: 12px var(--spacing-md); /* Увеличиваем отступы для удобства тапа */
        font-size: 0.95rem;
    }
    
    .month-checkbox span {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .month-dropdown {
        width: calc(100vw - 10px);
        left: -5px;
    }
    
    .month-checkboxes {
        max-height: 200px; /* Еще меньше на очень маленьких экранах */
        padding: 5px;
    }
    
    .month-checkbox {
        padding: 10px;
        margin-bottom: 2px;
    }
}



/* Контейнер кнопок управления месяцами */
.month-controls {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: white;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--spacing-xs);
}

/* Современные кнопки управления месяцами */
.month-control-btn {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.month-control-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.month-control-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.month-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.month-filter-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.month-action-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 3px;
    display: inline-block;
}

/* Filter Actions */
.filter-actions {
    margin-top: var(--spacing-lg);
}

/* КОМПАКТНАЯ КНОПКА СБРОСА - ТОЛЬКО ИКОНКА */
.reset-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #94a3b8;
    color: white;
    border: none;
    border-radius: 50%;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    transform: scale(1.1);
}

/* Тултип для кнопки сброса */
.reset-btn::after {
    content: "Сбросить все фильтры";
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.reset-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Content Area - ГАРМОНИЗИРОВАННЫЕ ОТСТУПЫ */
.content-area {
    flex: 1;
    padding: var(--spacing-lg) 0; /* Убираем левый и правый отступы */
    overflow-y: auto;
}

.results-summary {
    margin-bottom: var(--spacing-lg);
}

.results-count {
    font-size: 1.1rem;
    color: var(--primary-light);
    font-weight: 500;
    margin: 0;
}

/* Счетчик результатов в header */
.filter-results-count.header-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: var(--spacing-lg);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-light);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

/* Header стили для правильного выравнивания */
.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: 20px; /* Отступ снизу */
}

.header-left h1 {
    margin: 0;
    font-size: 1.5rem;
}

/* Research Grid - ОБНОВЛЕННАЯ СЕТКА: 2 КОЛОНКИ */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: var(--spacing-lg);
    margin: 0; /* Убираем лишние отступы для примыкания к краям */
    margin-top: 0px; /* Убран отступ сверху для примыкания к sidebar */
}

.research-card {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.research-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.research-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 24px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.research-card .key-result {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    line-height: 1.4;
    padding-left: 0;
}

.research-card .category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.research-card .category-tag {
    background: var(--border-light);
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.research-card .card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-light);
}

.research-card .card-footer .date {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.research-card .card-footer .rating {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* === СТИЛИ ДЛЯ СТРУКТУРЫ КАРТОЧЕК ИЗ NOVA-MODERN.JS === */
.research-card .card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 24px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.research-card .card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.research-card .card-title a:hover {
    color: var(--accent-green);
}

.research-card .key-result-preview {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    line-height: 1.4;
    padding-left: 0;
}

.research-card .card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.research-card .card-date {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.research-card .card-rating {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.research-card .card-rating.excellent {
    background-color: #fff8e1;
    color: #ff8f00;
    border: 1px solid #ffcc02;
}

.research-card .card-rating.good {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #42a5f5;
}

.research-card .card-rating.medium {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.research-card .card-rating.low {
    background-color: #f5f7fa;
    color: #6b7280;
    border: 1px solid #9ca3af;
}

/* Pagination - СОВРЕМЕННЫЙ UX - ПОЛНАЯ ШИРИНА */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: 20px; /* Фиксированный отступ сверху */
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--border-light);
    width: 100%; /* Полная ширина как у research-grid */
    box-sizing: border-box;
}

/* Основной контейнер пагинации */
#pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    margin-top: 20px; /* Отступ сверху */
}

/* Контролы пагинации (кнопки навигации) */
.pagination-controls {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    background: white;
    padding: var(--spacing-sm);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%; /* Растягиваем на всю ширину */
    max-width: none; /* Убираем ограничения ширины */
}

.pagination-controls button {
    min-width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.pagination-controls button.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #4c9eff 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pagination-controls button:disabled:hover {
    background: transparent;
    transform: none;
}

/* Разделители в пагинации */
.pagination-controls span {
    color: var(--text-secondary);
    padding: 0 var(--spacing-xs);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Селектор количества элементов */
.items-per-page {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.items-per-page label {
    font-weight: 500;
    white-space: nowrap;
}

.items-per-page select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: white;
    color: var(--primary-dark);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.items-per-page select:hover {
    border-color: var(--accent-blue);
}

.items-per-page select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Мобильная адаптивность */
@media (max-width: 768px) {
    .pagination-controls {
        gap: var(--spacing-xs);
        padding: var(--spacing-xs);
    }
    
    .pagination-controls button {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .items-per-page {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .nav-stats {
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .nav-brand h1 {
        font-size: 1.6rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .research-title {
        font-size: 1.8em;
    }
    
    .meta-info-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .rating-large {
        align-self: flex-start;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    /* Mobile Catalog Styles */
    .header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .mobile-filters-btn {
        display: block;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .close-btn {
        display: block;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
    }
    
    .search-input {
        width: 100%;
    }
    
    .content-area {
        padding: var(--spacing-md) 0; /* Убираем левый и правый отступы на мобильных */
    }
    
    /* Адаптивный sidebar на узких экранах */
    .sidebar {
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    /* ===== MOBILE ADAPTATION FOR RESEARCH PAGE ===== */
    .back-navigation {
        margin-bottom: 20px;
    }
    
    .back-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .research-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .research-title {
        font-size: 1.8em;
        line-height: 1.2;
    }
    
    .research-title-en {
        font-size: 1.1em;
        margin-bottom: 20px;
    }
    
    .meta-info-row {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .key-result-section,
    .categories-section,
    .roles-section,
    .research-content,
    .pdf-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .key-result-section h2,
    .categories-section h2,
    .roles-section h2,
    .research-content h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .key-result-text {
        padding: 15px;
        font-size: 1em;
    }
    
    .content-wrapper h1 { font-size: 1.5em; }
    .content-wrapper h2 { font-size: 1.3em; }
    .content-wrapper h3 { font-size: 1.1em; }
    
    .pdf-link-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px 0 20px;
    }
    
    .modal-body {
        padding: 15px 20px 20px 20px;
    }
    
    .auth-popup-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .auth-popup-header {
        padding: 20px 20px 0 20px;
        padding-bottom: 15px;
    }
    
    .auth-popup-body {
        padding: 20px;
    }
}

/* ===== НОВЫЕ СТИЛИ V2.0: UX УЛУЧШЕНИЯ ===== */

/* === 1. ЛОГОТИП В ХЕДЕРЕ === */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-brand-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-brand-text .nav-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* === 2. БЛОК ВОЗМОЖНОСТЕЙ И ПРИМЕНЕНИЯ === */
.capabilities-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-purple);
    width: 100%;
    display: block;
}

.capabilities-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.capabilities-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Подсекции внутри блока возможностей */
.capability-subsection {
    padding: 10px 0 0 0;
}

.capability-subsection:last-child {
    padding-bottom: 0;
}

.capability-subheader {
    color: var(--primary-dark);
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Горизонтальные теги для способностей и паттернов */
.capability-tags-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.capability-tag {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.capability-tag.main {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #5a67d8 100%);
    color: white;
    border-color: var(--accent-purple);
}

.capability-tag.pattern-main {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e67e22 100%);
    color: white;
    border-color: var(--accent-orange);
}

.capability-pct {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
}

.capability-tag.main .capability-pct,
.capability-tag.pattern-main .capability-pct {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Роли с переносом строк */
.capability-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-tag-clickable {
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5e8 100%);
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--accent-green);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.role-tag-clickable:hover {
    background: linear-gradient(135deg, var(--accent-green) 0%, #27ae60 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

/* === 3. УЛУЧШЕННЫЙ PDF FOOTER === */
.research-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.research-titles h3 {
    color: var(--primary-dark);
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 8px;
}

.title-en {
    color: var(--text-gray);
    font-size: 1em;
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}

.research-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pdf-link-minimal,
.arxiv-link-minimal {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 400;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdf-link-minimal:hover,
.arxiv-link-minimal:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
}

.proof-label {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
    margin-left: 8px;
}

/* === 4. УЛУЧШЕННЫЕ MARKDOWN БЛОКИ === */
.markdown-block,
.example-block {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    color: #e2e8f0;
    border: 1px solid #2d3748;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.markdown-block pre,
.example-block pre {
    background: rgba(0,0,0,0.3);
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 18px;
    line-height: 1.5;
    color: #e2e8f0;
}

.markdown-block code,
.example-block code {
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 18px;
    color: #81e6d9;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 10;
}

.copy-code-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* === 5. УЛУЧШЕННЫЙ TELEGRAM CTA === */
.footer-cta {
    margin-top: 15px;
    text-align: center;
}

.telegram-cta {
    background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 136, 204, 0.3);
}

.telegram-cta:hover {
    background: linear-gradient(135deg, #0077b3 0%, #1a8bc0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
    text-decoration: none;
    color: white;
}

/* === 6. RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .nav-brand {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .nav-brand-logo {
        width: 40px;
        height: 40px;
    }
    
    .nav-brand-text h1 {
        font-size: 1.5rem;
    }
    
    .research-footer-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .research-links {
        justify-content: center;
    }
    
    .capability-tags-horizontal {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .capability-tag {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .capabilities-section {
        padding: 20px;
    }
    
    .capability-subsection {
        padding: 8px 0 0 0;
    }
    
    .telegram-cta {
        padding: 10px 20px;
        font-size: 1em;
    }
}

/* === AUTH POPUP STYLES === */
.nova-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.auth-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.auth-popup-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    animation: slideInScale 0.3s ease-out;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-popup-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-popup-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.auth-close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
}

.auth-close-btn:hover {
    color: #2c3e50;
}

.auth-popup-body {
    padding: 20px;
}

.auth-popup-body p {
    margin: 0 0 20px;
    color: #64748b;
    line-height: 1.5;
}

.telegram-auth-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.telegram-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* === СОВРЕМЕННАЯ SKELETON LOADING СИСТЕМА === */

/* Skeleton контейнер - точная копия research-grid */
.skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: var(--spacing-lg);
    margin: 0;
    margin-top: 0px; /* Тот же отступ что у research-grid */
}

/* Skeleton карточка - точная копия research-card */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px; /* Минимальная высота как у настоящих карточек */
}

/* Базовый элемент скелетона */
.skeleton-element {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite ease-in-out;
    border-radius: 6px;
}

/* Имитация .card-title - ОБНОВЛЕНО под новый размер 1.4rem */
.skeleton-title {
    height: 28px;
    width: 85%;
    margin-bottom: 24px;
}

.skeleton-title-line2 {
    height: 28px;
    width: 65%;
    margin-bottom: 24px;
}

/* Имитация .key-result-preview - ОБНОВЛЕНО под новый стиль без фона */
.skeleton-key-result {
    margin-bottom: var(--spacing-sm);
    height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-left: 0;
}

.skeleton-key-result-line {
    height: 18px;
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite ease-in-out;
    border-radius: 6px;
}

.skeleton-key-result-line.line1 { width: 100%; }
.skeleton-key-result-line.line2 { width: 85%; }
.skeleton-key-result-line.line3 { width: 60%; }

/* Имитация .card-categories */
.skeleton-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.skeleton-tag {
    height: 28px;
    width: 90px;
    border-radius: 12px;
}

.skeleton-tag.capability { width: 110px; }
.skeleton-tag.domain { width: 95px; }

/* Имитация .card-footer */
.skeleton-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid #f1f3f4;
}

.skeleton-date {
    height: 16px;
    width: 85px;
}

.skeleton-rating {
    height: 26px;
    width: 45px;
    border-radius: 6px;
}

/* Skeleton анимация */
@keyframes skeleton-wave {
    0% { 
        background-position: -200% 0; 
    }
    100% { 
        background-position: 200% 0; 
    }
}

/* Загрузочный спиннер */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Старые стили для совместимости */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite;
    border-radius: 4px;
}

/* Skeleton для фильтров */
.filter-skeleton {
    height: 40px;
    width: 180px;
    margin-bottom: var(--spacing-sm);
}

/* Skeleton показ/скрытие */
.skeleton-show {
    display: block;
}

.skeleton-hide {
    display: none;
}

/* ===== PRO USER STYLES ===== */
/* Основные стили для пользовательского статуса */
.user-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* PRO статус с коронкой */
.user-status.pro {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #000;
    padding-left: 20px; /* Дополнительное место для коронки */
}

/* Коронка через псевдоэлемент */
.user-status.pro::before {
    content: "👑";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-style: normal;
    line-height: 1;
}

/* FREE статус */
.user-status.free {
    background: linear-gradient(135deg, #90ee90 0%, #32cd32 100%);
    color: #000;
}

/* Стили для меню пользователя */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.username {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* ========================================
   🆕 SEARCH IN HEADER-LEFT STYLES
   ======================================== */

/* Поиск прижат справа в header-left */
.search-container-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto; /* Прижимает к правому краю */
    margin-right: 0;
}

.search-input-header {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
    background: #fff;
    transition: all 0.2s;
}

.search-input-header:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.clear-btn-header {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.clear-btn-header:hover {
    background: #ff5722;
    color: white;
    border-color: #ff5722;
}

.clear-btn-header:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

/* Адаптивность поиска в header */
@media (max-width: 1200px) {
    .search-input-header {
        width: 250px;
        font-size: 13px;
    }
    
    .search-container-header {
        margin-left: 15px;
        margin-right: 10px;
    }
}

@media (max-width: 768px) {
    .search-container-header {
        display: none; /* На мобильных используется кнопка "📱 Фильтры" */
    }
}

/* ========================================
   🆕 ACCESS TYPE FILTER STYLES (HEADER)
   ======================================== */

/* Фильтр доступа в header */
.access-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.access-filter-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    display: none;
}

.access-checkboxes-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.access-checkbox-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    font-size: 13px;
}

.access-checkbox-header:hover {
    border-color: #2196f3;
    background: #f8f9ff;
}

.access-checkbox-header input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

.checkbox-label-header {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.access-item-count-header {
    background: #f5f5f5;
    color: #666;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    min-width: 14px;
    text-align: center;
    margin-left: 2px;
}

/* Состояние checked для header */
.access-checkbox-header input[type="checkbox"]:checked + .checkbox-label-header {
    color: #2196f3;
    font-weight: 600;
}

.access-checkbox-header:has(input:checked) {
    border-color: #2196f3;
    background: #f8f9ff;
}

.access-checkbox-header:has(input:checked) .access-item-count-header {
    background: #2196f3;
    color: white;
}

/* Адаптивность для header */
@media (max-width: 1200px) {
    .access-checkboxes-header {
        gap: 8px;
    }
    
    .access-checkbox-header {
        padding: 3px 6px;
    }
    
    .checkbox-label-header {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .access-checkboxes-header {
        flex-direction: column;
        gap: 4px;
    }
    
    .access-checkbox-header {
        padding: 6px 8px;
        width: 100%;
        justify-content: space-between;
    }
    
    .checkbox-label-header {
        font-size: 13px;
    }
}

/* ================================================================
   FAVORITES SYSTEM - Minimal Button Styles v2.0
   ================================================================ */

.back-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.favorites-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #ffd700;
    border-radius: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
}

.favorites-btn:hover {
    background: linear-gradient(135deg, #fffbf0 0%, #fff4d6 100%);
    border-color: #ffcc00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.favorites-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}