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

.article-meta-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 10px 0 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 0 solid #747bf5;
    border-radius: 8px;
    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;
}

/* Глобальный тултип (универсальный) */
.global-site-tooltip {
    position: fixed;
    z-index: 1100;
    background-color: #2c3e50;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.global-site-tooltip.active {
    opacity: 0.95;
    visibility: visible;
}

/* Стрелка тултипа */
.global-site-tooltip::after {
    content: '';
    position: absolute;
    left: var(--arrow-x, 50%);
    border: 6px solid transparent;
    transform: translateX(-50%);
}

/* Стрелка снизу (тултип сверху) */
.global-site-tooltip[data-position="top"]::after {
    top: 100%;
    border-top-color: #2c3e50;
}

/* Стрелка сверху (тултип снизу) */
.global-site-tooltip[data-position="bottom"]::after {
    bottom: 100%;
    border-bottom-color: #2c3e50;
}

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

.views-count, .word-count, .character-count, .digit-count, .number-count, .punctuation-count {
    font-weight: 500;
}

.views-count strong, .word-count strong, .character-count strong, .digit-count strong, .number-count strong, .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 {
        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, .stats-modal-trigger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 1;
        min-width: 120px;
        padding: 8px 12px;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .meta-toggle-btn:active, .stats-modal-trigger-btn:active {
        transform: scale(0.96);
        background: #e5e7eb;
    }

    .stats-modal-trigger-btn {
        background: #eff6ff;
        border-color: #dbeafe;
        color: #2563eb;
    }

    .stats-modal-trigger-btn i {
        color: #2563eb !important;
    }

    .stats-modal-trigger-btn:active {
        background: #dbeafe;
    }
}

/* МОДАЛЬНОЕ ОКНО */
.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;
}

.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;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

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

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

.stats-modal-title {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
    font-weight: 700;
}

.stats-modal-close {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
    transition: all 0.2s ease;
}

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

.stats-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f9fafb;
}

.stats-modal-item:last-child {
    border-bottom: none;
}

.stats-modal-item-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.stats-modal-item-label i {
    font-size: 1.1rem;
    color: #747bf5;
    margin-top: 3px;
    min-width: 24px;
    text-align: center;
}

.stats-modal-item-label span {
    display: block;
    color: #374151;
    font-weight: 600;
}

.stats-modal-item-description {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: normal !important;
    margin-top: 2px;
}

.stats-modal-item-value {
    font-weight: 700;
    color: #111827;
    font-size: 1rem;
    text-align: right;
    padding-left: 15px;
}

/* Специальные стили для времени чтения и сессий в модале */
.stats-modal-item.reading-time {
    border-left: 4px solid #2ecc71;
    padding-left: 10px;
    background: #f0fff4;
    margin: 5px -10px;
    padding-right: 10px;
}

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

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

.stats-modal-item.reading-sessions {
    border-left: 4px solid #9b59b6;
    padding-left: 10px;
    background: #faf5ff;
    margin: 5px -10px;
    padding-right: 10px;
}

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

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