@import url('inviteMessageCard.css');
@import url('audio_file_handler.css');
@import url('sticker_pack_card.css');
@import url('voiceChannelJoin.css');
@import url('chatPlaceholders.css');

.day-span {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: var(--text-muted);
}

.day-span::before,
.day-span::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--background-modifier-accent);
}

.day-span-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 12px;
}

.new-messages-separator .day-span-text {
    color: var(--status-danger);
}

.new-messages-separator::before,
.new-messages-separator::after {
    border-bottom: 1px solid var(--status-danger);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

.chat-header {
    border: none;
    display: flex;
    align-items: center;
    padding-left: 12px;
    transition: background-color 0.2s ease;
    min-height: 53px;
    width: 100%;
    border-bottom: 1px solid var(--outline);
    position: fixed;
    z-index: 999;
}

.info-header-chat {
    display: flex;
    align-items: center;
    margin-right: auto;
    width: auto;
    padding: 4px 8px;
    height: 80%;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.1s ease, scale 0.1s ease;
    transform: scale(1);
}

.info-header-chat .avatarConversion {
    width: 25px;
    height: 25px;
}

.info-header-chat .usernameConversion {
    margin-right: initial;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.25;
}

.chat-action-search-container {
    position: relative;
    margin-right: 8px;
    width: 100px;
    transition: width 0.2s ease;
    flex-shrink: 0;
}

.chat-action-search {
    width: 100%;
    height: 24px;
    padding: 0 24px 0 8px;
    border-radius: 4px;
    border: none;
    background-color: var(--background-modifier-hover);
    color: var(--text-normal);
    font-size: 14px;
    font-family: var(--font-main);
    outline: none;
    transition: all 0.2s cubic-bezier(0.3, 0, 0, 1);
    box-sizing: border-box;
}

.chat-action-search::placeholder {
    color: var(--text-muted);
    font-size: 13px;
    opacity: 0.8;
}

.chat-action-search:focus .chat-action-search-container {
    width: 200px;
}

.chat-action-search:focus {
    background-color: var(--background-primary);
    box-shadow: 0 0 0 1px var(--accent);
}

.chat-action-search:focus::placeholder {
    opacity: 0.6;
}

.chat-action-search-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    z-index: 1;
}

[data-theme="light"] .chat-action-search-icon {
    filter: brightness(0.5);
}

.chat-action-search:focus+.chat-action-search-icon {
    opacity: 0.8;
}

.chat-action-search-container:has(.chat-action-search:focus) {
    width: 200px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    margin: 4px;
    z-index: 0;
    margin-top: 56px;

    /* --- НОВЫЕ СВОЙСТВА --- */
    display: flex;
    flex-direction: column;
}

.messages-container::before {
    content: "";
    margin-top: auto;
}

.message {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: min-content;
    margin-bottom: 4px;
    padding: 8px;
    border-radius: 4px;
    position: relative;
}

.message:hover {
    background-color: var(--background-modifier-hover);
}

.message-background {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.75s ease-out;
}

.message-background.highlighted {
    background-color: var(--background-primary-hover) !important;
    opacity: 0.4;
}


.message-loading {
    align-items: center;
    margin-left: 8px;
    vertical-align: middle;
    display: none;
}

.message-loading.active {
    display: inline-flex
}

.loading-dots {
    display: flex;
    gap: 3px;
}

.loading-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: dot-pulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes dot-pulse {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.message-header-info {
    grid-area: header-info;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 20px;
    margin-bottom: 2px;
}

.avatar {
    width: 35px;
    height: 35px;
    grid-area: avatar;
    border-radius: 50%;
    font-weight: 600;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.username {
    font-weight: 500;
    margin-right: 8px;
    align-items: flex-start;
    margin-top: -5px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-header-info .username:hover {
    text-decoration: underline;
    cursor: pointer;
}

.timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -5px;
}

.message-content {
    font-size: 16px;
    grid-area: content;
    line-height: 1.375;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    margin-top: -5px;
}

.message-header {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-areas:
        "avatar header-info"
        "avatar content";
    gap: 0 4px;
    align-items: normal;
}

.message-header .avatar {
    transform: translateY(0);
    transition: transform 0.15s ease;
    cursor: pointer;
}

.message-header .avatar:active {
    transform: translateY(-5px);
}

.message.repeat {
    padding: 3px;
    padding-bottom: 5px;
    margin-top: -3px;
}

.message.repeat .message-header-info,
.message.repeat .avatar {
    display: none;
}

.message.repeat .message-header {
    display: block;
    padding-left: 48px;
}

.message.repeat .message-content {
    margin-top: 0;
}

.message-form {
    padding: 12px 16px;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 200;
    padding-top: 0px;
}

.input-container {
    display: flex;
    align-items: center;
    background-color: var(--background-lighting);
    border-radius: 8px;
    padding: 0 16px;
    min-height: 52px;
    border: 1px solid var(--outline);
}

.input-container.startBorderByZero {
    border-start-end-radius: 0;
    border-start-start-radius: 0;
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-normal);
    padding: 12px 0;
    font-size: 15px;
    outline: none;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    font-family: "Segoe UI", sans-serif;
    position: relative;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-weight: 600;
}

.message-input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-mutedv2);
    pointer-events: none;
    position: absolute;
    left: 0;
    top: 12px;
    font-weight: 600;
}

.chat-header .back-btn {
    margin-right: 8px;
    display: none;
}

.input-action-button {
    background-color: transparent;
    color: var(--header-primary);
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.input-action-button img {
    filter: brightness(0.8);
}

.input-actions {
    display: flex;
    align-content: baseline;
    gap: 10px;
}

.chat-actions {
    display: flex;
    align-items: center;
    margin-right: 10px;
    gap: 4px;
}

.chat-action {
    background: none;
    border: none;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: inline;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-action.select {
    background: var(--background-modifier-hover);
    color: var(--text-normal);
}

.chat-action.video {
    display: inline;
}

.chat-action:not(:disabled):hover {
    background-color: var(--background-modifier-accent);
    color: var(--text-normal);
    transform: translateY(-1px);
}

[data-theme="light"] .chat-action {
    filter: brightness(0.5);
}

[data-theme="light"] .chat-action:not(:disabled):hover {
    filter: brightness(0.3);
}

.chat-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-action img {
    filter: brightness(0.8);
    transition: filter 0.2s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.chat-action:hover img {
    filter: brightness(1);
}

.answer-preview {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
    padding-left: 50px;
    position: relative;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.answer-preview::before {
    content: "";
    position: absolute;
    border-left: 2px solid;
    border-top: 2px solid;
    height: 12px;
    width: 24px;
    border-top-left-radius: 6px;
    border-color: var(--background-accent);
    opacity: 0.6;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 0;
    left: 17px;
    bottom: 2px;
}

.answer-preview:hover::before {
    opacity: 0.9;
}

.answer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--bg-panel);
    background-color: var(--bg-panel);
}

.answer-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.answer-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    gap: 8px;
}

.answer-username {
    font-weight: 600;
    font-size: 12px;
    z-index: 10;
}

.answer-username:hover {
    text-decoration: underline;
}

.answer-content {
    font-size: 13px;
    color: var(--text-mutedv2);
    max-width: 100%;
    flex: 1;
    overflow: hidden;
}

.crop-text {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.forward-preview {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
    padding-left: 50px;
    position: relative;
    cursor: pointer;
    border-left: 3px solid var(--brand-experiment);
    padding: 8px;
    border-radius: 4px;
    background: var(--background-secondary);
    margin-top: 5px;
}

.forward-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}

.forward-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.forward-info {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
}

.forward-username {
    font-weight: 600;
    font-size: 12px;
    color: var(--header-primary);
}

.forward-username:hover {
    text-decoration: underline;
}

.forward-content {
    font-size: 13px;
    color: var(--text-mutedv2);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    flex: 1;
}

.forward-preview:hover .forward-content,
.forward-preview:hover .forward-username {
    color: var(--text-normal);
}

.answer-preview:hover .answer-content,
.answer-preview:hover .answer-username {
    color: var(--text-normal);
}


.reply-bar,
.edit-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background-color: var(--background-lighting);
    color: var(--text-normal);
    padding: 8px 16px;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    animation: slideFromBottom 0.2s ease-out;
    border: 1px solid var(--outline);
}

.attachments-container.startBorderByZero {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.reply-bar:hover,
.edit-bar:hover {
    cursor: pointer;
}

.reply-info,
.edit-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-grow: 1;
}

.reply-label,
.edit-label {
    font-size: 12px;
    color: var(--text-mutedv2);
    font-weight: 500;
}

.reply-username {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 600;
}

.reply-close-btn,
.edit-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

[data-theme="light"] .reply-close-btn,
.edit-close-btn {
    filter: brightness(0.5);
}

.reply-close-btn:hover,
.edit-close-btn:hover {
    background: var(--background-modifier-hover);
    opacity: 1;
}

.reply-bar.hide,
.edit-bar.hide {
    animation: slideToBottom 0.2s ease-out forwards;
}

.call-start-message {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    margin: 4px 0;
    font-size: 14px;
    color: var(--header-primary);
    border-radius: 4px;
    white-space: nowrap;
}

.call-start-username-message {
    font-weight: 500;
    font-size: 14px;
    margin-left: 16px;
    cursor: pointer;
}

.call-start-text-message {
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
    color: var(--text-muted);
    font-weight: 500;
}

.call-start-time-message {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
    margin-left: 5px;
    line-height: 1.375rem;
    font-weight: 500;
}

.call-start-message:hover {
    background-color: rgba(79, 84, 92, 0.16);
}

.call-start-message:hover .call-start-username-message {
    text-decoration: underline;
}

.call-start-message .time {
    color: var(--text-muted);
    font-size: 12px;
}

@keyframes slideFromBottom {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideToBottom {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}



/* ---- PANEL DISPLAY ACTIONS ---- */

/* ---- PROFILE SIDEBAR ---- */
.profile-sidebar {
    width: 350px;
    border-left: 1px solid var(--outline);
    display: none;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 400;
    transform: translateX(100%);
    opacity: 0;
    height: calc(100% - 50px);
    max-height: calc(100vh - 50px);
    margin-top: 50px;
}

body.profile-open .chat-container {
    margin-right: 350px;
    width: calc(100% - 350px);
}

.profile-sidebar.active {
    transform: translateX(0);
    opacity: 1;
}

.profile-header {
    padding: 16px;
    border-bottom: 1px solid var(--background-floating);
    display: flex;
    justify-content: flex-end;
    background: var(--bg-panel);
}

.close-profile-btn {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-muted);
    width: 50px;
    height: 50px;
}

[data-theme="light"] .close-profile-btn img {
    filter: brightness(0.5);
}

.profile-content {
    flex: 1;
    overflow-y: auto;
    background: var(--background-primary);
}

.profile-banner {
    overflow: hidden;
    max-height: 150px;
    min-height: 150px;
    display: flex;
    justify-content: center;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-section {
    padding: 0 20px;
    margin-top: -50px;
}

.profile-avatar-container {
    position: relative;
    width: 90px;
    height: 90px;
    outline: 5px solid var(--background-primary);
    outline-offset: -1px;
    border-radius: 50%;
}

.profile-avatar-container .status-indicator {
    position: absolute;
    bottom: 2px;
    margin-right: -6px;
    right: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 6px solid var(--background-primary);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50px;
}

.profile-info {
    margin: 20px 10px 10px 10px;
}

.profile-username {
    margin: 0px 0px 16px 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-normal);
    letter-spacing: -0.5px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.about-section {
    border-radius: 8px;
    padding: 10px;
    background: var(--background-primary-hover);
}

.about-title {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--header-primary);
}

.about-title.active {
    display: block;
}

.about-text {
    margin: 0;
    line-height: 1.6;
    color: var(--text-mutedv3);
    white-space: pre-wrap;
    font-size: 14px;
    word-wrap: break-word;
}

.back-btn {
    background: none;
    border: none;
    border-radius: 4px;
    padding: 4px;
    margin-right: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: none;
}

.attached-btn {
    background-color: transparent;
    border: none;
    margin-right: 8px;
    border-radius: 8px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.attached-btn:hover {
    background-color: var(--background-modifier-hover);
}

.attached-btn:hover img {
    filter: brightness(0.8);
}

.attached-btn img {
    filter: brightness(0.6);
}

.attachments-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 16px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--background-accent) transparent;
    -webkit-overflow-scrolling: touch;
    display: none;
    background: var(--background-lighting);
    border-radius: 8px;
    border-end-end-radius: 0px;
    border-end-start-radius: 0px;
    border: 1px solid var(--outline);
}

.file-container {
    position: relative;
    background: var(--background-lighting);
    border-radius: 8px;
    overflow: hidden;
    width: 200px;
    max-width: 200px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    border: 1px solid var(--background-modifier-accent);
    box-shadow: var(--shadow-low);
}

.media-container {
    position: relative;
    cursor: pointer;
}

.media-preview {
    width: 100%;
    min-width: 200px;
    min-height: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 4px 4px 0 0;
}


.filename-container {
    padding: 8px;
    background: var(--background-lighting);
    border-top: 1px solid var(--outline);
}

.filename {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-bar-container {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 10;
}

.action-bar {
    display: flex;
    gap: 4px;
    background-color: var(--light-card);
    border-radius: 4px;
    padding: 4px;
    box-shadow: var(--shadow-low);
}

.file-container:hover .action-bar-container {
    pointer-events: all;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-normal);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: var(--background-modifier-hover);
    color: var(--text-normal);
}

.action-button.dangerous:hover {
    background: var(--status-danger);
    color: var(--header-primary);
}


.action-icon {
    width: 16px;
    height: 16px;
}

.grid-image .gif {
    object-fit: contain;
}

.grid-image .cover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.grid-image .cover-video:hover .play-button {
    opacity: 0.8;
    transform: scale(1.1);
}

.grid-image .play-button {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.play-button .icon-video-controls,
.play-pause-btn .icon-video-controls {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.fullscreen-btn .icon-video-controls {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.volume-btn .icon-video-controls {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.grid-image .video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 8px 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    gap: 8px;
    z-index: 4;
}

.video-controls.pause {
    display: flex;
}

.video-controls.drag {
    display: flex;
}

.grid-image:hover .video-controls.active {
    display: flex;
}

.grid-image .controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--header-primary);
    font-family: var(--font-code);
    font-size: 12px;
}

.grid-image .play-pause-btn {
    background: none;
    border: none;
    color: var(--header-primary);
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    padding: 3px;
    transition: transform 0.2s ease;
    transform: scale(1);
}

.grid-image .play-pause-btn:hover {
    transform: scale(1.1);
    background: var(--background-modifier-hover);
}

.grid-image .progress-bar {
    flex: 1;
    margin: 0 20px;
    height: 4px;
    background: var(--img-muted);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.grid-image .progress-bar::before {
    content: '';
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 0;
    right: 0;
}

.grid-image .progress-line {
    position: absolute;
    height: 100%;
    background: var(--brand);
    border-radius: 2px;
    width: 0%;
    will-change: width;
    transition: width 0.1s linear;
}

.grid-image .progress-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--header-primary);
    border-radius: 50%;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    will-change: left, transform;
    transition: left 0.1s linear;
}

.grid-image .progress-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.grid-image .controls-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.grid-image .volume-mixer {
    display: flex;
    align-items: center;
    position: relative;
}

.grid-image .volume-btn {
    background: none;
    border: none;
    color: var(--header-primary);
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
    border-radius: 5px;
    transform: scale(1);
}

.grid-image .volume-btn:hover {
    transform: scale(1.1);
    background: var(--background-modifier-hover);
}

.grid-image .volume-slider {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 80px;
    background: var(--img-muted);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.grid-image .volume-slider::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -8px;
    right: -8px;
    height: 10px;
}

.grid-image .volume-slider::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -8px;
    right: -8px;
}

.grid-image .volume-slider.drag {
    opacity: 1;
    visibility: visible;
}

.grid-image .volume-mixer:hover .volume-slider {
    opacity: 1;
    visibility: visible;
}

.grid-image .volume-level {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--brand);
    border-radius: 2px;
    height: 70%;
    transition: height 0.1s ease;
}

.grid-image .fullscreen-btn {
    background: none;
    border: none;
    color: var(--header-primary);
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
    border-radius: 5px;
    transform: scale(1);
}

.grid-image .fullscreen-btn:hover {
    transform: scale(1.1);
    background: var(--background-modifier-hover);
}

.file-progress-ring {
    position: absolute;
    top: 50%;
    left: 32px;
    transform: translate(-50%, -50%) rotate(-90deg);
    width: 36px;
    height: 32px;
    pointer-events: none;
}

.file-progress-ring circle {
    fill: none;
    stroke-width: 3;
    r: 14;
    cx: 16;
    cy: 16;
}

.file-progress-ring .bg {
    stroke: rgba(0, 0, 0, 0.1);
}

.file-progress-ring .progress {
    stroke: var(--accent, #0096ff);
    stroke-dasharray: 88;
    stroke-dashoffset: 88;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

.images-grid.video .grid-image {
    aspect-ratio: 1;
}

.images-grid.single.video .grid-image {
    aspect-ratio: auto;
}

.images-grid.single.video .grid-image video {
    max-height: 400px;
    min-width: 200px;
    min-height: 200px;
    object-fit: contain;
}

.images-grid.video .grid-image:hover .cover-video {
    background: rgba(0, 0, 0, 0.4);
}

.grid-image:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

.grid-image:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

.grid-image:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

.title-gif-grid-image {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    margin: 5px;
    min-width: 30px;
    display: flex;
    justify-content: center;
    font-family: var(--font-code);
    font-size: 12px;
    z-index: 10;
}

.grid-image:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

.grid-image:-webkit-full-screen video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: var(--video-aspect-ratio, 16/9) !important;
}

.grid-image:-moz-full-screen video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: var(--video-aspect-ratio, 16/9) !important;
}

.grid-image:-ms-fullscreen video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: var(--video-aspect-ratio, 16/9) !important;
}

.grid-image:fullscreen video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: var(--video-aspect-ratio, 16/9) !important;
}

@supports not (aspect-ratio: 1) {
    .grid-image:fullscreen video {
        max-width: 100vw !important;
        max-height: 100vh !important;
        width: auto !important;
        height: auto !important;
    }
}

.images-grid {
    display: grid;
    grid-gap: 4px;
    max-width: 400px;
    border-radius: 4px;
    margin-top: 4px;
    overflow: hidden;
    justify-content: start;
}

.grid-image.video {
    position: relative;
    background: var(--background-tertiary);
}

.grid-image.video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.images-grid img:not(.deleted-media-icon):not(.icon-video-controls),
.images-grid .grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.images-grid.single .grid-image img {
    border-radius: 4px;
}

.images-grid.single img {
    height: auto;
    max-height: 400px;
}

.images-grid.sticker {
    overflow: visible;
    max-width: 200px;
    object-fit: contain;
}

.images-grid.sticker img {
    height: auto;
    max-height: 200px;
    max-width: 200px;
}

.grid-image.gif img {
    max-height: 250px;
    max-width: 250px;
}

.grid-image {
    min-width: 100px;
    min-height: 100px;
}


.images-grid.sticker img:hover {
    transform: scale(1);
}

.images-grid.double {
    grid-template-columns: 1fr 1fr;
}

.images-grid.double img {
    aspect-ratio: 1;
}

.images-grid.triple {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: auto;
}

.images-grid.triple>.grid-image:nth-child(1) {
    grid-row: 1 / 3;
    aspect-ratio: 1 / 2;
}

.images-grid.triple>.grid-image:nth-child(2) {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    aspect-ratio: 1 / 1;
}

.images-grid.triple>.grid-image:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    aspect-ratio: 1 / 1;
}

.images-grid.quad {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.images-grid.quad>.grid-image {
    aspect-ratio: 1;
}

.images-grid.multiple {
    grid-template-columns: repeat(3, 1fr);
}

.images-grid.multiple>.grid-image {
    aspect-ratio: 1;
}

.images-grid.count-5 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-areas: "a a a b b b" "c c d d e e";
}

.images-grid.count-5>.grid-image:nth-child(1) {
    grid-area: a;
    aspect-ratio: 3/2;
}

.images-grid.count-5>.grid-image:nth-child(2) {
    grid-area: b;
    aspect-ratio: 3/2;
}

.images-grid.count-5>.grid-image:nth-child(3) {
    grid-area: c;
}

.images-grid.count-5>.grid-image:nth-child(4) {
    grid-area: d;
}

.images-grid.count-5>.grid-image:nth-child(5) {
    grid-area: e;
}


.images-grid.count-7 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-areas: "a a a b b b" "c c c d d d" "e e f f g g";
}

.images-grid.count-7>.grid-image:nth-child(1) {
    grid-area: a;
    aspect-ratio: 3/2;
}

.images-grid.count-7>.grid-image:nth-child(2) {
    grid-area: b;
    aspect-ratio: 3/2;
}

.images-grid.count-7>.grid-image:nth-child(3) {
    grid-area: c;
    aspect-ratio: 3/2;
}

.images-grid.count-7>.grid-image:nth-child(4) {
    grid-area: d;
    aspect-ratio: 3/2;
}

.images-grid.count-7>.grid-image:nth-child(5) {
    grid-area: e;
}

.images-grid.count-7>.grid-image:nth-child(6) {
    grid-area: f;
}

.images-grid.count-7>.grid-image:nth-child(7) {
    grid-area: g;
}


.images-grid.count-8 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-areas: "a a a b b b" "c c d d e e" "f f g g h h";
}

.images-grid.count-8>.grid-image:nth-child(1) {
    grid-area: a;
    aspect-ratio: 3/2;
}

.images-grid.count-8>.grid-image:nth-child(2) {
    grid-area: b;
    aspect-ratio: 3/2;
}

.images-grid.count-8>.grid-image:nth-child(3) {
    grid-area: c;
}

.images-grid.count-8>.grid-image:nth-child(4) {
    grid-area: d;
}

.images-grid.count-8>.grid-image:nth-child(5) {
    grid-area: e;
}

.images-grid.count-8>.grid-image:nth-child(6) {
    grid-area: f;
}

.images-grid.count-8>.grid-image:nth-child(7) {
    grid-area: g;
}

.images-grid.count-8>.grid-image:nth-child(8) {
    grid-area: h;
}

.images-grid.count-10 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-areas: "a a a b b b" "c c c d d d" "e e f f g g" "h h i i j j";
}

.images-grid.count-10>.grid-image:nth-child(1) {
    grid-area: a;
    aspect-ratio: 3/2;
}

.images-grid.count-10>.grid-image:nth-child(2) {
    grid-area: b;
    aspect-ratio: 3/2;
}

.images-grid.count-10>.grid-image:nth-child(3) {
    grid-area: c;
    aspect-ratio: 3/2;
}

.images-grid.count-10>.grid-image:nth-child(4) {
    grid-area: d;
    aspect-ratio: 3/2;
}

.images-grid.count-10>.grid-image:nth-child(5) {
    grid-area: e;
}

.images-grid.count-10>.grid-image:nth-child(6) {
    grid-area: f;
}

.images-grid.count-10>.grid-image:nth-child(7) {
    grid-area: g;
}

.images-grid.count-10>.grid-image:nth-child(8) {
    grid-area: h;
}

.images-grid.count-10>.grid-image:nth-child(9) {
    grid-area: i;
}

.images-grid.count-10>.grid-image:nth-child(10) {
    grid-area: j;
}

.images-grid img:not(.deleted-media-icon):not(.icon-video-controls) {
    transition: transform 0.2s ease;
}

.images-grid img:not(.deleted-media-icon):not(.icon-video-controls):hover {
    transform: scale(1.02);
    z-index: 1;
}

.files-container {
    max-width: 400px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-link {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 8px 12px;
    background-color: var(--background-primary);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-normal);
    font-size: 14px;
    transition: background-color 0.2s ease;
    box-shadow: var(--shadow-low);
    gap: 12px;
    min-width: 90%;
}

.file-link:hover {
    background-color: var(--background-primary-hover);
}

.file-link img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.file-link-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-link-text {
    font-weight: 500;
    margin-bottom: 2px;
}

.file-link-desc {
    font-size: 12px;
    color: var(--text-mutedv2);
    opacity: 0.8;
}

.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(1px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drop-overlay.active {
    display: flex;
    opacity: 1;
}

.drop-content {
    background: var(--background-secondary);
    border: 3px dashed var(--brand);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: var(--text-normal);
}

.drop-icon {
    margin-bottom: 16px;
}

.drop-icon img {
    width: 150px;
    height: 150px;
}


.drop-text {
    font-size: 18px;
    font-weight: 600;
}

.message-actions {
    position: absolute;
    top: -8px;
    right: 16px;
    background: var(--background-lighting);
    border-radius: 4px;
    padding: 4px;
    display: none;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: var(--shadow-low);
    z-index: 10;
}

.message:hover .message-actions {
    opacity: 1;
    display: flex;
    border: 0.1px solid var(--background-modifier-accent);
}

.message-action {
    width: 25px;
    height: 25px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 14px;
    padding: 5px;
    transform: scale(1);
}

[data-theme="light"] .message-action img {
    filter: brightness(0.5);
}

.message-action:hover {
    transform: scale(1.1);
    background-color: var(--background-secondary);
    color: var(--text-normal);
}

[data-theme="light"] .message-action:hover {
    background: var(--background-modifier-hover);
}

.message-action.delete-btn:hover {
    transform: scale(1.1);
    background-color: var(--status-danger);
    color: var(--text-normal);
}

[data-theme="light"] .message-action.delete-btn:hover img {
    filter: brightness(0.8);
}

.delete-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(30, 31, 34, 0.8);
    backdrop-filter: blur(2px);
    z-index: 5;
    gap: 8px;
    border-radius: inherit;
}

.delete-indicator.full-content {
    background: transparent;
    backdrop-filter: none;
}

.delete-indicator-icon {
    width: 20px !important;
    height: 20px !important;
    filter: brightness(0.8) !important;
}

.delete-indicator .message-loading {
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container-members-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 12px;
    min-width: 300px;
    height: 100%;
    overflow: hidden;
    background: var(--background-primary);
}

.members-group-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    height: 100%;
}

.content-members-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.amount-member-group {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 12px;
}

.amount-member-group-text {
    font-weight: 500;
    color: var(--text-muted);
}

.content-info-members {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--background-accent) transparent;
}

.content-info-members::-webkit-scrollbar {
    width: 8px;
}

.content-info-members::-webkit-scrollbar-thumb {
    background: var(--background-accent);
    border-radius: 4px;
}

.content-info-members::-webkit-scrollbar-thumb:hover {
    background: var(--background-accent);
}

.role-members {
    gap: 2px;
    display: flex;
    align-items: center;
    margin-top: 2px;
    font-size: 12px;
    margin-right: 5px;
    justify-content: center;
    background: var(--background-accent);
    padding: 1px;
    padding-left: 4px;
    border-radius: 5px;
    padding-right: 4px;
}

.role-members img {
    filter: brightness(0.5);
}

.item-member-group:hover .role-members img {
    filter: brightness(1);
}

.item-member-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.1s ease;
    color: var(--text-muted);
}

.item-member-group span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.item-member-group:hover {
    background: var(--background-modifier-hover);
    cursor: pointer;
    color: var(--text-primary);
}

.item-member-group .status-indicator {
    border-color: var(--background-primary);
}

.item-member-group:hover .status-indicator {
    border: 3px solid var(--background-lighting);
}

.item-member-group img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .chat-action-search-container {
        display: none;
    }

    .call-start-message {
        flex-wrap: wrap;
        padding: 6px 8px;
        white-space: normal;
    }

    .call-start-username-message {
        margin-left: 8px;
        font-size: 13px;
    }

    .call-start-text-message,
    .call-start-time-message {
        font-size: 13px;
    }

    .call-start-time-message {
        margin-left: auto;
    }

    .images-grid.sticker img {
        max-height: 150px;
        max-width: 150px;
    }

    .input-actions {
        gap: 2px;
    }

    .input-action-button {
        width: 40px;
        height: 40px;
    }

    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    .info-header-chat.hover {
        background-color: var(--background-modifier-hover);
        transform: scale(1.01);
    }

    .info-header-chat:active {
        background-color: var(--background-secondary);
        transform: scale(0.99);
    }

    .amount-member-group {
        display: flex;
        justify-content: center;
        padding: 12px;
    }

    .files-container {
        max-width: 300px;
    }

    .play-pause-btn {
        display: none;
    }

    .volume-btn {
        display: none;
    }

    .images-grid {
        gap: 3px;
        max-width: 300px;
    }

    .back-btn {
        display: flex;
        width: 35px;
        height: 35px;
    }

    .profile-sidebar {
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.28s ease, opacity 0.28s ease;
        z-index: 1000;
        margin-top: 0px;
    }

    .chat-container {
        margin-right: 0 !important;
        width: 100% !important;
        transition: width 0.3s ease, margin-right 0.3s ease;
    }

    .profile-sidebar.active {
        transform: translateX(0);
        opacity: 1;
        min-height: 100vh;
        margin-top: 0px !important;

    }

    .profile-header {
        justify-content: flex-start;
    }

    .chat-header .back-btn {
        display: inline-flex;
    }

    .chat-header .avatarConversion {
        margin-left: 6px;
    }

    .chat-container {
        height: 100vh;
    }

    .message {
        padding: 6px;
    }

    .avatar {
        margin-right: 8px;
    }

    .message-content {
        font-size: 14px;
    }

    .message-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .username {
        font-size: 14px;
    }

    .timestamp {
        font-size: 11px;
    }

    .input-container {
        padding: 0 12px;
    }

    .message-input {
        font-size: 14px;
    }

    .send-button {
        min-width: 40px;
        min-height: 40px;
    }

    .attached-btn {
        min-width: 40px;
        min-height: 40px;
    }

    .message:hover {
        background-color: transparent;
    }

    .chat-action {
        width: 35px;
        height: 35px;
    }

    .chat-action.select {
        background: none;
        color: var(--text-muted);
    }

    .chat-action.video {
        display: none;
    }

    .chat-action.profile {
        display: none;
    }

    .chat-action:hover {
        background-color: transparent;
    }
}

@media (max-width: 420) {
    .file-link {
        min-width: 300px;
    }
}

@media (min-width: 769px) {
    .close-profile-btn {
        display: none;
    }

    .profile-sidebar {
        transform: translateX(0);
    }

    .chat-container {
        margin-right: 350px;
        width: calc(100% - 350px);
    }

    .profile-sidebar:not(.active) {
        transform: translateX(100%);
    }

    body:not(.profile-open) .chat-container {
        margin-right: 0;
        width: 100%;
    }
}

.reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    margin-left: 40px;
}

.info-header-chat.is-group:hover {
    background-color: var(--background-modifier-accent);
    cursor: pointer;
}

#edit-group-icon {
    display: none;
    margin-left: 10px;
}

.info-header-chat.is-group:hover #edit-group-icon {
    display: inline;
}

.reaction {
    display: flex;
    align-items: center;
    background-color: var(--background-secondary);
    border-radius: 10px;
    padding: 4px 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.reaction.my-reaction {
    background-color: var(--background-tertiary);
    border-color: var(--brand-experiment);
}

.reaction:hover {
    background-color: var(--background-tertiary);
}

.emoji-wrapper-reaction {
    width: 25px;
    height: 25px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.emoji-wrapper-reaction img {
    position: absolute;
    top: 5%;
    left: 10%;
}

.reaction-count {
    margin-left: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--header-secondary);
}

.message-content a:not(.file-link) {
    color: var(--accent);
    text-decoration: none;
}

.message-content a:not(.file-link):hover {
    text-decoration: underline;
}

.more-reactions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-secondary);
    border-radius: 10px;
    padding: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
}

.more-reactions-btn:hover {
    background-color: var(--background-tertiary);
}

.more-reactions-btn img {
    width: 20px;
    height: 20px;
}

.link-preview {
    display: flex;
    flex-direction: row;
    background-color: var(--background-secondary-alt);
    border-radius: 8px;
    margin-top: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid var(--brand);
    max-width: 450px;
}

.link-preview-image {
    width: 200px;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
}

.link-preview-content {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.link-preview-site-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--header-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-description {
    font-size: 13px;
    color: var(--text-normal);
    max-height: 100px;
    overflow: auto;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.grid-image.spoiler,
.file-container.spoiler-active .media-container {
    position: relative;
}

.grid-image.spoiler>.grid-image,
.grid-image.spoiler>img,
.grid-image.spoiler>video,
.file-container.spoiler-active .media-preview {
    filter: blur(15px);
    transition: filter 0.3s ease;
}

.spoiler-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: inherit;
    z-index: 2;
    cursor: pointer;
}

.grid-image.spoiler .spoiler-overlay,
.file-container.spoiler-active .spoiler-overlay {
    display: flex;
}

.message.deleting {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.message.deleting::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--background-modifier-accent);
    opacity: 0.3;
    z-index: 1;
    border-radius: 4px;
}

.message.deleting .message-content,
.message.deleting .message-header {
    filter: blur(1px);
}

.delete-indicator-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--status-danger);
    border-radius: 50%;
    width: 72px;
    height: 72px;
    padding: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.delete-indicator-content .delete-indicator-icon {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.delete-indicator-content .loading-dot {
    background-color: rgba(255, 255, 255, 0.7);
}

.images-grid {
    position: relative;
}

.upload-progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 10;
}

.upload-progress-ring circle {
    fill: none;
    stroke-width: 3;
}

.upload-progress-ring .bg {
    stroke: rgba(0, 0, 0, 0.3);
}

.upload-progress-ring .progress {
    stroke: white;
    stroke-dasharray: 100 100;
    stroke-dashoffset: 100;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

.grid-image {
    position: relative;
}

.delete-indicator.small .delete-indicator-content {
    width: 48px;
    height: 48px;
    gap: 4px;
}

.delete-indicator.small .delete-indicator-icon {
    width: 20px;
    height: 20px;
}

.delete-indicator.small .loading-dot {
    width: 3px;
    height: 3px;
}

@keyframes indeterminate-progress {
    from {
        transform: translate(-50%, -50%) rotate(-90deg) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(-90deg) rotate(360deg);
    }
}

.upload-progress-ring.indeterminate {
    animation: indeterminate-progress 1.5s linear infinite;
}

@keyframes fadeAndShrink {
    from {
        opacity: 1;
        max-height: 1000px;
    }

    to {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
        border-width: 0;
    }
}

.message.deleting-animation {
    animation: fadeAndShrink 0.3s ease-in-out forwards;
    overflow: hidden;
}

.deleted-media-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    background-color: var(--background-secondary);
    border: 1px solid var(--background-tertiary);
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100px;
    width: 100%;
    height: 100%;
}

.deleted-media-icon {
    width: 14px;
    height: 14px;
    filter: brightness(0.8);
}

.deleted-media-label {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Group Profile Avatar & Name */
.group-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 12px;
    gap: 10px;
}

.group-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.group-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.group-profile-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    padding: 0 12px;
}