* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #3390ec;
    --primary-color-gold: #FFE791;
    --primary-color-gold-dark: #B59B3D;
    --primary-color-rgb: 51, 144, 236;
    --secondary-color: #707579;
    --surface-color: #ffffff;
    --background-color: #f5f5f5;
    --chat-bg-color: #f2f3f5;
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #000000;
    --text-secondary: #707579;
    --light-primary: rgba(51, 144, 236, 0.08);
    --light-secondary: rgba(112, 117, 121, 0.08);
    --danger-color: #df3f40;
    --success-color: #70b768;
    --ios-safe-area-inset-top: env(safe-area-inset-top, 0px);
    --ios-safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --tab-bar-height: 60px;
    --message-input-height: 56px;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    background: #000;
    color: var(--text-primary);
}

/*html {opacity: 0}*/

body {
    display: flex;
    flex-direction: column;
    background: var(--background-color);
}

/* iOS Dynamic Island */
.dynamic-island {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 35px;
    background: #000;
    border-radius: 20px;
    z-index: 9999;
    pointer-events: none;
}

/* Main App Container */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    overflow: hidden;
    padding-top: var(--ios-safe-area-inset-top);
    background: var(--surface-color);
}

/* View Container */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-list-view.active {
    transform: translateX(0);
}

.chat-list-view.hidden {
    transform: translateX(-100%);
}

.chat-view {
    transform: translateX(100%);
}

.chat-view.active {
    transform: translateX(0);
}

/* Chat List View */
.header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-menu-applockpin {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 8px;
    cursor: pointer;
}

.btn-menu {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 8px;
    cursor: pointer;
}
.btn-menu-refresh {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 8px;
    cursor: pointer;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-icon span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    margin: 0 16px;
}

.btn-edit {
    background: var(--light-secondary);
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-edit:hover {
    background: var(--border-color);
}

/* Search */
.search-container {
    padding: 12px 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--light-secondary);
    border-radius: 10px;
    padding: 8px 12px;
    gap: 8px;
}

.search-box i {
    color: var(--secondary-color);
    font-size: 14px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--secondary-color);
}

.btn-search-clear {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: none;
}

.btn-search-clear:hover {
    opacity: 1;
}

.search-input:not(:placeholder-shown) + .btn-search-clear {
    display: block;
}

/* lifestyle */
.lifestyle-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.lifestyle-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.lifestyle-list::-webkit-scrollbar {
    display: none;
}

/* Stories */
.stories-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.stories-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.stories-list::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    cursor: pointer;
}

.story-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #34C76F, #3DA1FD);
    padding: 2px;
}

.story-avatar.new-story {
    background: var(--light-secondary);
    border: 2px dashed var(--secondary-color);
}

.story-avatar.active {
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
}

.story-avatar .avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

.story-avatar.new-story i {
    color: var(--secondary-color);
    font-size: 20px;
}

.story-name {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.load-more-indicator {
    transition: all 0.3s ease;
}

.load-more-indicator:hover {
    background: var(--light-primary);
    transform: translateY(-2px);
}

/* Chat List */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: var(--tab-bar-height);
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 0;
}

.chat-item.active {
    background: var(--light-secondary);
}

.chat-item.muted .chat-title,
.chat-item.muted .last-message {
    opacity: 0.6;
}

.chat-avatar {
    position: relative;
    margin-right: 12px;
    flex-shrink: 0;
}

.avatar-initials {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
}
.avatar-initials-gc {
    width: 54px;
    height: 54px;
    border-radius: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
}

.avatar-initials.saved {
    background: var(--light-primary);
    color: var(--primary-color);
    font-size: 24px;
}

.bg-gradient-1 {
    background: linear-gradient(87deg, #b59b3d, #ffffff);
}

.bg-gradient-2 {
    background: linear-gradient(45deg, #3390ec, #B59B3D);
}

.bg-gradient-3 {
    background: linear-gradient(45deg, #70b768, #4caf50);
}

.bg-gradient-4 {
    background: linear-gradient(45deg, #976fff, #e46ace);
}

.online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--success-color);
    border: 2px solid var(--surface-color);
}

.online-dot-contact {
    position: absolute;
    bottom: 9px;
    left: 52px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--success-color);
    border: 2px solid var(--surface-color);
}
.check-user-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    filter: hue-rotate(63deg);
}


.check-user-dot-contact {
    position: absolute;
    top: 14px;
    left: 15px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    filter: hue-rotate(63deg);
    z-index: 1;
}
.check-user-dot-chat {
    position: absolute;
    top: 8px;
    left: 53px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    filter: hue-rotate(63deg);
}

.group-icon {
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 50%;
    background: #e3e3e3;
    width: 24px;
    height: 24px;
    align-content: center;
    text-align: center;
    font-size: 12px;
    border: 1px solid #00000026;
}
.pinned-icon {
    position: absolute;
    top: -12px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--primary-color);
    border: 2px solid var(--surface-color);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emoji {
    font-size: 16px;
    vertical-align: text-top;
}

.chat-time {
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chat-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.last-message {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.last-message i {
    font-size: 12px;
    margin-right: 4px;
    opacity: 0.6;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.chat-status i {
    font-size: 12px;
    color: var(--secondary-color);
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 600;
}

/* Bottom Tabs */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-bar-height) + var(--ios-safe-area-inset-bottom));
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--ios-safe-area-inset-bottom);
    z-index: 100;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 8px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    height: 100%;
}

.tab-btn.active {
    color: var(--primary-color-gold-dark);
}

.tab-btn i {
    font-size: 22px;
    margin-bottom: 4px;
}

.tab-btn span {
    font-size: 11px;
    font-weight: 500;
}

/* Floating Button */
.fab {
    position: fixed;
    bottom: calc(var(--tab-bar-height) + 20px + var(--ios-safe-area-inset-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(51, 144, 236, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 101;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(51, 144, 236, 0.4);
}

/* Chat View */
.chat-header {
    height: 30px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 10px;
    padding: 0px 3px;
    background-color: white;
}

.btn-back {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.chat-header-info {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.chat-header-avatar {
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-header-text {
    flex: 1;
    min-width: 0;
}

.red{
    color: white;
    padding: 3px;
    background: red;
    border-radius: 3px;
}
.chat-header .chat-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-status-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-header-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--border-color);
}

/* Стили для блока ответа */
.reply-preview-container {
    border-left: 3px solid var(--primary-color);
    animation: slideDown 0.3s ease;

}

.reply-preview-container .reply-media-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forwarded-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.forwarded-indicator i {
    font-size: 10px;
}

.message.sent .forwarded-indicator {
    color: rgb(83 83 83 / 70%);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
    background: var(--chat-bg-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: calc(var(--message-input-height) + 20px);
}

.edited-indicator {
    font-size: 11px;
    color: var(--text-secondary);
    margin-right: 4px;
    font-style: italic;
}

.message.sent .edited-indicator {
    color: rgba(255, 255, 255, 0.7);
}


.message {
    display: flex;
    max-width: 85%;
    animation: messageAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
}

.message-avatar {
    margin-right: 8px;
    flex-shrink: 0;
    align-self: flex-end;
}

.message-avatar .avatar-initials {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.avatar-initials-view {
    width: 45px;
    height: 45px;
    font-size: 14px;
}

.message-content {
    position: relative;
    min-width: 114px;
}

.message.received .message-content {
    background: var(--surface-color);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
}

.message.sent .message-content {
    background: #fde08d;
    color: black;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    padding: 12px 16px;

}
.message.sent .message-content-media {
    background: unset;
    color: white;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    padding: 0;
    position: relative;
    min-width: 60px;
}

.message.received .message-content-media {
    background: unset;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 0;
    position: relative;
    min-width: 60px;
    color: rgba(255, 255, 255, 0.8);
}
.message.received .message-content-media .message-time {
    color: black;
    text-shadow: 1px 1px 1px #fffffffa;
}

.message-text {
    font-size: 14px;
    line-height: 1.1;
    word-break: break-word;
}

.message-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.8;
    text-shadow: 1px 1px 1px #fffffffa;
    height: 20px;
}


.message-time {
    opacity: 0.8;
    text-shadow: 1px 1px 1px black;
}

.message-status {
    font-size: 12px;
}

.message-status .read {
    color: #70b768;
}

/* Message Input */
.message-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--message-input-height) + var(--ios-safe-area-inset-bottom));
    /*background: var(--surface-color);*/
    /*border-top: 1px solid var(--border-color);*/
    padding: 0px 7px;
    padding-bottom: var(--ios-safe-area-inset-bottom);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.btn-attach0 {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.btn-attach {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-input-wrapper {
    flex: 1;
    position: relative;
    background: var(--light-secondary);
    border-radius: 20px;
    padding: 3px 0px 0px 0px;
}

/*.message-input {*/
/*    width: 100%;*/
/*    padding: 10px 44px 10px 16px;*/
/*    border: none;*/
/*    background: transparent;*/
/*    font-size: 16px;*/
/*    font-family: inherit;*/
/*    color: var(--text-primary);*/
/*    outline: none;*/
/*    line-height: 1.4;*/
/*}*/

.message-input {
    /* Начальные размеры как у input */
    width: 100%;
    min-height: 40px; /* или ваша стандартная высота input */
    max-height: 120px; /* примерно 3 строки */
    padding: 10px 32px 10px 12px; /* как у input */
    /*border: 1px solid #e0e0e0;*/
    border-radius: 20px;
    border:unset;
    background: #f5f5f5;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    color: #333;
    resize: none; /* запрещаем ручное изменение размера */
    overflow-y: auto; /* скролл только когда нужно */
    scrollbar-width: none; /* Firefox - скрыть скролл */
    -ms-overflow-style: none; /* IE/Edge - скрыть скролл */
}

/* Скрываем скролл для Chrome/Safari/Opera */
.message-input::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
}

/* Стили для фокуса */
.message-input:focus {
    outline: none;
    border-color: #3390ec;
    background: #fff;
}

/* Плейсхолдер */
.message-input::placeholder {
    color: #999;
}

.btn-emoji0 {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-emoji{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
}

.btn-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #2980e8;
}

/* Notification */
.notification {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 14px;
    padding: 12px 16px;
    max-width: 300px;
    transform: translateX(150%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100000;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    color: var(--primary-color);
    font-size: 20px;
}

.notification-text strong {
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
}

.notification-text p {
    font-size: 13px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-list-view.active {
        transform: translateX(0);
    }

    .chat-view.active {
        transform: translateX(0);
    }

    .chat-list-view.hidden {
        transform: translateX(-100%);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Profile View */
.profile-view {
    transform: translateX(100%);
    background: var(--surface-color);
}

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

.profile-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.profile-header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    margin: 0 16px;
}

.profile-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
    padding-bottom: unset;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar .avatar-initials {
    font-size: 40px;
    font-weight: 600;
    width: 100%;
    height: 100%;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.profile-status {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
}

.profile-info {
    padding: 24px 16px;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    gap: 16px;
}

.info-item i {
    width: 40px;
    height: 40px;
    background: var(--light-secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
}

.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.info-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.profile-actions {
    padding: 24px 0px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: var(--light-primary);
    border: none;
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    gap: 8px;
}

.action-btn i {
    font-size: 24px;
}

.action-btn span {
    text-align: center;
    line-height: 1.3;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Stories View */
.stories-view {
    transform: translateX(100%);
    background: var(--surface-color);
}

.stories-view.active {
    transform: translateX(0);
}

.stories-view-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.stories-view-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    margin: 0 16px;
}

.stories-view-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.stories-view-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--light-secondary);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.stories-view-item:hover {
    background: var(--border-color);
}

.stories-view-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.stories-view-avatar.new-story {
    background: var(--light-secondary);
    border: 2px dashed var(--secondary-color);
    color: var(--secondary-color);
    font-size: 24px;
}

.stories-view-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stories-view-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* lifestyle */
.lifestyle-view {
    transform: translateX(100%);
    background: var(--surface-color);
}

.lifestyle-view.active {
    transform: translateX(0);
}

.lifestyle-view-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.lifestyle-view-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    margin: 0 16px;
}

.lifestyle-view-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.lifestyle-view-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--light-secondary);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.lifestyle-view-item:hover {
    background: var(--border-color);
}

.lifestyle-view-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.lifestyle-view-avatar.new-story {
    background: var(--light-secondary);
    border: 2px dashed var(--secondary-color);
    color: var(--secondary-color);
    font-size: 24px;
}

.lifestyle-view-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.lifestyle-view-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Базовый стиль для изображения */
.lifestyle-image {
    transition: all 0.3s ease;
    display: block;
    max-width: 100%;
}

/* Активный класс - меняем цвет через фильтры */
.lifestyle-image.lifestyleActive {
    /* Способ 1: через hue-rotate (меняет оттенок) */
    filter: hue-rotate(180deg) brightness(1.2) saturate(1.5);

    /* Способ 2: через sepia и hue-rotate (дает больше контроля) */
    /* filter: sepia(1) hue-rotate(190deg) saturate(3); */

    /* Способ 3: для конкретного цвета (например, золотой) */
    /* filter: sepia(0.8) saturate(5) hue-rotate(10deg); */

    /* Анимация при активации */
    transition: filter 0.5s ease;
}

/* Альтернативный подход через смешивание с фоном */
.lifestyle-container {
    position: relative;
    display: inline-block;
}

.lifestyle-container .lifestyle-image {
    display: block;
    mix-blend-mode: multiply; /* или color-dodge, overlay */
    transition: all 0.3s;
}

.lifestyle-container.lifestyleActive .lifestyle-image {
    mix-blend-mode: screen;
    filter: brightness(1.3);
}

.lifestyle-image {
    display: block;
    max-width: 100%;
    filter: brightness(0);
}

.lifestyle-image.lifestyleActive {
    animation: colorShift 3s infinite linear;
    filter: brightness(1);
}

@keyframes colorShift {
    0% {
        filter: hue-rotate(0deg) brightness(1.2) saturate(1.5);
    }
    25% {
        filter: hue-rotate(90deg) brightness(1.2) saturate(1.5);
    }
    50% {
        filter: hue-rotate(180deg) brightness(1.2) saturate(1.5);
    }
    75% {
        filter: hue-rotate(270deg) brightness(1.2) saturate(1.5);
    }
    100% {
        filter: hue-rotate(360deg) brightness(1.2) saturate(1.5);
    }
}

/* Contacts View */
.contacts-view {
    transform: translateX(100%);
    background: var(--surface-color);
}

.contacts-view.active {
    transform: translateX(0);
}

.contacts-view-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.contacts-view-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    margin: 0 16px;
}

.contacts-view-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.contact-item:hover {
    background: var(--light-secondary);
}

.contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    margin-right: 16px;
    flex-shrink: 0;
}

.contact-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.contact-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Settings View */
.settings-view {
    transform: translateX(100%);
    background: var(--surface-color);
}

.settings-view.active {
    transform: translateX(0);
}

.settings-view-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.settings-view-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    margin: 0 16px;
}

.settings-view-content {
    flex: 1;
    overflow-y: auto;
}

.settings-section {
}

.settings-section-title {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding: 0 8px;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--light-secondary);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-item:hover {
    background: var(--border-color);
}

.settings-item i:first-child {
    width: 40px;
    height: 40px;
    background: var(--light-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    margin-right: 16px;
}

.settings-item0 i:last-child {
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-item0 {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--light-secondary);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-item0:hover {
    background: var(--border-color);
}

.settings-item0 i:first-child {
    width: 40px;
    height: 40px;
    background: var(--light-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    margin-right: 16px;
}

.settings-item0 i:last-child {
    color: var(--text-secondary);
    font-size: 14px;
}
.settings-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.settings-info span:first-child {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-info span:last-child {
    font-size: 14px;
    color: var(--text-secondary);
}



/* Стили для режима редактирования */
.edit-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-edit-control {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-edit-control:enabled {
    cursor: pointer;
    background: var(--primary-color);
    color: white;
}

.btn-edit-control:enabled:hover {
    background: #2980e8;
    transform: scale(1.05);
}

/* Чекбоксы для выбора чатов */
.chat-select-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    background: var(--surface-color);
    margin-right: 12px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-select-checkbox.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.chat-select-checkbox.selected::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    display: block;
}

.chat-select-checkbox:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Анимация появления чекбоксов */
.chat-item .chat-select-checkbox {
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.edit-mode .chat-item .chat-select-checkbox {
    opacity: 1;
    transform: scale(1);
}

/* Анимация перемещения элементов чата */
.edit-mode .chat-avatar {
    margin-right: 8px;
    transition: margin-right 0.3s ease;
}

/* Скрытие аватара при редактировании */
.edit-mode .chat-avatar .avatar-initials,
.edit-mode .chat-avatar .online-dot,
.edit-mode .chat-avatar .pinned-icon {
    opacity: 0.5;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

/* Анимация для кнопок управления */
.btn-edit-control {
    animation: fadeInScale 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Анимация удаления чата */
.chat-item.deleting {
    animation: slideOut 0.3s forwards;
    transform-origin: left;
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Подсветка выбранных чатов */
.chat-item.selected-chat {
    background: var(--light-primary);
    border-left: 3px solid var(--primary-color);
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Стили для поиска в контактах */
.contacts-search-container {
    border-bottom: 1px solid var(--border-color);
}

.contacts-search-box {
    display: flex;
    align-items: center;
    background: var(--light-secondary);
    border-radius: 10px;
    padding: 8px 12px;
    gap: 8px;
}

.contacts-search-box i {
    color: var(--secondary-color);
    font-size: 14px;
}

.contacts-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.contacts-search-input::placeholder {
    color: var(--secondary-color);
}

.btn-contacts-search-clear {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: none;
}

.btn-contacts-search-clear:hover {
    opacity: 1;
}

.contacts-search-input:not(:placeholder-shown) + .btn-contacts-search-clear {
    display: block;
}

/* Стили для иконки закладки в контактах */
.contact-avatar i {
    font-size: 20px;
    color: white;
}

/* Анимация появления результатов поиска */
.contact-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-item:not([style*="display: none"]) {
    animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Индикатор отсутствия результатов поиска */
.no-contacts-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 16px;
    display: none;
}

.no-contacts-message i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Медиа-меню */
.media-menu {
    position: fixed;
    bottom: 70px;
    left: 16px;
    /*background: var(--surface-color);*/
    background: linear-gradient(to bottom, #ffffff 80%, rgba(255,255,255,0) 100%);
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: none;
    animation: fadeInUp 0.3s ease;
    min-width: 200px;
}

.media-menu.active {
    display: block;
}

.media-menu-content {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
}

.media-menu-triangle {
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--surface-color);
}

.media-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: none;
    background: var(--light-secondary);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
}

.media-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.media-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.media-btn[data-action="camera"] .media-icon {
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
}

.media-btn[data-action="gallery"] .media-icon {
    background: linear-gradient(45deg, #3390ec, #B59B3D);
}

.media-btn[data-action="file"] .media-icon {
    background: linear-gradient(45deg, #70b768, #4caf50);
}

/* Эмодзи-меню */
.emoji-menu {
    position: fixed;
    bottom: 55px;
    left: 0;
    right: 0;
    height: 400px;
    /*background: var(--surface-color);*/
    background: linear-gradient(to bottom, #ffffff 80%, rgba(255,255,255,0) 100%);
    border-radius: 24px;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.emoji-menu.active {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.emoji-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.emoji-menu-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.emoji-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.emoji-close-btn:hover {
    background: var(--border-color);
}

.emoji-tabs {
    display: flex;
    padding: 12px 20px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.emoji-tabs::-webkit-scrollbar {
    display: none;
}

.emoji-tab {
    padding: 8px 16px;
    border: none;
    background: var(--light-secondary);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.emoji-tab.active {
    background: var(--primary-color);
    color: white;
}

.emoji-tab:hover:not(.active) {
    background: var(--border-color);
}

.emoji-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
	height:266px
}

@media (max-width: 768px) {
    .emoji-container {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (max-width: 480px) {
    .emoji-container {
        grid-template-columns: repeat(6, 1fr);
    }
}

.emoji-item {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--light-secondary);
    border: none;
}

.emoji-item:hover {
    background: var(--border-color);
    transform: scale(1.1);
}

.emoji-item:active {
    transform: scale(0.95);
}

.popular-emoji {
    background: var(--light-primary);
    border: 2px solid var(--primary-color);
}

.emoji-section-title {
    grid-column: 1 / -1;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    margin-top: 8px;
    text-align: left;
    font-weight: 500;
}

.emoji-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    font-weight: bold;
}

.emoji-item {
    position: relative;
}

/* Затемнение фона при открытых меню */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Стили для секции профиля в настройках */
.profile-header-section {
    position: relative;
    height: 200px;
/*    background: linear-gradient(135deg, var(--primary-color), #B59B3D);*/
    background: linear-gradient(180deg, #FFE791 0%, #B59B3D 100%);
	background-position: center;
	background-size: cover;
    padding: 24px 16px 32px;
    transition: height 0.3s ease;
    overflow: hidden;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
}

.profile-avatar-large .avatar-initials {
    font-size: 48px;
    color: white;
    font-weight: 600;
}

.profile-info-large {
    position: absolute;
    left: 152px;
    top: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: calc(100% - 168px);
}

.profile-name-large {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-name-large-my {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-phone-large {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
	margin-bottom: 4px;
}

/* Состояние при скролле */
.settings-view.scrolled .profile-header-section {
    height: 140px;
}

.settings-view.scrolled .profile-avatar-large {
    border-radius: 40px;
}

.settings-view.scrolled .profile-info-large {
    left: 50%;
    transform: translateX(-50%);
    top: 160px;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.settings-view.scrolled .profile-name-large {
    font-size: 18px;
    white-space: normal;
    text-align: center;
}

.settings-view.scrolled .profile-phone-large {
    font-size: 14px;
    text-align: center;
}

/* Тоггл-переключатели */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--light-secondary);
    transition: .4s;
    border-radius: 34px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
    background-color: var(--primary-color);
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(24px);
}

/* Специальные элементы настроек */
.logout-item i:first-child {
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    color: white;
}

.delete-account-item i:first-child {
    background: var(--danger-color);
    color: white;
}

/* Футер настроек */
.settings-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 16px;
}

.app-version {
    opacity: 0.7;
}

/* Анимация загрузки контента */
@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-item {
    animation: fadeInItem 0.3s ease forwards;
    opacity: 0;
}

.settings-item:nth-child(1) { animation-delay: 0.1s; }
.settings-item:nth-child(2) { animation-delay: 0.15s; }
.settings-item:nth-child(3) { animation-delay: 0.2s; }
.settings-item:nth-child(4) { animation-delay: 0.25s; }
.settings-item:nth-child(5) { animation-delay: 0.3s; }
.settings-item:nth-child(6) { animation-delay: 0.35s; }

/* Иконки с градиентом */
.settings-item i:first-child {
    background: linear-gradient(45deg, var(--primary-color-gold), #B59B3D);
    color: white;
}

.settings-item0 {
    animation: fadeInItem 0.3s ease forwards;
    opacity: 0;
}

.settings-item0:nth-child(1) { animation-delay: 0.1s; }
.settings-item0:nth-child(2) { animation-delay: 0.15s; }
.settings-item0:nth-child(3) { animation-delay: 0.2s; }
.settings-item0:nth-child(4) { animation-delay: 0.25s; }
.settings-item0:nth-child(5) { animation-delay: 0.3s; }
.settings-item0:nth-child(6) { animation-delay: 0.35s; }

/* Иконки с градиентом */
.settings-item0 i:first-child {
    background: linear-gradient(45deg, var(--primary-color-gold), #B59B3D);
    color: white;
}

/* Анимация для секций */
.settings-section {
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(20px);
	padding:16px;
}

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

.settings-section:nth-child(2) { animation-delay: 0.1s; }
.settings-section:nth-child(3) { animation-delay: 0.2s; }
.settings-section:nth-child(4) { animation-delay: 0.3s; }
.settings-section:nth-child(5) { animation-delay: 0.4s; }
.settings-section:nth-child(6) { animation-delay: 0.5s; }
.settings-section:nth-child(7) { animation-delay: 0.6s; }
.settings-section:nth-child(8) { animation-delay: 0.7s; }
.settings-section:nth-child(9) { animation-delay: 0.8s; }
.settings-section:nth-child(10) { animation-delay: 0.9s; }



/* Дополнительные стили для аватара с фото */
.profile-avatar-large {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.profile-avatar-large::after {
    content: '\f030'; /* Иконка камеры */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.3);
}

.profile-avatar-large:hover::after {
    opacity: 0.6;
    transform: translateY(0);
}

/* Для аватара с загруженной фотографией */
.profile-avatar-large.has-photo .avatar-initials {
    display: none;
}

.profile-avatar-large .avatar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.profile-avatar-large.has-photo .avatar-photo {
    display: block;
}

/* Состояние загрузки */
.profile-avatar-large.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.profile-avatar-large.loading::after {
    content: '\f110'; /* Иконка загрузки */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    opacity: 1 !important;
    background: transparent;
    color: var(--primary-color);
    font-size: 24px;
    box-shadow: none;
    width: auto;
    height: auto;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Состояние ошибки */
.profile-avatar-large.error {
    border-color: var(--danger-color);
}

.profile-avatar-large.error::after {
    content: '\f071'; /* Иконка ошибки */
    background: var(--danger-color);
    opacity: 1;
    transform: translateY(0);
}

/* Анимация изменения аватара */
@keyframes avatarChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.avatar-changed {
    animation: avatarChange 0.5s ease;
}

/* Модальное окно выбора аватара */
.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

.avatar-modal-content {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 300px;
    width: 90%;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.avatar-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.avatar-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.avatar-modal-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.avatar-modal-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.avatar-modal-btn {
    display: flex;
    align-items: center;
    padding: 16px;
    border: none;
    background: var(--light-secondary);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
}

.avatar-modal-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.avatar-modal-btn i {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.avatar-modal-btn[data-action="camera"] i {
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
}

.avatar-modal-btn[data-action="gallery"] i {
    background: linear-gradient(45deg, #3390ec, #3db56d);
}

.avatar-modal-btn[data-action="remove"] i {
    background: var(--danger-color);
}

.avatar-modal-btn[data-action="cancel"] i {
    background: var(--secondary-color);
}

/* Предпросмотр аватара */
.avatar-preview {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 3px solid var(--primary-color);
    position: relative;
}

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

.avatar-preview-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.avatar-preview-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.avatar-preview-btn.confirm {
    background: var(--primary-color);
    color: white;
}

.avatar-preview-btn.cancel {
    background: var(--light-secondary);
    color: var(--text-primary);
}

.avatar-preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* Стили для модальных окон настроек */
#modalWindowsContainer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10000;
}

.modal-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface-color);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
}

.modal-window.closing {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.modal-window-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-window-back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.modal-window-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.modal-window-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    background: var(--background-color);
}

/* Стили для пустой страницы */
.empty-page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70vh;
    text-align: center;
    padding: 20px;
}

.empty-page-icon {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    background: var(--light-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: bounce 2s infinite;
}

.empty-page-icon i {
    font-size: 36px;
    color: var(--secondary-color);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-page-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 300px;
    line-height: 1.5;
}

.empty-page-action-btn {
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.2);
}

.empty-page-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(51, 144, 236, 0.3);
}

.empty-page-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.2);
}

/* Стили для темной темы */
@media (prefers-color-scheme: dark) {
    .empty-page-icon {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .empty-page-icon i {
        color: rgba(255, 255, 255, 0.6);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .empty-page-icon {
        width: 70px;
        height: 70px;
    }
    
    .empty-page-icon i {
        font-size: 32px;
    }
    
    .empty-page-title {
        font-size: 20px;
    }
    
    .empty-page-description {
        font-size: 14px;
    }
}

/* Стек модальных окон */
.modal-window:nth-last-child(2) {
    transform: translateX(-30px) scale(0.95);
    opacity: 0.7;
    filter: blur(2px);
    transition: all 0.3s ease;
}

.modal-window:nth-last-child(3) {
    transform: translateX(-60px) scale(0.9);
    opacity: 0.4;
    filter: blur(4px);
    transition: all 0.3s ease;
}

/* Параллакс эффект для бэкграунда */
.modal-window-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        rgba(51, 144, 236, 0.8) 50%, 
        rgba(108, 147, 255, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.modal-window-background.active {
    opacity: 0.1;
}


/* Стили для меню чата */
.chat-menu {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: none;
    animation: fadeInDown 0.3s ease;
    min-width: 220px;
}

.chat-menu.active {
    display: block;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-menu .media-menu-triangle {
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--surface-color);
}

.chat-menu-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
    width: 100%;
    text-align: left;
	background: var(--light-secondary);
	border-radius: 12px;
}

.chat-menu-btn:hover {
    background: var(--light-secondary);
}

.chat-menu-btn .media-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--light-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary-color);
}

.media-icon {
    background: var(--text-secondary) !important;
    color: white !important;
}


/* Стили для строки поиска в чате */
.chat-search-bar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 6px;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-search-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-search-close:hover {
    background: var(--border-color);
}

.chat-search-input-wrapper {
    flex: 1;
    position: relative;
    background: var(--light-secondary);
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-search-input-wrapper i {
    color: var(--secondary-color);
    font-size: 14px;
    flex-shrink: 0;
}

.chat-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    padding: 0;
}

.chat-search-input::placeholder {
    color: var(--secondary-color);
}

.chat-search-counter {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--light-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: -25px;
    flex-shrink: 0;
}

.chat-search-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.chat-search-nav-btn {
    width: 32px;
    height: 24px;
    border-radius: 8px;
    border: none;
    background: var(--light-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.chat-search-nav-btn:hover {
    background: var(--primary-color);
    color: white;
}

.chat-search-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.chat-search-nav-btn:disabled:hover {
    background: var(--light-secondary);
    color: var(--text-primary);
}

/* Подсветка найденных сообщений */
.message.sent.highlighted {
    background: rgb(255 229 0) !important;
    border: 2px solid #FFEB3B;
    border-radius: 18px 18px 8px 18px;
    animation: highlightPulse 1.5s ease-in-out;
}
/* Подсветка найденных сообщений */
.message.received.highlighted {
    background: rgb(255 229 0) !important;
    border: 2px solid #FFEB3B;
    border-radius: 18px 18px 18px 6px;
    animation: highlightPulse 1.5s ease-in-out;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 235, 59, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0);
    }
}

.message.current-highlight {
    background: rgba(255, 193, 7, 0.3) !important;
    border: 2px solid #FFC107;
    position: relative;
	border-radius: 15px;
    padding: 10px;
}

.message.current-highlight::before {
    content: '•';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FFC107;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 0.5s ease;
}

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

/* Для мобильных устройств */
@media (max-width: 768px) {
    .chat-search-bar {
        height: 56px;
        padding: 0 5px;
    }
    
    .chat-search-input-wrapper {
        padding: 6px 12px;
    }
    
    .chat-search-nav {
        flex-direction: row;
    }
    
    .chat-search-nav-btn {
        width: 28px;
        height: 28px;
    }
	
	.chat-search-bar {
		gap: 6px;
	}
	
	.chat-search-counter {
		margin-left: -25px;
	}
}


.account-avatar-section {
    text-align: center;
    margin: 20px 0 30px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 16px;
}

.account-avatar-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.account-avatar-display {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.account-avatar-display .avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
}

.account-avatar-change-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.account-avatar-change-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.3);
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.account-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.account-form-input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: all 0.2s;
}

.account-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.account-form-input:disabled {
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.account-form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.avatar-colors {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.avatar-color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.avatar-color-option:hover {
    transform: scale(1.1);
}

.avatar-color-option.selected {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}



.account-danger-zone {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--danger-color);
}

.danger-zone-title {
    color: var(--danger-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.danger-zone-btn {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: 2px solid var(--danger-color);
    background: transparent;
    color: var(--danger-color);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.danger-zone-btn:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
}

.danger-zone-btn:last-child {
    margin-bottom: 0;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.password-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-form-input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: var(--surface-color);
    color: var(--text-primary);
}

.password-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}


.loading-indicator {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 30px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    font-size: 10px;
}

.loading-text {
    font-size: 12px;
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


.settings-page-content {
    max-width: 600px;
    margin: 0 auto;
}

.settings-page-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.settings-page-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.settings-page-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.settings-page-section {
    margin-bottom: 32px;
    background: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.settings-page-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.settings-page-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-page-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-page-option:last-child {
    border-bottom: none;
}

.settings-page-option span {
    font-size: 16px;
    color: var(--text-primary);
}

.settings-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 120px;
}

.settings-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--light-secondary);
    border-radius: 2px;
    outline: none;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(51, 144, 236, 0.3);
}

.settings-page-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.settings-page-action-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-page-action-btn.save-btn {
    background: var(--primary-color);
    color: white;
}

.settings-page-action-btn.cancel-btn {
    background: var(--light-secondary);
    color: var(--text-primary);
}

.settings-page-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .settings-page-content {
        padding: 0 8px;
    }

    .settings-page-section {
        padding: 16px;
    }

    .settings-page-actions {
        flex-direction: column;
    }
}




.font-settings-modal .settings-page-content {
    max-width: 500px;
}

.font-size-preview-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.font-size-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.font-size-values {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.font-size-values span:not(:nth-child(2)) {
    font-size: 11px;
    opacity: 0.7;
}

.font-size-example {
    padding: 8px 12px;
    background: var(--light-primary);
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: font-size 0.2s ease;
}

.font-preview-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.font-preview-container {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.font-preview-container h5 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.font-preview-text {
    padding: 12px;
    background: var(--light-primary);
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.font-preview-chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.font-preview-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.font-preview-message.received .message-content {
    background: var(--light-primary);
    border-radius: 12px;
    padding: 8px 12px;
    max-width: 70%;
}

.font-preview-message.sent .message-content {
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 8px 12px;
    max-width: 70%;
    margin-left: auto;
}

.font-preview-message .message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
}

.font-preview-message .message-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    margin-top: 4px;
}

.font-preview-message.received .message-info {
    color: var(--text-secondary);
}

.font-preview-message.sent .message-info {
    color: rgba(255, 255, 255, 0.8);
}

.settings-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--light-secondary);
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.4);
    transition: transform 0.2s;
}

.settings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.settings-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.settings-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

#fontSettingsSave:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#fontSettingsSave:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.3);
}

@media (max-width: 480px) {
    .font-settings-modal .settings-page-content {
        padding: 0 4px;
    }

    .settings-select {
        min-width: 150px;
    }
}

.text-center {text-align: center !important;}
.d-none {display: none !important;}


/* ===== СТИЛИ ДЛЯ НАСТРОЙКИ ФОНА ЧАТА ===== */

/* Основное окно настроек фона */
.background-settings-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-color);
    z-index: 9999;
    overflow-y: auto;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Заголовок */
.background-settings-page .settings-header {
    position: sticky;
    top: 0;
    background: var(--surface-color);
    z-index: 10;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.background-settings-page .settings-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.background-settings-page .settings-header .back-button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.background-settings-page .settings-header .back-button:hover {
    background-color: rgba(51, 144, 236, 0.1);
}

/* Контейнер превью */
.background-preview-container {
    padding: 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.background-preview-container h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Превью чата */
.chat-previeww {
    background: var(--background-color);
    border-radius: 16px;
    padding: 20px;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* Сообщения в превью */
.preview-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-message.incoming {
    margin-right: auto;
}

.preview-message.outgoing {
    margin-left: auto;
    flex-direction: row-reverse;
}

.preview-message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.preview-message .message-content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 12px;
    max-width: calc(100% - 44px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-message.incoming .message-content {
    border-top-left-radius: 4px;
}

.preview-message.outgoing .message-content {
    background: rgba(51, 144, 236, 0.9);
    color: white;
    border-top-right-radius: 4px;
}

.preview-message .sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.preview-message.outgoing .sender {
    color: rgba(255, 255, 255, 0.9);
}

.preview-message .text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.preview-message.outgoing .text {
    color: white;
}

/* Сетка фонов */
.background-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px 16px;
}

.background-tile {
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.background-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.background-tile.selected {
    border-color: var(--primary-color);
    border-width: 3px;
    transform: scale(0.98);
}

.background-tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.background-tile:hover .background-tile-overlay,
.background-tile.selected .background-tile-overlay {
    opacity: 1;
}

.background-tile-overlay i {
    color: white;
    font-size: 24px;
    background: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Контейнер кнопки */
.apply-container {
    position: sticky;
    bottom: 0;
    padding: 20px 16px;
}

.apply-button {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-button:not(:disabled):hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(51, 144, 236, 0.3);
}

.apply-button:disabled {
    background: var(--light-secondary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Оверлей для фона чата (для читаемости текста) */
.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Адаптивность */
@media (min-width: 768px) {
    .background-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 32px;
    }

    .chat-previeww {
        max-width: 600px;
        margin: 0 auto;
    }

    .background-settings-page .settings-header {
        padding: 24px 32px;
    }

    .background-preview-container {
        padding: 32px;
    }

    .apply-container {
        padding: 24px 32px;
    }
}

@media (min-width: 1024px) {
    .background-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Анимации */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.background-tile.selected {
    animation: pulse 2s infinite;
}


/* ===== СТИЛИ ДЛЯ СТРАНИЦ (PAGE-VIEW) ===== */

/* Основной контейнер страницы */
.page-view {
    display: none;
    flex-direction: column;
    height: 100%;
    background: var(--surface-color);
    transform: translateX(100%);
}

.page-view.active {
    display: flex;
    transform: translateX(0);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-view.closing {  /* ← ДОБАВЬ ЭТОТ КЛАСС */
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0.8;
    }
}

/* Заголовок страницы */
.page-view-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-view-header .btn-back {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: all 0.2s;
}

.page-view-header .btn-back:hover {
    background: var(--light-secondary);
    border-radius: 50%;
}

.page-view-title {
    flex: 1;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.page-header-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.page-header-actions .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.page-header-actions .btn-icon:hover {
    background: var(--border-color);
}

/* Контент страницы */
.page-view-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--surface-color);
}

.page-view-content::-webkit-scrollbar {
    width: 4px;
}

.page-view-content::-webkit-scrollbar-track {
    background: transparent;
}

.page-view-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.page-view-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===== СТИЛИ ДЛЯ КОНКРЕТНЫХ СТРАНИЦ ===== */



/* Индикатор выбранного языка */
.lang-check {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
    margin-left: 8px;
    display: inline-block !important;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* Тоггл-переключатели для страниц */
.page-view .toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.page-view .toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.page-view .toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--light-secondary);
    transition: .4s;
    border-radius: 34px;
}

.page-view .toggle-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.page-view .toggle-input:checked + .toggle-label {
    background-color: var(--primary-color);
}

.page-view .toggle-input:checked + .toggle-label:before {
    transform: translateX(24px);
}



/* ===== АНИМАЦИИ ===== */

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0.8;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0.8;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.page-view .settings-item-emp {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--light-secondary);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
    animation: fadeInItem 0.3s ease forwards;
    opacity: 0;
}
.page-view .settings-item-emp .lang-check {
    text-align: right;
    width: 100%;
}

.page-view .settings-item-emp :hover {
    background: var(--border-color);
}

.page-view .settings-item-emp  i:first-child {
    width: 40px;
    height: 40px;
    background: var(--light-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    margin-right: 16px;
}

.page-view .settings-item-emp span:last-child {
    font-size: 14px;
    color: var(--text-secondary);

}

.page-view .settings-item-emp div:last-child {
    font-size: 14px;
    color: var(--text-secondary);
}

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (max-width: 768px) {
    .page-view-header {
        height: 52px;
        padding: 0 12px;
    }

    .page-view-title {
        font-size: 18px;
    }

    .page-view-content {
        padding: 12px;
    }

    .page-view .settings-select {
        min-width: 120px;
    }

    .page-view .settings-slider {
        width: 120px;
    }

    .page-view .empty-page-icon {
        width: 70px;
        height: 70px;
    }

    .page-view .empty-page-icon i {
        font-size: 32px;
    }

    .page-view .empty-page-title {
        font-size: 20px;
    }

    .page-view .empty-page-description {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .page-view .settings-select {
        min-width: 100px;
    }

    .page-view .settings-slider {
        width: 100px;
    }
}

/* ===== ТЕМНАЯ ТЕМА ===== */
@media (prefers-color-scheme: dark) {
    .page-view .empty-page-icon {
        background: rgba(255, 255, 255, 0.1);
    }

    .page-view .empty-page-icon i {
        color: rgba(255, 255, 255, 0.6);
    }
}

/* ===== ИНДИКАТОР ЗАГРУЗКИ ===== */
.page-view .loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

.page-view .loading-spinner {
    font-size: 24px;
}

.page-view .loading-spinner i {
    animation: spin 1s linear infinite;
}

.page-view .loading-text {
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Для любой новой страницы */
#languageView {
    transform: translateX(100%);  /* Изначально скрыта справа */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#languageView.active {
    transform: translateX(0);     /* Показывается */
}

.privacy-page {
    animation: fadeIn 0.3s ease;
}

.privacy-page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.privacy-page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.privacy-page-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.privacy-options-container {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.privacy-option {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.privacy-option:last-child {
    border-bottom: none;
}

.privacy-option:hover {
    background: var(--light-primary);
}

.privacy-option-label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    width: 100%;
}

.privacy-option-label input[type="radio"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color-gold);
    cursor: pointer;
}

.privacy-option-text {
    font-size: 16px;
    color: var(--text-primary);
    flex: 1;
}

.privacy-page-footer {
    padding: 20px;
    text-align: center;
}

.privacy-save-btn {
    background: linear-gradient(45deg, var(--primary-color-gold), var(--primary-color-gold-dark));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 200px;
    opacity: 0.7;
}

.privacy-save-btn:not(:disabled) {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}

.privacy-save-btn:disabled {
    cursor: not-allowed;
    background: var(--light-secondary);
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптация для темной темы */
[data-theme="dark"] .privacy-options-container {
    background: var(--surface-color-dark);
    border-color: var(--border-color-dark);
}

[data-theme="dark"] .privacy-option {
    border-color: var(--border-color-dark);
}

[data-theme="dark"] .privacy-option:hover {
    background: var(--light-primary-dark);
}

[data-theme="dark"] .privacy-option-text {
    color: var(--text-primary-dark);
}

[data-theme="dark"] .privacy-page-description {
    color: var(--text-secondary-dark);
}
.small{font-size:80%}

.disabled {
    background-color: #ccc;
    color: #666;
    border: 1px solid #999;
    cursor: not-allowed;
    opacity: 0.6;
}
.disabledSave {
    cursor: not-allowed;
}


/* Стили для медиа-сообщений */
.message-media {
    border-radius: 12px;
    overflow: hidden;
    max-width: 300px;
    cursor: pointer;
}

.message-media.photo img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.message-media.photo img:hover {
    transform: scale(1.02);
}

message-media.video {
    position: relative;
    border-radius: 50%;
    overflow: visible !important;
}

.message-media.video video {
    border-radius: 50%;
    object-fit: cover;
}

.message-media.video {
    position: relative;
}

.message-media.video video {
    width: 100%;
    max-height: 320px;
    border-radius: 12px;
    background: #000;
}

.message-media.circle circle {
    width: 100%;
    max-height: 320px;
    border-radius: 12px;
    background: #000;
}

/* Анимация появления прогресс-бара */
.video-progress-ring {
    animation: ringAppear 0.3s ease;
}

@keyframes ringAppear {
    from {
        opacity: 0;
        transform: rotate(-90deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(-90deg) scale(1);
    }
}

/* Свечение для активной линии */
.video-progress-ring circle:last-child {
    filter: drop-shadow(0 0 6px rgb(181, 155, 61));
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(51, 144, 236, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--primary-color);
}

.message-media.audio {
    min-width: 200px;
}

.message-media.audio audio {
    width: 100%;
    height: 40px;
}

.message-media.file {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    min-width: 250px;
    transition: background 0.3s ease;
}


.message-media.file:hover {
    background: rgba(0, 0, 0, 0.1);
}

.message.sent .message-media.file:hover {
    background: rgba(255, 255, 255, 0.3);
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-right: 12px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    opacity: 0.7;
}

.file-download {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-download:hover {
    background: rgba(51, 144, 236, 0.2);
}

.media-caption {
    font-size: 14px;
    margin-top: 8px;
    padding: 4px 8px;
    opacity: 0.9;
}

.message.sent .media-caption {
    color: white;
}

/* Анимация загрузки медиа */
@keyframes mediaPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.message-media.loading {
    animation: mediaPulse 1.5s infinite;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .message-media {
        max-width: 250px;
    }

    .message-media.audio {
        min-width: 200px;
    }

    .message-media.file {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .message-media {
        max-width: 200px;
    }

    .video-play-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .message-media.file {
        background: rgba(255, 255, 255, 0.1);
    }

    .message.sent .message-media.file {
        background: rgba(0, 0, 0, 0.3);
    }

    .file-download {
        color: white;
    }

    .file-download:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}


/* ===== МЕДИА-ПРОСМОТРЩИК ===== */
.media-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mediaViewerFadeIn 0.3s ease;
}

@keyframes mediaViewerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.media-viewer-download{
    position: absolute;
    top: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20001;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.media-viewer-download:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.media-viewer-download:active {
    transform: scale(0.95);
}
.media-viewer-share{
    position: absolute;
    top: 10px;
    right: 50px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20001;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.media-viewer-share:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.media-viewer-share:active {
    transform: scale(0.95);
}

.media-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20001;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.media-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.media-viewer-close:active {
    transform: scale(0.95);
}

.media-viewer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mediaViewerZoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes mediaViewerZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.media-viewer-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.media-viewer-video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Индикатор загрузки для медиа */
.media-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Навигация для галереи */
.media-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 20001;
}

.media-viewer-nav.prev {
    left: 20px;
}

.media-viewer-nav.next {
    right: 20px;
}

.media-viewer-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.media-viewer-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.media-viewer-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Информация о медиа */
.media-viewer-info {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-viewer-content:hover .media-viewer-info {
    opacity: 1;
}

/* Счетчик изображений */
.media-viewer-counter {
    position: absolute;
    top: 10px;
    left: 50px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(5px);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .media-viewer-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .media-viewer-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .media-viewer-nav.prev {
        left: 10px;
    }

    .media-viewer-nav.next {
        right: 10px;
    }

    .media-viewer-info {
        bottom: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .media-viewer-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .media-viewer-close {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .media-viewer-counter {
        top: 10px;
        left: 10px;
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Для устройств с тач-интерфейсом */
@media (hover: none) and (pointer: coarse) {
    .media-viewer-nav {
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.5);
    }

    .media-viewer-info {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    }
}

/* Анимация свайпа для закрытия */
.media-viewer-content.swiping {
    transition: none;
}

.media-viewer-content.swiping .media-viewer-container {
    transition: none;
}

/* Темная тема (уже в основном) */
@media (prefers-color-scheme: dark) {
    .media-viewer-modal {
        background: rgba(0, 0, 0, 0.98);
    }
}

/* Дополнительные стили для видео */
.media-viewer-video-controls {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-viewer-content:hover .media-viewer-video-controls {
    opacity: 1;
}

.media-viewer-video-controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.media-viewer-video-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.media-viewer-video-controls button:active {
    transform: scale(0.95);
}

/* Стили для просмотра в ландшафтной ориентации */
@media (orientation: landscape) and (max-height: 500px) {
    .media-viewer-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
    }

    .media-viewer-info {
        bottom: 5px;
        padding: 5px;
    }

    .media-viewer-video-controls {
        bottom: 50px;
    }
}

/* ===== ПЛЕЙСХОЛДЕРЫ ДЛЯ МЕДИА ===== */
.image-placeholder {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    font-size: 24px;
    min-height: 100px;
    border-radius: 12px;
}

.image-placeholder i {
    font-size: 32px;
    opacity: 0.5;
}

.video-placeholder {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    min-height: 100px;
    border-radius: 12px;
}

.video-placeholder i {
    font-size: 48px;
    opacity: 0.8;
}

.audio-placeholder {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-placeholder i {
    font-size: 24px;
    color: var(--primary-color);
}

/* Для темной темы */
@media (prefers-color-scheme: dark) {
    .image-placeholder {
        background: linear-gradient(135deg, #2d2d3a 0%, #1a1a2e 100%);
        color: #808080;
    }

    .audio-placeholder {
        background: linear-gradient(135deg, #2d2d3a 0%, #1a1a2e 100%);
        color: white;
    }
}

/* Дополнительные стили для плейсхолдера изображений */
.image-error-placeholder {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #999;
    font-size: 32px;
}

/* Для темной темы */
@media (prefers-color-scheme: dark) {
    .image-error-placeholder {
        background: linear-gradient(135deg, #2d2d3a 0%, #1a1a2e 100%);
        color: #666;
    }
}

/* Profile Menu */
.profile-menu {
    position: fixed;
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: none;
    animation: fadeInDown 0.3s ease;
    min-width: 240px;
}

.profile-menu.active {
    display: block;
}

.profile-menu .media-menu-triangle {
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--surface-color);
}

.profile-menu-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--light-secondary);
    border-radius: 12px;
    margin-bottom: 4px;
}

.profile-menu-btn:hover {
    background: var(--border-color);
}

.profile-menu-btn .media-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--light-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary-color);
}

.profile-menu-btn[data-action="block"] .media-icon {
    background: rgba(223, 63, 64, 0.1);
    color: var(--danger-color);
}

.profile-menu-btn[data-action="delete_contact"] .media-icon {
    background: rgba(223, 63, 64, 0.1);
    color: var(--danger-color);
}

.profile-menu-btn[data-action="block"].blocked .media-icon {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.profile-menu-btn[data-action="block"].blocked span {
    color: var(--success-color);
}

/* Стили для списка заблокированных */
.blocked-user-item {
    transition: background 0.2s;
}

.blocked-user-item:hover {
    background: var(--light-secondary);
}

.blocked-user-item .unblock-btn {
    transition: all 0.2s;
}

.blocked-user-item .unblock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.3);
}

.blocked-user-item .unblock-btn:active {
    transform: translateY(0);
}


/* Стили для статусов сообщений */
.message .fa-clock {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
    animation: clockPulse 1.5s infinite;
}

@keyframes clockPulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.message .fa-check {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}
.message .fas.fa-check {
    color: #000;
    font-size: 12px;
    margin-left: 0px;
}

.message .fa-check-double {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}

.message .fa-check-double.read {
    color: #53bdeb;
}

/* Статус для исходящих сообщений */
.message.sent .message-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 12px;
}

.message.sent .fa-clock,
.message.sent .fa-check,
.message.sent .fa-check-double {
    color: #000;
}

.message.sent .fa-check-double.read {
    color: #000;
    opacity: 1;
}

/* Стили для иконки muted */
.muted-icon {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-secondary);
    border: 2px solid var(--surface-color);
    z-index: 2;
}

.muted-icon i {
    font-size: 10px;
}

/* Стили для пустого списка чатов */
.empty-chats-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-chats-message i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-chats-message h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Стили для пустого списка чатов */
.empty-chats-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-chats-message i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-chats-message h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-chats-message p {
    font-size: 14px;
}

/* Индикатор соединения */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10000;
    animation: slideDown 0.3s ease;
}

.connection-status.online {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.connection-status.offline {
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

/* Индикатор печатания */
.typing-indicator {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
    animation: fadeIn 0.3s ease;
}

/* Статус доставки */
.message .status.fa-check-double.read {
    color: var(--primary-color);
}
/* Статус доставки */
.message .status.fa-check-double {
    color: var(--primary-color);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== ГРУППОВЫЕ МЕДИА ===== */
.media-group {
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
}

.media-grid {
    display: grid;
    gap: 2px;
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
}

.media-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.media-grid-3 {
}

.media-grid-3 .media-grid-item:first-child {
    grid-column: span 2;
}

.media-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.media-grid-item {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    cursor: pointer;
}

.media-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-grid-item:hover img {
    transform: scale(1.05);
}

.media-grid-more {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    backdrop-filter: blur(2px);
}

/* ===== УЛУЧШЕННЫЙ МЕДИА-ПРОСМОТРЩИК ===== */
.media-viewer-file {
    text-align: center;
    color: white;
    padding: 40px;
}

.media-viewer-file .file-name {
    margin: 20px 0;
    font-size: 18px;
    word-break: break-word;
}

.media-viewer-file .download-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 24px;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.media-viewer-file .download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.3);
}

/* Анимация перехода */
.media-viewer-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Индикатор позиции */
.media-viewer-counter {
    position: absolute;
    top: 10px;
    left: 50px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    z-index: 20001;
}

/* Стили для файлов в сообщениях */
.message-media.file {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--surface-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid var(--border-color);
    margin: 4px 0;
}

.message-media.file:hover {
    background: var(--light-secondary);
}

.message-media.file .file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--light-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--primary-color);
    font-size: 20px;
}

.message-media.file .file-info {
    flex: 1;
    min-width: 0;
}

.message-media.file .file-name {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-media.file .file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.message-media.file .file-download {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--light-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.2s;
}

.message-media.file .file-download:hover {
    background: var(--primary-color);
    color: white;
}

/* Стили для медиа сообщений */
.message-media.photo,
.message-media.video {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.message-media.photo img,
.message-media.video video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.message-media.photo:hover img,
.message-media.video:hover video {
    transform: scale(1.02);
}

.message-media .video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    pointer-events: none;
}

.message-media .media-caption {
    padding: 8px 12px;
    background: var(--surface-color);
    font-size: 14px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Индикатор загрузки */
.upload-progressC {
    background: var(--border-color);
    overflow: hidden;
    position: relative;
}

.upload-progressC .progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.upload-progressC .progress-text {
    position: absolute;
    top: 6px;
    font-size: 8px;
    color: #ffffff;
}

.upload-progressC .progress-close {
    position: absolute;
    font-size: 18px;
    color: #ffffff;
    align-self: anchor-center;
    justify-self: anchor-center;
}


/* Стили для прогресс-бара загрузки */
.upload-progressC {
    position: absolute;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    animation: slideUp 0.3s ease;
}


.upload-progressC .progress-text {
    font-size: 12px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.upload-progressC .progress-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgb(255 0 0 / 53%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    color: white;
}

.upload-progressC .progress-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.upload-progressC .progress-close:active {
    transform: scale(0.95);
}


/* Индикатор загрузки */
.upload-progress {
    margin-top: 8px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.upload-progress .progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.upload-progress .progress-text {
    position: absolute;
    left: 20px;
    top: 6px;
    font-size: 8px;
    color: #ffffff;
}

.upload-progress .progress-close {
    position: absolute;
    font-size: 18px;
    color: #ffffff;
    align-self: anchor-center;
    justify-self: anchor-center;
}


/* Стили для прогресс-бара загрузки */
.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    text-align: center;
    border-radius: 0 0 12px 12px;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    animation: slideUp 0.3s ease;
}

.upload-progress .progress-text {
    font-size: 12px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.upload-progress .progress-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgb(255 0 0 / 53%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    color: white;
}

.upload-progress .progress-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.upload-progress .progress-close:active {
    transform: scale(0.95);
}

/* Анимация пульсации для активной загрузки */
@keyframes uploadPulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.message-media.uploading {
    animation: uploadPulse 1.5s infinite;
    position: relative;
}

/* Индикатор загрузки для фото */
.message-media.photo.uploading::before,
.message-media.video.uploading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    z-index: 1;
    pointer-events: none;
}

/* Стили для кнопки отмены */
.cancel-upload-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(223, 63, 64, 0.9);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s
    ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    align-self: anchor-center;
    justify-self: anchor-center;
}

.cancel-upload-btn:hover {
    transform: scale(1.1);
    background: var(--danger-color);
}

.cancel-upload-btn:active {
    transform: scale(0.95);
}
/* Стили для кнопки отмены */
.cancel-upload-btnCircle {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(223, 63, 64, 0.9);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s
    ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    align-self: anchor-center;
    justify-self: anchor-center;
    top: 85px;
}

.cancel-upload-btnCircle:hover {
    transform: scale(1.1);
    background: var(--danger-color);
}

.cancel-upload-btnCircle:active {
    transform: scale(0.95);
}

/* Для сообщений с медиа */
.message-content-media {
    position: relative;
}

.message-content-media .upload-progressC {
    position: absolute;
    bottom: 86px;
    left: 75px;
    right: auto;
    width: 50px;
    height: 50px;
    border-radius: 15px;
}

/* Стили для файлов */
.message-media.file .upload-progressC {
    position: static;
    margin-top: 8px;
    background: var(--light-primary);
    border-radius: 4px;
    padding: 2px;
}

.message-content-media .upload-progress {
    position: absolute;
    bottom: 0px;
    left: 0;
    right: 0;
    border-radius: 0 0 12px 12px;
}

/* Стили для файлов */
.message-media.file .upload-progress {
    position: static;
    margin-top: 8px;
    background: var(--light-primary);
    border-radius: 4px;
    padding: 2px;
}

.message-media.file .progress-bar {
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.message-media.file .progress-text {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .upload-progress {
        background: rgba(0, 0, 0, 0.8);
    }

    .cancel-upload-btn {
        background: rgba(223, 63, 64, 0.8);
    }

    .message-media.file .upload-progress {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Стили для статусов загрузки */
.message-media.uploading {
    position: relative;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.3);
}
.message-media.uploadingC {
    position: relative;
}

.message-media.error {
    border: 2px solid var(--danger-color);
    opacity: 0.8;
}

.message-media.cancelled {
    opacity: 0.5;
    filter: grayscale(1);
}

.upload-progress.complete {
    background: rgba(76, 175, 80, 0.9);
}

.upload-progress.complete .progress-text::after {
    content: ' ✓';
}

.upload-error {
    animation: slideIn 0.3s ease;
    margin-top: 8px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация для кнопки отмены */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cancel-upload-btn {
    animation: pulse 2s infinite;
}

.cancel-upload-btn:hover {
    animation: none;
}

/* Стили для прогресс-бара в просмотрщике */
.media-viewer-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20002;
    text-align: center;
    border-radius: 50%;
    padding: 20px;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 120px;
    height: 120px;
}

.progress-ring-bg {
    stroke: rgba(255, 255, 255, 0.2);
}

.progress-ring-fill {
    stroke: var(--primary-color);
    transition: stroke-dashoffset 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(51, 144, 236, 0.5));
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-status {
    color: white;
    font-size: 14px;
    margin-top: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.media-viewer-thumb {
    position: absolute;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: blur(20px);
    transition: opacity 0.3s ease;
}

.media-viewer-full {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    animation: fadeIn 0.3s ease;
}

.media-viewer-video {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Базовое оформление для инлайн кода */
code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.6em;
    background: #f5f5f5;
    color: #333;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    border: 1px solid #e1e1e1;
    white-space: normal;
    width: 100%;
    display: block;
}

/* Для блочного кода */
pre code {
    display: block;
    white-space: pre;
    overflow-x: auto;
    padding: 1em;
    line-height: 1.5;
    tab-size: 4;
    -moz-tab-size: 4;
}

/* Левое меню для кнопки "Плюс" */
.left-menu {
    left: 20px; /* Позиционируем слева */
    right: auto; /* Отменяем позиционирование справа */
}

.left-menu .media-menu-triangle {
    left: 20px; /* Треугольник тоже должен быть слева */
    right: auto;
}


/* ===== СЕКЦИЯ ПАПОК (ГОРИЗОНТАЛЬНАЯ ПОЛОСА) ===== */
.folders-section {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
}

.folders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.folders-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-add-folder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-add-folder:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.folders-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.folders-list::-webkit-scrollbar {
    display: none;
}

/* Элемент папки - горизонтальная плитка */
.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    background: var(--light-secondary);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}

.folder-item:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.folder-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.folder-item.active .folder-name,
.folder-item.active .folder-icon i {
    color: white;
}

/* Иконка папки */
.folder-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.folder-icon i {
    font-size: 12px;
}

/* Название папки */
.folder-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Счетчик чатов */
.folder-badge {
    background: var(--text-secondary);
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 600;
    margin-left: 4px;
}

.folder-item.active .folder-badge {
    background: white;
    color: var(--primary-color);
}

/* Кнопка меню папки */
.folder-menu-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    margin-left: 2px;
    padding: 0;
    opacity: 0.7;
}

.folder-item:hover .folder-menu-btn {
    display: flex;
}

.folder-menu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    opacity: 1;
}

.folder-item.active .folder-menu-btn {
    color: white;
}

.folder-item.active .folder-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Пункт "Все чаты" - особый стиль */
.folder-item.all-chats {
    background: linear-gradient(135deg, var(--primary-color), #6c93ff);
    border: none;
}

.folder-item.all-chats .folder-name,
.folder-item.all-chats .folder-icon i {
    color: white;
}

/* Контекстное меню папки */
.folder-context-menu {
    position: fixed;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 180px;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.folder-context-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
    font-size: 14px;
}

.folder-context-menu .menu-item:hover {
    background: var(--light-secondary);
}

.folder-context-menu .menu-item i {
    width: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.folder-context-menu .menu-item.delete:hover {
    color: var(--danger-color);
}

.folder-context-menu .menu-item.delete:hover i {
    color: var(--danger-color);
}

/* Модальное окно выбора папки */
.folder-select-modal {
    background: var(--surface-color);
    border-radius: 24px;
    width: 90%;
    max-width: 380px;
    max-height: 80vh;
    overflow-y: auto;
}

.folder-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.folder-option:hover {
    background: var(--light-secondary);
}

.folder-option.selected {
    background: var(--light-primary);
    border: 1px solid var(--primary-color);
}

.folder-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 12px;
    font-size: 18px;
}

.folder-option-info {
    flex: 1;
}

.folder-option-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.folder-option-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Фильтр чатов по папке */
.chat-list.filtered .chat-item {
    display: none;
}

.chat-list.filtered .chat-item.show {
    display: flex;
}

.folder-avatar{
    width: 25px;
    height: 25px;
    text-align: center;
    align-content: center;
    border-radius: 5px;
    color: white;
}

/* Стили для модального окна восстановления пароля */
.backup-modal-overlay .modal-container {
    position: relative;
}

.backup-modal-overlay .auth-input:focus {
    outline: none;
    border-color: #3390ec;
    background: white;
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.backup-modal-overlay .auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(51, 144, 236, 0.3);
}
.backup-modal-overlay .auth-btn.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(63, 236, 51, 0.3);
}
.success{
    background: #4caf50;
    color:white;
    padding: 2px 10px;
    border-radius: 10px;
}
.success i{
    color:white !important;
}
.backup-modal-overlay .auth-btn.secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ===== СТИЛИ ДЛЯ ПРЕДПРОСМОТРА ПЕРЕД ОТПРАВКОЙ ===== */

.upload-preview-modal .media-viewer-modal {
    animation: mediaViewerFadeIn 0.3s ease;
}

.upload-preview-container {
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-preview-btn {
    transition: all 0.2s ease;
}

.upload-preview-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.upload-preview-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.upload-preview-btn.send:hover {
    box-shadow: 0 10px 25px rgba(51, 144, 236, 0.3);
}

.upload-preview-btn:active {
    transform: translateY(0);
}

/* Стили для превью изображения */
.upload-preview-image {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* Стили для превью видео */
.upload-preview-video {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Стили для иконки файла */
.upload-preview-file-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    background: linear-gradient(135deg, #3390ec, #6c93ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(51, 144, 236, 0.3);
}

/* Поле для подписи */
#uploadPreviewCaption:focus {
    border-color: #3390ec !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

#uploadPreviewCaption::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .upload-preview-container {
        padding: 10px;
    }

    .upload-preview-file-icon {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    #uploadPreviewCaption {
        font-size: 14px;
        padding: 10px 12px;
    }
}


/* ===== КНОПКА ПРОКРУТКИ ВНИЗ ===== */
.scroll-down-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffffad;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgb(0 0 0 / 46%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.3s ease;
    border: 2px solid white;
}

.scroll-down-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(51, 144, 236, 0.4);
}

.scroll-down-btn:active {
    transform: scale(0.95);
}

.scroll-down-btn .new-messages-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .scroll-down-btn {
        bottom: 80px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Когда открыто меню или поле ввода в фокусе */
.message-input-container:focus-within ~ .scroll-down-btn,
.emoji-menu.active ~ .scroll-down-btn,
.media-menu.active ~ .scroll-down-btn {
    bottom: 120px;
}

/* ===== МОДАЛЬНОЕ ОКНО ПОДДЕРЖКИ ===== */
.support-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.support-modal {
    background: var(--surface-color);
    border-radius: 24px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.support-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.support-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.support-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.support-modal-close:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.support-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.support-form-group {
    margin-bottom: 20px;
}

.support-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.support-form-group .required {
    color: var(--danger-color);
}

.support-form-group input[type="text"],
.support-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.support-form-group input[type="text"]:focus,
.support-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.support-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.support-file-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.support-file-area:hover {
    border-color: var(--primary-color);
    background: var(--light-primary);
}

.support-file-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.support-file-input i {
    font-size: 40px;
    color: var(--primary-color);
}

.support-file-input span {
    font-size: 14px;
}

.support-file-list {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-file-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--light-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.support-file-item i {
    font-size: 14px;
}

.support-file-item .remove-file {
    cursor: pointer;
    color: var(--danger-color);
    margin-left: 4px;
}

.support-file-item .remove-file:hover {
    opacity: 0.7;
}

.support-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.support-device-info {
    background: var(--light-secondary);
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.support-device-info .device-loading {
    color: var(--text-secondary);
}

.support-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.support-btn-cancel,
.support-btn-submit {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.support-btn-cancel {
    background: var(--light-secondary);
    color: var(--text-primary);
}

.support-btn-cancel:hover {
    background: var(--border-color);
}

.support-btn-submit {
    background: linear-gradient(135deg, #3390ec, #6c93ff);
    color: white;
}

.support-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(51, 144, 236, 0.3);
}

.support-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.support-success-message {
    text-align: center;
    padding: 40px;
}

.support-success-message i {
    font-size: 64px;
    color: var(--success-color);
    margin-bottom: 20px;
}

.support-success-message h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.support-success-message p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== МОДАЛЬНОЕ ОКНО ЖАЛОБЫ ===== */
.report-message-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20002;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.report-message-modal {
    background: var(--surface-color);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.report-message-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.report-message-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.report-message-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.report-message-modal-close:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.report-message-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.report-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.report-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.report-reason-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    background: var(--light-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.report-reason-btn:hover {
    background: var(--border-color);
    transform: translateX(4px);
}

.report-reason-btn.selected {
    border-color: var(--primary-color);
    background: var(--light-primary);
    color: var(--primary-color);
}

.report-reason-btn.selected i {
    color: var(--primary-color);
}

.report-reason-btn i {
    width: 24px;
    font-size: 18px;
    color: var(--text-secondary);
}

.report-other-input {
    margin-top: 16px;
    margin-bottom: 20px;
}

.report-other-input textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.report-other-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.report-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.report-btn-cancel,
.report-btn-submit {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.report-btn-cancel {
    background: var(--light-secondary);
    color: var(--text-primary);
}

.report-btn-cancel:hover {
    background: var(--border-color);
}

.report-btn-submit {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
    color: white;
}

.report-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.report-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-btn-confirm {
    background: var(--danger-color);
    color: white;
}
 .modal-btn {
     flex: 1;
     padding: 12px 16px;
     border: none;
     border-radius: 12px;
     font-size: 16px;
     font-weight: 500;
     cursor: pointer;
     transition: all 0.2s;
 }


/* Стили для глобального поиска */
.global-search-header {
    position: sticky;
    top: 0;
    background: var(--surface-color);
    z-index: 0;
}

.search-section-title {
    background: var(--light-secondary);
    margin-top: 8px;
}

.global-search-item {
    transition: background 0.2s;
}

.global-search-item:hover {
    background: var(--light-primary);
}

.join-channel-btn, .start-chat-btn {
    transition: all 0.2s;
}

.join-channel-btn:hover, .start-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.3);
}

.join-channel-btn:active, .start-chat-btn:active {
    transform: scale(0.98);
}

/* Анимация появления результатов */
.global-search-item {
    animation: fadeInUp 0.2s ease forwards;
    opacity: 0;
}

.global-search-item:nth-child(1) { animation-delay: 0.05s; }
.global-search-item:nth-child(2) { animation-delay: 0.1s; }
.global-search-item:nth-child(3) { animation-delay: 0.15s; }
.global-search-item:nth-child(4) { animation-delay: 0.2s; }
.global-search-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для разделителей дат */
.message-date {
    text-align: center;
    margin: 16px 0;
    position: sticky;
    top: 10px;
    z-index: 10;
    transition: all 0.3s ease;
}

.date-separator {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: dateAppear 0.3s ease;
}

@keyframes dateAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Темная тема для разделителей */
@media (prefers-color-scheme: dark) {
    .date-separator {
        background: rgba(0, 0, 0, 0.7);
        color: rgba(255, 255, 255, 0.9);
    }
}

.message-date.highlight {
    animation: datePulse 0.5s ease;
}

@keyframes datePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Глобальный аудиоплеер */
.global-audio-player {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 15;
    animation: slideDown 0.3s ease;
}

.audio-player-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-player-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.audio-player-play:hover {
    transform: scale(1.05);
    background: var(--primary-color-dark, #2980e8);
}

.audio-player-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.audio-player-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.audio-player-info {
    flex: 1;
    min-width: 0;
}

.audio-player-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-player-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-player-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-feature-settings: "tnum";
    min-width: 36px;
}

.audio-player-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--light-secondary);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.audio-player-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-player-progress-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.audio-player-progress-bar:hover .audio-player-progress-handle {
    opacity: 1;
}

.audio-player-speed {
    flex-shrink: 0;
}

.audio-speed-btn {
    padding: 6px 12px;
    border: none;
    background: var(--light-secondary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-speed-btn:hover {
    background: var(--border-color);
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .global-audio-player {
        background: var(--surface-color-dark, #1a1a2e);
    }

    .audio-player-progress-bar {
        background: rgba(255, 255, 255, 0.1);
    }

    .audio-player-progress-handle {
        background: var(--surface-color-dark, #1a1a2e);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация для подсветки сообщения с реакцией */
.message.reaction-highlight {
    animation: reactionPulse 0.5s ease-in-out 3;
    background: rgba(255, 71, 87, 0.1) !important;
    border-radius: 18px;
}

@keyframes reactionPulse {
    0% { transform: scale(1); background: rgba(255, 71, 87, 0); }
    50% { transform: scale(1.02); background: rgba(255, 71, 87, 0.2); }
    100% { transform: scale(1); background: rgba(255, 71, 87, 0); }
}

/* Активная кнопка реакции */
.reaction-badge.active {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.reaction-badge:hover {
    transform: scale(1.05);
    background: var(--light-secondary) !important;
}

/* Контейнер реакций в сообщении */
.message-reactions {
    margin-bottom: 4px;
}

/* Анимация появления реакций */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.chat-reaction-preview {
    margin-left: 6px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(0,0,0,0.05);
    padding: 0px 4px;
    border-radius: 12px;
}

.chat-reaction-preview i {
    font-size: 10px;
    color: var(--text-secondary);
}
/* Стили для блока реакций в message-info */
.message-reactions-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
}

/* Стили для кнопки реакции */
.reaction-badge {
    transition: all 0.2s ease;
}

.reaction-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reaction-badge.active {
    background: var(--light-primary) !important;
    border-color: var(--primary-color) !important;
}

/* Анимация появления новой реакции */
@keyframes reactionAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.reaction-badge {
    animation: reactionAppear 0.2s ease-out;
}


/* Стили для индикатора печатания */
.chat-status-text.typing {
    color: var(--primary-color) !important;
    font-style: italic;
    animation: typingPulse 1.5s infinite;
}

.typing-indicator-text {
    color: var(--primary-color);
    font-style: italic;
    display: inline-block;
    animation: typingPulse 1.5s infinite;
}

.typing-indicator-text::after {
    content: '';
    animation: typingDots 1.5s infinite;
}

@keyframes typingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

@keyframes typingPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Стиль для чата в списке, где кто-то печатает */
.chat-item.typing-chat .last-message {
    color: var(--primary-color) !important;
}

.chat-item.typing-chat {
    background: var(--light-primary) !important;
}

/* Стили для чата "Избранное" */
.chat-item[data-chat-id*="saved_messages"] .avatar-initials {
    background: linear-gradient(135deg, #3390ec, #6c93ff) !important;
}

.chat-item[data-chat-id*="saved_messages"] .chat-title i {
    color: #3390ec;
}



.pull-to-archive {
    transform-origin: top center;
    animation: pullAppear 0.2s ease;
}

@keyframes pullAppear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pull-icon i {
    transition: transform 0.2s ease;
}

.pull-to-archive .pull-arrow i {
    transition: transform 0.1s linear;
}

/* Анимация для списка при потягивании */
.chat-list {
    transition: transform 0.3s ease;
    will-change: transform;
}


/* Кнопка для кружков */
.lock-record{
    position: absolute;
    right: 20px;
    bottom: 55px;
    color: #00000073;
}

.btn-video-message {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    /*margin-right: 8px;*/
    color: white;
}

.btn-video-message:active {
    transform: scale(0.95);
}

.btn-video-message.recording {
    background: linear-gradient(135deg, #ff4757, #ff6b6b);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Превью кружка */
.video-circle-preview {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.video-circle-preview-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
}

.video-circle-preview-content video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 50%;
}

.video-circle-preview-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px;
}

.circle-control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.circle-control-btn.send {
    background: linear-gradient(135deg, #3390ec, #6c93ff);
}

.circle-control-btn:active {
    transform: scale(0.95);
}

/* Таймер записи */
.circle-recording-timer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 8px;
}

.circle-recording-timer .recording-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4757;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* media-upload.css - добавьте в конец style.css */

/* Групповое превью */
.media-group-preview {
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-color);
}

.media-grid {
    display: grid;
    gap: 2px;
    background: #000;
}

.media-grid-1 { grid-template-columns: repeat(1, 1fr); }
.media-grid-2 { grid-template-columns: repeat(2, 1fr); }
.media-grid-3 { }
.media-grid-4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }

.media-grid-3 .media-grid-item:first-child {
    grid-column: span 2;
}

.media-grid-item {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    cursor: pointer;
}

.media-grid-item img,
.media-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-grid-item .video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.media-grid-more {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.upload-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.progress-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-percent {
    color: white;
    font-size: 12px;
    margin-top: 8px;
}

.group-upload-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    font-size: 12px;
}

.cancel-group-upload {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 11px;
    cursor: pointer;
}

.message.sent .group-upload-status {
    background: rgba(255,255,255,0.1);
}

.completed-text {
    color: var(--success-color);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Стили для групповых медиа (галерея) */
.media-group {
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-color);
    max-width: 300px;
}

.media-grid {
    display: grid;
    gap: 2px;
    background: #000;
}

.media-grid-1 {
    grid-template-columns: repeat(1, 1fr);
}

.media-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}



.media-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.media-grid-item {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    cursor: pointer;
}

.media-grid-item img,
.media-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-grid-item:hover img,
.media-grid-item:hover video {
    transform: scale(1.05);
}

.media-grid-item .video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.file-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--light-secondary), var(--border-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-secondary);
}

.media-grid-more {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
}

/* Для темной темы */
@media (prefers-color-scheme: dark) {
    .media-group {
        background: var(--surface-color-dark, #1a1a2e);
    }

    .file-placeholder {
        background: linear-gradient(135deg, #2d2d3a, #1a1a2e);
    }
}

/* Стили для группового статуса загрузки */
.group-upload-status {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin-top: 8px;
}

.group-upload-status .upload-status-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-upload-status .uploading-text {
    font-size: 12px;
    color: var(--primary-color);
}

.group-upload-status .completed-text {
    font-size: 12px;
    color: var(--success-color);
}

.group-upload-status .error-text {
    font-size: 12px;
}

.group-upload-status .cancel-group-upload,
.group-upload-status .retry-group-upload {
    padding: 4px 12px;
    border: none;
    border-radius: 16px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.group-upload-status .cancel-group-upload {
    background: rgba(223, 63, 64, 0.9);
    color: white;
}

.group-upload-status .retry-group-upload {
    background: var(--primary-color);
    color: white;
    margin-top: 4px;
}

.group-upload-status .cancel-group-upload:hover,
.group-upload-status .retry-group-upload:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Стили для группового сообщения */
.media-group-preview .message-text {
    margin-top: 8px;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.message.sent .group-message .message-text {
    color: black;
}


/* Стили для сообщений, состоящих только из эмодзи */
.message-content-media.text-center {
    text-align: center;
    background: transparent !important;
    padding: 12px 16px !important;
}

.message-content-media.text-center .message-text.emoji-only-message {
    display: block;
    text-align: center;
    font-weight: 500;
}

/* Для исходящих сообщений с эмодзи */
.message.sent .message-content-media.text-center {
    background: #fde08d !important;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
}

/* Для входящих сообщений с эмодзи */
.message.received .message-content-media.text-center {
    background: var(--surface-color) !important;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

/* Анимация эмодзи в сообщениях */
.message-text .emoji-char {
    display: inline-block;
    transition: transform 0.2s ease;
}

.message-text .emoji-char:hover {
    transform: scale(1.2);
}

/* Анимация для блока ответа */
.message-reply .emoji-char {
    display: inline-block;
    font-size: 1.1em;
}

/* ===== ЗАКРЕПЛЕННЫЕ СООБЩЕНИЯ ===== */

/* Контейнер закрепленных сообщений */
.pinned-messages-container {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 15;
    position: sticky;
    top: 0;
    animation: slideDown 0.3s ease;
}

.pinned-messages-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 12px;
}

.pinned-messages-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pinned-messages-info > .fa-thumbtack {
    color: var(--primary-color);
    font-size: 14px;
    transform: rotate(-45deg);
}

.pinned-count {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--light-secondary);
    padding: 2px 8px;
    border-radius: 16px;
}

.pinned-count-badge {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 12px;
}

.pinned-count-text {
    font-size: 11px;
    color: var(--text-secondary);
}

.pinned-preview-content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background 0.2s;
}

.pinned-preview-content:hover {
    background: var(--light-secondary);
}

.pinned-preview-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.pinned-preview-text {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-messages-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pinned-messages-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.pinned-messages-actions button:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Модальное окно списка закрепленных */
.pinned-messages-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20005;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.pinned-messages-modal {
    background: var(--surface-color);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.pinned-messages-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.pinned-messages-modal-header h3 {
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pinned-messages-modal-header h3 i {
    color: var(--primary-color);
    transform: rotate(-45deg);
}

.pinned-total-count {
    background: var(--light-secondary);
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 6px;
}

.pinned-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.pinned-modal-close:hover {
    background: var(--border-color);
}

.pinned-messages-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.pinned-messages-list {
    display: flex;
    flex-direction: column;
}

.pinned-message-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.pinned-message-item:hover {
    background: var(--light-secondary);
}

.pinned-message-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--light-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pinned-message-icon i {
    font-size: 18px;
    color: var(--primary-color);
}

.pinned-message-content {
    flex: 1;
    min-width: 0;
}

.pinned-message-sender {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

.pinned-message-sender .sender-name {
    font-weight: 600;
    color: var(--text-primary);
}

.pinned-message-sender .fa-globe,
.pinned-message-sender .fa-user {
    font-size: 10px;
    color: var(--text-secondary);
}

.pinned-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: auto;
}

.pinned-message-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-message-actions {
    flex-shrink: 0;
}

.unpin-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--danger-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.unpin-btn:hover {
    background: var(--danger-color);
    color: white;
}

.pinned-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.pinned-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pinned-empty-state p {
    margin-bottom: 8px;
}

.pinned-empty-state .hint {
    font-size: 12px;
    opacity: 0.7;
}

/* Модальное окно выбора для закрепления */
.pin-options-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20006;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.pin-options-modal {
    background: var(--surface-color);
    border-radius: 24px;
    width: 90%;
    max-width: 350px;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.pin-options-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.pin-options-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pin-options-modal-header h3 i {
    color: var(--primary-color);
    transform: rotate(-45deg);
}

.pin-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.pin-options-modal-content {
    padding: 20px;
}

.pin-options-modal-content > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.pin-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pin-option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.pin-option-btn:hover {
    border-color: var(--primary-color);
    background: var(--light-primary);
    transform: translateY(-2px);
}

.pin-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pin-option-icon i {
    font-size: 24px;
    color: var(--primary-color);
}

.pin-option-info {
    flex: 1;
}

.pin-option-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.pin-option-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Для темной темы */
@media (prefers-color-scheme: dark) {
    .pinned-messages-container {
        background: var(--surface-color-dark, #1a1a2e);
    }

    .pinned-messages-modal {
        background: var(--surface-color-dark, #1a1a2e);
    }
}


@media (min-width: 1024px) {
    .chat-list {
        width: 25%;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
        background: var(--surface-color);
    }
    .header {
        width: 25%;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
        background: var(--surface-color);

    }
    .bottom-tabs{
        width: 25%;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
        background: var(--surface-color);
    }
    .search-container{
        width: 25%;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
        background: var(--surface-color);
    }
    .view{
        width: 75%;
        left: 25%;
    }
    .chat-list-view{
        width: 100%;
        left: 0%;
        background: var(--surface-color);
        background-repeat: no-repeat;
        background-size: cover;
        background-attachment: fixed;
    }
    .chat-messages{
        background-size: cover !important;
    }
    .emoji-menu{
        left: 25%;
        width: 75%;
        height: 500px;
    }
    .emoji-container{
        grid-template-columns: repeat(15, 1fr);
        padding: 28px;
    }
    .emoji-item{
        font-size: 35px;
    }
    .highlighted{
        border: 9px solid #FFEB3B;
    }
    .media-viewer-share{
        position: absolute;
        top: 20px;
        right: 80px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 20001;
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
    }
}


/* Стили для PWA-режима (без адресной строки) */
.pwa-mode .header {
    padding-top: 45px;
    height: 64px;
}

.pwa-mode .media-viewer-close{
    top: 45px;
}
.pwa-mode .media-viewer-download{
    top: 45px;
}
.pwa-mode .media-viewer-share{
    top: 45px;
}
.pwa-mode .media-viewer-counter{
    top: 45px;
}
.pwa-mode .stories-view-item{
    padding-top: 45px;
}
.pwa-mode .contacts-search-container{
    padding-top: 45px;
}
.pwa-mode .settings-view-content{
    padding-top: 45px;
}
.pwa-mode .chat-messages{
    padding-top: 45px;
}


/* Статус-бар iOS — чёрный с прозрачностью */
.status-bar {
    height: 64px;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Безопасная зона для iPhone X и новее */
@supports (padding: max(0px)) {
    .app-container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}


/* Базовые стили */
* {
    box-sizing: border-box;
}

.p-0{
    padding: 0px !important;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-4 {
    flex: 0 0 33.3%;
    max-width: 33.3%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-3 {
    flex: 0 0 25.0%;
    max-width: 25.0%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-2 {
    flex: 0 0 20%;
    max-width: 20%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.lifestyle-box {
    border: 1px solid #00000038;
    width: 100%;
    justify-self: center;
    text-align: left;
    padding: 10px 10px;
    border-radius: 15px;
    box-shadow: 0px 0px 20px 0px #00000038;
    font-size: 12px;
}
@media (min-width: 1024px) {
    .lifestyle-box {
        width: 50%;
    }
}

.lifestyle-box span {
    font-weight: 700;
    line-height: 3;
}
.lifestyle-box p {
    font-weight: 100;
    color: #616161;
}

.lifestyle-box button {
    padding: 0px 5px;
    border-radius: 10px;
    border: unset;
    font-size: 9px;
    margin-top: 5px;
}

.lifestyle-box .fas {
    padding: 10px;
    border-radius: 10px;
}
.lifestyle-box .fa-bank {
    background: #f0e9fd;
    color:#5b2cb1;
}
.lifestyle-box .fa-briefcase {
    background: #ebf3fe;
    color:#1860c4;
}
.lifestyle-box .fa-phone {
    background: #eafae9;
    color:#279346;
}
.lifestyle-box .fa-line-chart {
    background: #fef4e7;
    color:#ed8c32;
}

.email-input-wrapper {
    position: relative;
}
.edit-email-btn {
    transition: all 0.2s ease;
}
.edit-email-btn:hover {
    transform: scale(1.15);
    color: #2980e8 !important;
}
.email-verification-modal .modal-container {
    max-width: 420px;
}
.email-verification-modal .code-input-group {
    margin: 16px 0;
}
.email-verification-modal .code-input {
    text-align: center;
    letter-spacing: 8px;
    font-size: 28px;
    font-weight: 600;
    padding: 12px;
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-color);
    color: var(--text-primary);
}
.email-verification-modal .code-input:focus {
    border-color: var(--primary-color);
    outline: none;
}
.email-verification-modal .resend-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
}
.email-verification-modal .resend-btn:hover {
    text-decoration: underline;
}
.email-verification-modal .verification-status {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    margin-top: 8px;
}
.email-verification-modal .verification-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}
.email-verification-modal .verification-status.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}
.email-verification-modal .verification-status.info {
    background: rgba(51, 144, 236, 0.1);
    color: var(--primary-color);
}
.email-verification-modal .modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.email-verification-modal .timer-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Стили для списков задач */
.message-list-container {
    background: var(--light-secondary);
    border-radius: 12px;
    padding: 4px 4px 4px 12px;
    border-left: 4px solid #4a7fff;
    margin: 4px 0;
}

.message-list-container .list-item-row-chat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.message-list-container .list-item-row-chat:hover {
    background: var(--border-color);
}

.list-item-check-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.list-item-check-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.list-item-check-btn:active {
    transform: scale(0.95);
}

.list-item-checked-by {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    border: 2px solid var(--success-color);
    overflow: hidden;
}

.list-item-checked-by img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Стили для модального окна создания списка */
.list-creator-modal .list-item-row {
    animation: fadeIn 0.2s ease;
}

.list-creator-modal .list-item-input:focus {
    border-color: #4a7fff !important;
    outline: none;
}

.list-creator-modal #listTitleInput:focus {
    border-color: #4a7fff !important;
    outline: none;
}

.list-creator-modal .list-item-remove:hover {
    background: rgba(223, 63, 64, 0.1);
}

.list-creator-modal #addListItemBtn:hover {
    border-color: #4a7fff;
    color: #4a7fff;
}

/* Анимация появления пунктов списка */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Для темной темы */
@media (prefers-color-scheme: dark) {
    .message-list-container {
        background: rgba(255, 255, 255, 0.05);
    }
    .message-list-container .list-item-row-chat:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}


/* Стили для модального окна истории подписок */
#subscriptionHistoryModal .history-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#subscriptionHistoryModal .modal-close-btn:hover {
    background: var(--light-primary);
}

#subscriptionHistoryModal .modal-container {
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Анимации для элементов списка */
#subscriptionHistoryModal .history-item {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

#subscriptionHistoryModal .history-item:nth-child(1) { animation-delay: 0.05s; }
#subscriptionHistoryModal .history-item:nth-child(2) { animation-delay: 0.10s; }
#subscriptionHistoryModal .history-item:nth-child(3) { animation-delay: 0.15s; }
#subscriptionHistoryModal .history-item:nth-child(4) { animation-delay: 0.20s; }
#subscriptionHistoryModal .history-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Разрешаем зум и мультитач внутри галереи */
#galleryMediaContainer,
#galleryMediaContainer * {
    touch-action: pinch-zoom pan-x pan-y !important;
    -webkit-user-select: auto !important;
    user-select: auto !important;
}

#galleryMediaContainer img,
#galleryMediaContainer .media-viewer-image {
    touch-action: pinch-zoom pan-x pan-y !important;
    cursor: zoom-in;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* При активном зуме */
#galleryMediaContainer img.zoomed {
    cursor: zoom-out;
}

/* Модальное окно галереи - разрешаем все жесты */
.media-viewer-modal[data-gallery="true"],
.media-viewer-modal[data-gallery="true"] * {
    touch-action: auto !important;
}

/* Иконка закрепления в списке чатов */
.pinned-icon {
    margin-left: 4px;
    font-size: 12px;
    color: var(--primary-color);
}

/* Чат закреплен - можно добавить фон */
.chat-item.pinned-chat {
    background: rgba(51, 144, 236, 0.05);
    border-left: 3px solid var(--primary-color);
}

/* Анимация дребезжания */
@keyframes zvonok-shake {
    0%   { transform: rotate(0deg)   scale(1); }
    10%  { transform: rotate(-15deg) scale(1.1); }
    20%  { transform: rotate(15deg)  scale(1.1); }
    30%  { transform: rotate(-15deg) scale(1.1); }
    40%  { transform: rotate(15deg)  scale(1.1); }
    50%  { transform: rotate(-10deg) scale(1.05); }
    60%  { transform: rotate(10deg)  scale(1.05); }
    70%  { transform: rotate(-5deg)  scale(1); }
    80%  { transform: rotate(5deg)   scale(1); }
    90%  { transform: rotate(-2deg)  scale(1); }
    100% { transform: rotate(0deg)   scale(1); }
}

.zvonokanim.zvonok-active {
    display: inline-block;              /* чтобы transform работал */
    animation: zvonok-shake 0.6s infinite;
    transform-origin: 50% 0%;           /* качается как подвешенный телефон */
    color: #e74c3c;                     /* красный — «звонит» */
    cursor: pointer;
}

.profile-organization.yes{
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--light-secondary);
    border-radius: 12px;
    margin-bottom: 0px;
    cursor: pointer;
    transition: background 0.2s;
    justify-content: center;
}
.myprofile-organization.yes{
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgb(112 117 121 / 43%);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 1;
    position: relative;
    width: 75%;
    justify-self: anchor-center;
    margin-bottom: 6px;
    margin-top: 6px;
    justify-content: center;
}