/* Модальное окно */
.news-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0 15px;
}

.news-container.hidden {
    display: none !important;
}

.news-group {
    margin: 5px;
    background: rgba(20, 20, 20, 0.7);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.news-group:hover {
    overflow-y: auto;
}

.news-group::-webkit-scrollbar {
    width: 2px;
}

.news-group::-webkit-scrollbar-track {
    background: rgba(var(--text-color), 0.1);
    border-radius: 3px;
}

.news-group::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.group-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: rgba(30, 30, 30, 0.8);
    border-bottom: 1px solid rgba(var(--accent-color), 0.1);
}

.group-icon {
    font-size: 14px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 12px;
}

.news-group:nth-child(1) .group-icon {
    background: rgba(var(--accent-color-back), 0.12);
    color: rgba(var(--accent-color-back), 0.8);
}

.news-group:nth-child(2) .group-icon {
    background: rgba(var(--primary-color), 0.15);
    color: rgba(var(--primary-color), 0.8);
}

.news-group:nth-child(3) .group-icon {
    background: rgba(var(--accent-color), 0.15);
    color: rgba(var(--accent-color), 0.8);
}

.group-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
}

.group-badge {
    background: rgba(var(--secondary-color), 0.4);
    color: var(--secondary-text-color);
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
}

.group-items {
    padding: 10px 15px;
}

.news-item {
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: rgba(30, 30, 30, 0.5);
    transition: all 0.2s;
}

.news-item:last-child {
    margin-bottom: 5px;
}

.news-item:hover {
    background: rgba(40, 40, 40, 0.6);
    transform: translateX(3px);
}

.news-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 500;
    margin-bottom: 8px;
}

.news-title {
    margin: 0;
    color: var(--text-color);
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 6px;
}

.news-text {
    margin: 0;
    color: var(--secondary-text-color);
    font-size: 10px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-date {
    font-size: 9px;
    color: var(--note-date-color);
}

.news-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

/* Добавленные стили для детального просмотра */
.news-detail {
    display: none;
    height: 100%;
    width: 100%;
    padding: 20px;
    overflow-y: hidden;
    scrollbar-gutter: stable;
    color: var(--text-color);
}

.news-detail:hover {
    overflow-y: auto;
}

.news-detail::-webkit-scrollbar {
    width: 2px;
}

.news-detail::-webkit-scrollbar-track {
    background: rgba(var(--text-color), 0.1);
    border-radius: 3px;
}

.news-detail::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.news-detail.visible {
    display: block !important;
}

.detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.back-button {
    background: rgba(var(--primary-color), 0.2);
    color: var(--text-color);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s;
    margin-right: 15px;
}

.back-button:hover {
    background: rgba(var(--primary-color), 0.3);
    transform: translateX(-3px);
}

.detail-tag {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.detail-title {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.detail-date {
    font-size: 10px;
    color: var(--note-date-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(var(--accent-color), 0.2);
}

.detail-content {
    font-size: 10px;
    line-height: 1.6;
    color: var(--secondary-text-color);
}

.detail-content p {
    margin-bottom: 15px;
    font-size: 10px;

}

/* Мобильные стили для новостей */
@media (max-width: 768px) {
    #newsModal .modal-content {
        width: 95vw !important;
        max-width: 100vw;
        height: 90vh !important;
        margin: 5vh auto !important;
        padding: 0;
    }

    .news-container {
        flex-direction: column;
        padding: 0 10px;
        height: 100%;
    }

    .news-group {
        margin: 8px 0;
        width: 100%;
    }

    .group-header {
        padding: 12px 15px;
    }

    .group-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
        margin-right: 10px;
    }

    .group-header h3 {
        font-size: 14px;
    }

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

    .group-items {
        padding: 8px 10px;
    }

    .news-item {
        padding: 12px;
        margin-bottom: 10px;
    }

    .news-tag {
        font-size: 10px;
        padding: 4px 10px;
    }

    .news-title {
        font-size: 13px;
    }

    .news-text {
        font-size: 12px;
    }

    .news-date {
        font-size: 11px;
    }

    /* Детальный просмотр */
    .news-detail {
        padding: 15px;
    }

    .back-button {
        padding: 10px 15px;
        font-size: 14px;
    }

    .detail-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .detail-date {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .detail-content {
        font-size: 14px;
        line-height: 1.6;
    }

    /* Анимации */
    .news-item {
        transition: transform 0.2s ease, background 0.2s ease;
    }

    /* Оптимизация для touch-устройств */
    @media (hover: none) {
        .news-item:hover {
            transform: none;
            background: rgba(30, 30, 30, 0.5);
        }
    }
}
