/* ===== СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА ДРУЗЕЙ ===== */
.friends-modal-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.friends-modal-button {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #FF4444;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,68,68,0.3);
    transition: all 0.2s;
}

.friends-modal-button:hover {
    transform: scale(1.1);
    background: #FF5555;
}

.friends-modal-content {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background: #1a1a1c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

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

.modal-header {
    padding: 16px;
    background: linear-gradient(to right, rgba(128,0,255,0.1), rgba(255,0,128,0.1));
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-header h3 svg { color: #FF4444; }
.modal-header h3 span { color: rgba(255,255,255,0.4); font-size: 14px; margin-left: auto; }

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover { color: white; background: rgba(255,255,255,0.1); }

.modal-search {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.modal-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.modal-search input:focus { border-color: #FF4444; }

.modal-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.3);
    pointer-events: none;
}

.modal-friends-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.modal-friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-friend-item:hover { background: rgba(255,255,255,0.05); }

.modal-friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

.modal-friend-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-friend-name:hover { color: #FF4444; }

.modal-friend-status {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    margin-top: 2px;
}

.modal-friend-message {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-friend-message:hover {
    color: #FF4444;
    background: rgba(255,68,68,0.1);
}

.modal-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    text-align: center;
}

.modal-footer a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
}

.modal-footer a:hover { color: white; }

.modal-loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.4);
}

.modal-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.modal-empty-state svg {
    width: 48px;
    height: 48px;
    color: rgba(255,255,255,0.1);
    margin-bottom: 12px;
}

.modal-empty-state p {
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-empty-state a {
    display: inline-block;
    padding: 8px 16px;
    background: #FF4444;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-empty-state a:hover { background: #FF5555; }

/* ===== СТИЛИ ДЛЯ ЧАТА ===== */
.chat-modal {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9999;
}

.chat-modal.hidden { display: none; }

.chat-modal-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 340px;
    background: #1a1a1c;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(to right, #1A1A1C, #1f1f22);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    cursor: pointer;
}

.chat-avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.chat-avatar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
}

.chat-online-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #1A1A1C;
}

.chat-online-indicator.online { background: #4CAF50; }
.chat-online-indicator.offline { background: #9CA3AF; }

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

.chat-user-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-user-status {
    font-size: 12px;
    margin: 0;
}

.chat-header-buttons {
    display: flex;
    gap: 4px;
}

.chat-header-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.chat-header-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.chat-messages-container {
    background: #0D0D0F;
    max-height: 350px;
    overflow-y: auto;
}

.chat-messages {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-loading {
    text-align: center;
    color: rgba(255,255,255,0.3);
    padding: 32px 0;
    font-size: 14px;
}

.chat-message {
    display: flex;
    margin-bottom: 4px;
}

.chat-message-own { justify-content: flex-end; }
.chat-message-other { justify-content: flex-start; }

.chat-message-content {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message-own .chat-message-content {
    background: #ff4444c7;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-other .chat-message-content {
    background: rgba(255,255,255,0.1);
    color: white;
    border-bottom-left-radius: 4px;
}

.chat-message-time {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
    text-align: right;
}

.chat-input-container {
    border-top: 1px solid rgba(255,255,255,0.1);
    background: #131315;
    position: relative;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
}

.chat-input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    outline: none;
}

.chat-input:focus { border-color: #FF4444; }

.chat-sticker-btn, .chat-send-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.chat-sticker-btn:hover {
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05);
}

.chat-send-btn {
    background: #FF4444;
    color: white;
}

.chat-send-btn:hover { background: #FF5555; }
.chat-send-btn:disabled {
    background: rgba(255,255,255,0.1);
    cursor: not-allowed;
}

/* Стикеры */
.stickers-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #1a1a1c;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 12px;
    animation: slideUp 0.2s ease-out;
}

.stickers-panel.hidden { display: none; }

.stickers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: white;
    font-size: 14px;
}

.stickers-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
}

.stickers-close:hover { color: white; }

.stickers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.sticker-item {
    aspect-ratio: 1;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.sticker-item:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.1);
}

.sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Стили для стикеров в чате */
.chat-sticker {
    max-width: 24px;
    max-height: 24px;
    border-radius: 8px;
    object-fit: contain;
    display: inline-block;
    background-color: #00000000;
}

.chat-message-content img.chat-sticker {
    animation: stickerPop 0.3s ease-out;
}

@keyframes stickerPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Минимизированное состояние */
.chat-modal.minimized .chat-messages-container,
.chat-modal.minimized .chat-input-container {
    display: none;
}
.chat-modal.minimized .minimize-icon { transform: rotate(180deg); }

/* Кастомный скроллбар */
.custom-scrollbar::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.modal-friends-list::-webkit-scrollbar,
.stickers-grid::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.modal-friends-list::-webkit-scrollbar-track,
.stickers-grid::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.modal-friends-list::-webkit-scrollbar-thumb,
.stickers-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.modal-friends-list::-webkit-scrollbar-thumb:hover,
.stickers-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}