/* ===== СОВРЕМЕННЫЙ ДИЗАЙН ЧАТА НОВОСТЕЙ ===== */

/* Main chat container */
#chatContainer {
    width: 100%;
    max-width: 980px;
    margin: 30px auto;
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.05), 0 5px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid #edf2f7;
    box-sizing: border-box;
    margin-top: 40px;
}

/* Верхняя панель с заголовком */
#chatTopBar {
    border-radius: 16px 16px 0 0;
    padding: 10px 10px;
    background: #f8fafc;
    position: relative;
    border-bottom: 1px solid #edf2f7;
}

#chatTopBar .name2 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
   
    display: block;
}

#chatTopBar .name2 strong {
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 40px;
    margin-left: 8px;
    font-size: 18px;
    display: inline-block;
}

/* Контейнер сообщений */
#chatLineHolder {
    min-height: 500px;
    max-height: 500px;
    height: auto;
	margin-top: 10px;
    width: 100%;
    background: #fff;
    overflow-y: auto;
    box-sizing: border-box;
    padding-bottom: 10px;
    /* Стилизация скроллбара */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #eef2f6;
}

/* Красивый скроллбар */
#chatLineHolder::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#chatLineHolder::-webkit-scrollbar-track {
    background: #eef2f6;
    border-radius: 100px;
    margin: 8px 0;
}

#chatLineHolder::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 100px;
    border: 2px solid #eef2f6;
    transition: all 0.2s ease;
}

#chatLineHolder::-webkit-scrollbar-thumb:hover {
    background: #6EB238;
    border-color: #d4e6c0;
}

/* Карточка новости */
.chat {
    background: #fff;
    border-radius: 6px;
    padding: 10px 20px;
    margin: 10px 10px 1px 10px;
    border: 1px solid #e9edf2;
    border-left: 2px solid #6EB238;
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.1);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat:hover {
    background: #fff;
	border-right: 1px solid #6EB238;
	border-top: 1px solid #6EB238;
	border-bottom: 1px solid #6EB238;
    box-shadow: 0 6px 12px rgba(46, 125, 50, 0.35);
}

/* Текст тоже только цвет */
.chat:hover .text {
    color: #333;
}

.chat:hover .author::before {
    background: #f1736d;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Индикатор новизны */
.chat::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 92%;
    background: #6EB238;
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat:hover::before {
    opacity: 1;
}

/* Время публикации */
.chat .author {
    color: #6EB238;
    font-size: 12px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat .author::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #e44139;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.8;
}

/* Текст новости */
.chat .text {
    color: #333333;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 400;
    margin: 0;
    word-wrap: break-word;
}

/* Первое сообщение (самое новое) */
.chat:first-child {
    border-color: #d0e6b8;
}

.chat:first-child .author {
    color: #5a9a2c;
    font-weight: 700;
}

.chat:first-child .author::before {
    background: #5a9a2c;
    opacity: 1;
}

/* ===== ПЛАВНОЕ ВЫДВИЖЕНИЕ НОВОГО СООБЩЕНИЯ ===== */
.chat.new {
    animation: slideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Плавнее, чем ease-out */
    /* или используйте: ease-out, ease-in-out и т.д. */
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(30px); /* Чуть больше движения */
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media only screen and (max-width: 600px) {
    #chatContainer {
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
        margin: 0;
        max-width: 100%;
    }

    /* Шапка - серая, скругление только сверху */
#chatTopBar {
    background: #f8fafc;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    /* border-bottom: 1px solid #6EB238; */
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

    #chatTopBar .name2 {
        color: #333333;
        font-size: 20px;
        font-weight: 600;
        text-shadow: none;
        display: block;
        line-height: 1.4;
    }

    #chatTopBar .name2 strong {
        font-weight: 700;
        padding: 4px 12px;
        border-radius: 40px;
        margin-left: 8px;
        font-size: 28px;
        display: inline-block;
        background: transparent;
        color: #333333;
    }
    
    #chatLineHolder {

        scrollbar-width: thin;
        scrollbar-color: #6EB238 #eef2f6;
        padding: 16px;
        max-height: 920px;
    }
    
    /* Для Chrome, Safari, Edge на мобильных */
    #chatLineHolder::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    #chatLineHolder::-webkit-scrollbar-track {
        background: #eef2f6;
        border-radius: 100px;
    }
    
    #chatLineHolder::-webkit-scrollbar-thumb {
        background: #6EB238;
        border-radius: 100px;
        border: 1px solid #d4e6c0;
    }
    
    #chatLineHolder::-webkit-scrollbar-thumb:hover {
        background: #5a9a2c;
    }

    .chat {
        padding: 20px;
        margin: 0 0 16px 0;
        border-radius: 12px;
        gap: 10px;
    }

    .chat .author {
        font-size: 20px;
    }

    .chat .text {
        font-size: 25px;
        line-height: 1.5;
    }

    .chat:not(:last-child)::after {
        display: none;
    }

    /* Скрываем "главные" на мобильных */
    .hide_mobile {
        display: none;
    }
}

