

/* Настройки страницы */
body:has(.ApplicationLayout) #gcAccountUserMenu {
    display: none !important;
}

.DesktopLayoutColumn__bg,
.DesktopLayoutColumn__content {
    max-width: 420px !important;
}


.ChatPresenter__content {
    background: url(https://fs.getcourse.ru/fileservice/file/download/a/586882/sc/190/h/7df1f74e6e159223ecba121f9c72333b.png) no-repeat center top / cover, radial-gradient(111.26% 61.72% at 62.74% 39.61%, #e7f9e7 0%, #c4d7c6 100%); 
}

.ApplicationLayout.with-menu .ChatPresenterLayout.PresenterLayout .PresenterLayout__content {
    margin-bottom: 0;
}

/* Настройки чата */

.CompactHeader {
    height: 70px !important;
}

.CompactHeader__back-wrapper {
    display: none;
}

.ChatMessage__day {
    margin-top: 20px;
}

.ChatMessage__day-text {
    background: rgba(0,0,0,.4);
    color: #fff;
}

.ChatMessage .ChatMessage__right {
    position: relative;
    padding: 8px 12px;
    background: rgba(255,255,255,0.9);
    
    box-shadow: 0 3px 3px 0 rgba(0,0,0,.1);
    overflow: visible;
}

.ChatMessage .ChatMessage__author-photo {
    top: 7px;
    width: 44px;
    height: 44px;
}

.ChatMessage.__same-author {
    margin-top: -12px;
}

.ChatMessage .ChatMessage__date {
    top: inherit;
    bottom: 5px;
    right: 8px;
}

.ChatMessage .ChatMessage.__another-author {
    margin-top: 0px;
}

.ChatMessage .ChatMessage__author-name {
    margin-top: 3px;
    font-size: 14px;
    font-weight: 500;
    font-family: Roboto, sans-serif;
    color: #683CDE;
}

.ChatMessage .ChatMessage__text {
    font-family: Roboto, sans-serif;
    color: #292929;
}


.ChatMessage.__another-author:has(+ .__same-author) .ChatMessage__author-photo {
    display: none;
}

.ChatMessage.__same-author:last-child .ChatMessage__author-photo,
.ChatMessage.__same-author:has(+ .__another-author) .ChatMessage__author-photo {
    display: block;
    top: -7px;
    text-align: center;
    align-content: center;
}




.ChatMessage.__another-author .ChatMessage__right {
    border-radius: 15px 15px 15px 0px;
}

.ChatMessage.__another-author:has(+ .__same-author) .ChatMessage__right {
    border-radius: 15px 15px 5px 5px;
}

.ChatMessage.__same-author .ChatMessage__right {
    border-radius: 5px 5px 5px 5px;
}

.ChatMessage.__same-author:last-child .ChatMessage__right,
.ChatMessage.__same-author:has(+ .__another-author) .ChatMessage__right {
    border-radius: 5px 5px 15px 0px;
}

.ChatMessage.__same-author:last-child .ChatMessage__right::before,
.ChatMessage.__same-author:has(+ .__another-author) .ChatMessage__right::before,
.ChatMessage.__another-author .ChatMessage__right::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0px;
    transform: translatex(-100%);
    width: 24px;
    height: 24px;
    
    background: url("data:image/svg+xml,%3Csvg width='75' height='94' viewBox='0 0 75 94' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M74.8201 94H6.32007C-1.42299 94 -2.33233 88.2694 5.15702 86.3035C5.56914 86.1953 5.95795 86.0939 6.32007 86C56.9439 72.873 74.8201 29.9304 74.8201 0V94Z' fill='white' /%3E%3C/svg%3E") no-repeat center / cover;
}

.ChatMessage.__another-author:has(+ .__same-author) .ChatMessage__right::before {
    display: none;
}


@media (max-width: 900px) {
    .ChatMessage .ChatMessage__date {
        margin: 0;
    }
    
    .ChatMessage__date-date {
        display: block !important;
    }
    
    .ChatMessage__wrapper {
        padding-right: 20px;
    }
    
    .ChatPresenter__footer-input {
        margin-bottom: 10px;
    }
}

/* Стили для круглых кнопок */
.chat-toggle-btn {
    position: fixed;
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-button-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid white;
}

/* Счетчик новых сообщений */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 20px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    text-align: center;
    line-height: 12px;
    animation: pulse 2s infinite;
    border: 2px solid white;
    z-index: 9999;
}

/* Анимация пульсации */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Стили для панелей */
.chat-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.chat-panel.open {
    right: 0;
}

.chat-panel-header {
    padding: 15px 20px;
    background: #4a90e2;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chat-close-btn:hover {
    transform: rotate(90deg);
}

.chat-panel-content {
    flex: 1;
    overflow: hidden;
}

.chat-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Затемнение фона */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
}

.chat-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Предотвращение скролла фона */
body.chat-open {
    overflow: hidden;
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-panel {
        width: 100%;
        right: -100%;
    }
    
    .chat-toggle-btn {
        width: 50px;
        height: 50px;
    }
}
