/* ================================
   СТИЛИ ДЛЯ СТАТИСТИКИ ЧТЕНИЯ
   ================================ */

.article-meta-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 10px 0 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 0 solid #3498db;
    border-radius: 6px;
    align-items: center;
}

.article-meta-stats span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #555;
    position: relative;
    cursor: help;
    transition: all 0.2s ease;
}

/* Tooltip на наведение (десктоп) */
.article-meta-stats span[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: fixed;
    left: var(--tooltip-left, 50%);
    top: var(--tooltip-top, 0);
    transform: translateX(0);
    background-color: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    animation: tooltipSlideUp 0.2s ease-out;
}

.article-meta-stats span[data-tooltip]:hover::before {
    content: '';
    position: fixed;
    left: var(--tooltip-arrow-left, 50%);
    top: var(--tooltip-arrow-top, 0);
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    z-index: 1000;
    pointer-events: none;
    animation: tooltipSlideUp 0.2s ease-out;
}

@keyframes tooltipSlideUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-meta-stats i {
    color: #3498db;
    min-width: 16px;
    text-align: center;
}

.views-count {
    font-weight: 500;
}

.views-count strong {
    color: #2c3e50;
    font-weight: 600;
}

.word-count {
    font-weight: 500;
}

.word-count strong {
    color: #2c3e50;
    font-weight: 600;
}

.character-count {
    font-weight: 500;
}

.character-count strong {
    color: #2c3e50;
    font-weight: 600;
}

.digit-count {
    font-weight: 500;
}

.digit-count strong {
    color: #2c3e50;
    font-weight: 600;
}

.number-count {
    font-weight: 500;
}

.number-count strong {
    color: #2c3e50;
    font-weight: 600;
}

.punctuation-count {
    font-weight: 500;
}

.punctuation-count strong {
    color: #2c3e50;
    font-weight: 600;
}

.reading-time {
    background-color: white;
    padding: 8px 12px;
    border-radius: 3px;
    border-left: 3px solid #2ecc71;
}

.reading-time strong {
    color: #2ecc71;
    font-weight: 600;
    font-size: 16px;
}

.reading-sessions {
    background-color: white;
    padding: 8px 12px;
    border-radius: 3px;
    border-left: 3px solid #9b59b6;
}

.reading-sessions strong {
    color: #9b59b6;
    font-weight: 600;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .article-meta-stats {
        gap: 12px;
        padding: 12px;
    }
    
    .article-meta-stats span {
        font-size: 13px;
    }
    
    .reading-time strong,
    .reading-sessions strong,
    .word-count strong {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* Скрываем блок статистики на планшетных и мобильных */
    .article-meta-stats {
        display: none;
    }
}

@media (max-width: 480px) {
    /* На мобильной версии показываем контейнер с кнопками */
    .mobile-meta-buttons-container {
        display: flex !important;
        gap: 8px;
        margin: 10px 0 12px 0;
        flex-wrap: wrap;
    }
    
    /* Стили для кнопки "Информация" */
    .meta-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 1;
        min-width: 120px;
        padding: 8px 12px;
        background: #f3f4f6;
        border: none;
        border-radius: 6px;
        font-size: 13px;
        color: #374151;
        cursor: pointer;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
        transition: all 0.2s ease;
    }
    
    .meta-toggle-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .meta-toggle-btn i {
        font-size: 14px;
    }
    
    /* Стили для кнопки "Статистика" */
    .stats-modal-trigger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 1;
        min-width: 120px;
        padding: 8px 12px;
        background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    }
    
    .stats-modal-trigger-btn:active {
        transform: scale(0.95);
        box-shadow: 0 1px 4px rgba(52, 152, 219, 0.4);
    }
    
    .stats-modal-trigger-btn i {
        font-size: 14px;
    }
}

/* ================================
   МОДАЛЬНОЕ ОКНО ДЛЯ МОБИЛЬНЫХ
   ================================ */

.stats-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.stats-modal-overlay.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.stats-modal {
    background-color: white;
    width: 100%;
    border-radius: 12px 12px 0 0;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.stats-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.stats-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.stats-modal-close:hover {
    color: #666666;
    background: #e5e7eb;

}

.stats-modal-content {
    display: grid;
    gap: 12px;
}

.stats-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.stats-modal-item.reading-time {
    border-left-color: #2ecc71;
}

.stats-modal-item.reading-sessions {
    border-left-color: #9b59b6;
}

.stats-modal-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 14px;
}

.stats-modal-item-label i {
    color: #3498db;
    font-size: 16px;
    min-width: 16px;
}

.stats-modal-item.reading-time .stats-modal-item-label i {
    color: #2ecc71;
}

.stats-modal-item.reading-sessions .stats-modal-item-label i {
    color: #9b59b6;
}

.stats-modal-item-label > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stats-modal-item-label span:first-child {
    font-weight: 500;
    color: #2c3e50;
}

.stats-modal-item-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.stats-modal-item-description {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    font-weight: 400;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .stats-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
}
