

/* Стили для заголовка панели с кнопками */
.chat-panel-header {
    padding: 5px 20px;
    background: #4a90e2;
    color: white;
    display: flex;
    
    align-items: center;
    font-size: 18px;
    font-weight: bold;
}

/* Контейнер для кнопок в хедере */
.chat-header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between; /* Кнопки прижаты вправо */
    width: 100%;
}

/* Стили для кнопки "Назад" (стрелочка) */
.chat-back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    line-height: .8;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.chat-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Стили для кнопки закрытия (оставляем как было) */
.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);
}


/* Настройки страницы */
body:has(.ApplicationLayout) #gcAccountUserMenu,
.help-widget-button {
    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/203/h/c0132f8afa88b4a3a179b7694cb6966d.png) repeat center, linear-gradient(123deg, #84b37d 0%, #ccd5af 50.55%, #70a788 100%); 
}

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

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

.CompactHeader {
    height: 70px !important;
}

.CompactHeader__back-wrapper {
    display: none;
}

.ChatMessage__day {
    margin: 20px 0;
}

.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__right a {
    word-break: break-all;
}

.ChatMessage .ChatMessage__left {
	align-content: end;
}

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

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

.ChatMessage .ChatMessage__date {
    top: inherit;
    bottom: 0px;
    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;
}

.ChatMessage .ChatMessage__text {
	padding: 3px 0 5px;
    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: 1px;
    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;
}

.ChatMessageFiles__file {
    margin-right: 0 !important;
}

.ImageFile__preview-wrapper {
    width: 270px !important;
    margin-bottom: 15px;
}


.ChatPresenter__footer-input {
    font-family: Roboto, sans-serif;
    font-weight: 400 !important;
}

@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-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;
    }
}

.curator-iframe .DesktopLayoutColumn__bg, 
.curator-iframe .DesktopLayoutColumn__content {
    max-width: 100% !important;
}

.curator-iframe .ChatMessage {
    max-width: 400px !important;
}

.curator-iframe .CompactHeader__title,
.curator-iframe .CompactHeader__description,
.curator-iframe .CompactHeader__background {
    display: none;
}

.curator-iframe .CompactHeader {
    height: 20px !important;
    background: #4a90e2;
}

.curator-iframe .ChatPresenter__header-button svg {
    color: #fff;
}

.curator-iframe .ApplicationLayout {
    margin-left: 0 !important;
}

/* Оформление инфы о канале */
/* Стили для страницы настроек чата (BlocksPresenter) - светлая тема */
.Presenter .BlocksPresenter {
    background: #f5f5f5;
}

.Presenter .BlocksPresenter .DesktopLayoutColumn__bg,
.Presenter .BlocksPresenter .DesktopLayoutColumn__content {
    max-width: 100% !important;
}

/* Скрываем стандартный хедер на странице настроек */
.Presenter .BlocksPresenter .CompactHeader {
    display: none !important;
}

/* Стили для заголовка блока */
.Presenter .BlocksPresenter .PresenterLayout__content-header {
    padding: 16px 16px 8px 16px;
    background: transparent;
    border-bottom: none;
    margin-bottom: 20px;
}

.Presenter .BlocksPresenter .PresenterLayout__content-header-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f1f1f;
    margin-bottom: 4px;
}

.Presenter .BlocksPresenter .PresenterLayout__content-header-description {
    font-size: 14px;
    color: #6c6c6c;
}

/* Стили для блоков (ScreenBlock) */
.Presenter .BlocksPresenter .ScreenBlock {
    background: #ffffff;
    margin: 0 12px;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.Presenter .BlocksPresenter .ScreenBlock.__clickable {
    margin-bottom: 10px !important;
    border-radius: 6px !important;
}

.Presenter .BlocksPresenter .ScreenBlock:hover {
    background: #fafafa;
    border-color: #d0d0d0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.Presenter .BlocksPresenter .ScreenBlock.__clickable:active {
    transform: scale(0.99);
}

/* Левая часть блока с иконкой/аватаром */
.Presenter .BlocksPresenter .ScreenBlock__left {
    flex-shrink: 0;
}

.Presenter .BlocksPresenter .ScreenBlock__logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.Presenter .BlocksPresenter .Logo.__large {
    width: 48px;
    height: 48px;
    background-size: cover;
    background-position: center;
}

.Presenter .BlocksPresenter .Logo.__medium {
    width: 48px;
    height: 48px;
    font-size: 24px;
    color: #4a90e2;
}

.Presenter .BlocksPresenter .Logo i {
    font-size: 24px;
    color: #4a90e2;
}

/* Правая часть блока */
.Presenter .BlocksPresenter .ScreenBlock__right {
    flex: 1;
    min-width: 0;
}

.Presenter .BlocksPresenter .ScreenBlock__right-wrapper {
    width: 100%;
}

.Presenter .BlocksPresenter .ScreenBlock__item-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.Presenter .BlocksPresenter .ScreenBlock__item-title-left {
    font-size: 16px;
    font-weight: 500;
    color: #1f1f1f;
}

.Presenter .BlocksPresenter .ScreenBlock__item-title-left--with-description {
    margin-bottom: 2px;
}

.Presenter .BlocksPresenter .ScreenBlock__item-title-right {
    font-size: 12px;
    color: #8e8e8e;
}

.Presenter .BlocksPresenter .ScreenBlock__description {
    font-size: 13px;
    color: #8e8e8e;
    line-height: 1.4;
}

/* Стили для кнопки */
.Presenter .BlocksPresenter .ButtonBlock {
    padding: 8px 0 !important;
    margin: 16px 10px 20px !important;
}

.Presenter .BlocksPresenter .ButtonBlock__button {
    width: 100%;
    padding: 12px 20px;
    background: #e74c3c;
    border: none;
    border-radius: 6px !important;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.Presenter .BlocksPresenter .ButtonBlock__button:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.Presenter .BlocksPresenter .ButtonBlock__button:active {
    transform: translateY(0);
}

/* Убираем лишние элементы */
.Presenter .BlocksPresenter .PresenterLayout__footer,
.Presenter .BlocksPresenter .Presenter__loader,
.Presenter .BlocksPresenter .Toolbar,
.Presenter .BlocksPresenter .DesktopAppearance__qr,
.Presenter .BlocksPresenter .FileCatcher {
    display: none !important;
}

/* Стили для темной темы (адаптация под общий стиль) */
.Presenter .BlocksPresenter .ScreenBlock {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Стили для иконок Font Awesome (если используются) */
.Presenter .BlocksPresenter .fa,
.Presenter .BlocksPresenter .fas {
    color: #4a90e2;
}

/* Стили для блока участников */
.Presenter .BlocksPresenter .ScreenBlock:has(.fa-users) .ScreenBlock__item-title-left {
    font-weight: 500;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .Presenter .BlocksPresenter .PresenterLayout__content-header {
        padding: 12px 16px 4px 16px;
        margin-bottom: 16px;
    }
    
    .Presenter .BlocksPresenter .PresenterLayout__content-header-title {
        font-size: 20px;
    }
    
    .Presenter .BlocksPresenter .ScreenBlock {
        margin: 0 10px;
        padding: 10px 14px;
    }
    
    .Presenter .BlocksPresenter .ScreenBlock.__clickable {
        margin-bottom: 8px !important;
    }
    
    .Presenter .BlocksPresenter .ScreenBlock__logo {
        width: 40px;
        height: 40px;
    }
    
    .Presenter .BlocksPresenter .Logo.__large {
        width: 40px;
        height: 40px;
    }
    
    .Presenter .BlocksPresenter .Logo.__medium {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .Presenter .BlocksPresenter .Logo i {
        font-size: 20px;
    }
    
    .Presenter .BlocksPresenter .ScreenBlock__item-title-left {
        font-size: 15px;
    }
    
    .Presenter .BlocksPresenter .ScreenBlock__description {
        font-size: 12px;
    }
    
    .Presenter .BlocksPresenter .ButtonBlock {
        margin: 12px 8px 16px !important;
    }
    
    .Presenter .BlocksPresenter .ButtonBlock__button {
        padding: 10px 16px;
        font-size: 15px;
    }
}

.chatium-page-body.chat-system.curator-iframe .DesktopAppearance__left.__dark,
.chatium-page-body.chat-system.curator-iframe #gcAccountUserMenu,
.chatium-page-body.chat-system.curator-iframe .PreviewWrapper__iphone-bottom-bar,
.chatium-page-body.chat-system.curator-iframe .PreviewWrapper__iphone-time,
.chatium-page-body.chat-system.curator-iframe .PreviewWrapper__iphone-frame  {
	display: none;
}

.chatium-page-body.chat-system.curator-iframe .gc-main-content.with-left-menu {
	margin-left: 0 !important;
}

.chatium-page-body.chat-system.curator-iframe .PreviewWrapper__preview {
	position: static;
	width: 100vw;
	height: 100vh;
}

.chatium-page-body.chat-system.curator-iframe .PreviewWrapper__frame {
	max-width: 100% !important;
}

.chatium-page-body.chat-system.curator-iframe .PreviewWrapper__frame .ButtonBlock__button {
	max-width: 400px;
}

.DesktopAppearance__qr {
    display: none;
}
