/* Стили для страницы живого чата */

.chat-container {
    max-width: 560px; /* Уменьшено на 20% от 700px */
    margin: 0 auto;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px); /* Уменьшено еще больше */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-header {
    display: flex;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.chat-header .agent-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    box-shadow: 0 5px 15px rgba(115, 103, 240, 0.3);
}

.chat-header .agent-avatar i {
    font-size: 20px;
    color: #fff;
}

.chat-header .agent-info h2 {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 4px;
    font-weight: 600;
}

.chat-header .agent-info .agent-status {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.chat-header .agent-info .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--green);
    margin-right: 5px;
    animation: pulse 2s infinite;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 80%;
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.message.agent {
    align-self: flex-start;
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-bottom-left-radius: 0;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #ffffff;
    border-bottom-right-radius: 0;
}

.chat-input {
    display: flex;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
    flex-grow: 1;
    padding: 12px 15px;
    border: none;
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 14px;
    transition: var(--transition);
}

.chat-input input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(115, 103, 240, 0.5);
    background-color: rgba(255, 255, 255, 0.08);
}

.chat-input button {
    margin-left: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(115, 103, 240, 0.3);
}

.chat-input button i {
    margin-right: 5px;
}

/* Custom scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 220px);
        padding: 20px;
        max-width: 90%;
    }

    .chat-input button {
        padding: 12px 15px;
    }

    .chat-input button span {
        display: none;
    }

    .chat-input button i {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .chat-container {
        padding: 15px;
    }

    .chat-header .agent-avatar {
        width: 40px;
        height: 40px;
    }

    .chat-header .agent-avatar i {
        font-size: 20px;
    }

    .chat-header .agent-info h2 {
        font-size: 16px;
    }

    .message {
        max-width: 90%;
        padding: 10px 12px;
    }
}
