/* chat.css - Styling for TPM Logistics Live Chat */

.tpm-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tpm-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0A1A2F;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.tpm-chat-button i {
    font-size: 24px;
}

.tpm-chat-button-text {
    display: none;
    margin-left: 10px;
    white-space: nowrap;
}

.tpm-chat-button:hover {
    width: 150px;
    border-radius: 30px;
}

.tpm-chat-button:hover .tpm-chat-button-text {
    display: inline;
}

.tpm-chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
    opacity: 0;
}

.tpm-chat-widget.open .tpm-chat-container {
    transform: scale(1);
    opacity: 1;
}

.tpm-chat-widget.minimized .tpm-chat-container {
    transform: scale(1) translateY(370px);
}

.tpm-chat-header {
    background-color: #0A1A2F;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tpm-chat-agent-info {
    display: flex;
    flex-direction: column;
}

.tpm-chat-agent-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-bottom: 5px;
}

.tpm-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.tpm-status-indicator.online {
    background-color: #2ecc71;
}

.tpm-status-indicator.offline {
    background-color: #e74c3c;
}

.tpm-chat-title {
    font-weight: bold;
}

.tpm-chat-controls {
    display: flex;
}

.tpm-chat-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.tpm-chat-controls button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tpm-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f5f7f9;
    position: relative;
}

.tpm-chat-messages {
    display: flex;
    flex-direction: column;
}

.tpm-chat-message {
    margin-bottom: 15px;
    max-width: 80%;
    position: relative;
}

.agent-message {
    align-self: flex-start;
    display: flex;
}

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

.system-message {
    align-self: center;
    max-width: 90%;
    text-align: center;
    background-color: rgba(10, 26, 47, 0.1);
    border-radius: 15px;
    padding: 8px 15px;
    font-size: 12px;
    color: #555;
}

.tpm-agent-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0A1A2F;
    color: white;
    font-size: 18px;
}

.tpm-message-content {
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
}

.agent-message .tpm-message-content {
    background-color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-message .tpm-message-content {
    background-color: #0A1A2F;
    color: white;
}

.tpm-message-sender {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #0A1A2F;
}

.tpm-message-content p {
    margin: 0;
    word-wrap: break-word;
}

.tpm-message-time {
    font-size: 10px;
    opacity: 0.7;
    display: block;
    margin-top: 5px;
    text-align: right;
}

.tpm-chat-typing-indicator {
    display: none;
    padding: 10px 15px;
    background-color: white;
    border-radius: 15px;
    align-self: flex-start;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tpm-chat-typing-indicator.active {
    display: flex;
}

.tpm-chat-typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 1px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out both;
}

.tpm-chat-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.tpm-chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.tpm-chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% {
        transform: translateY(0);
    }
    60% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

.tpm-chat-footer {
    padding: 10px 15px;
    border-top: 1px solid #e6e6e6;
    background-color: white;
}

#tpm-chat-form {
    display: flex;
    align-items: center;
}

#tpm-chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 14px;
}

#tpm-chat-send {
    background: none;
    border: none;
    color: #0A1A2F;
    cursor: pointer;
    font-size: 20px;
    padding: 0 5px;
}

#tpm-chat-send:hover {
    color: #152b47;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .tpm-chat-container {
        width: 300px;
        height: 400px;
        bottom: 70px;
    }
    
    .tpm-chat-button {
        width: 50px;
        height: 50px;
    }
    
    .tpm-chat-button:hover {
        width: 50px;
        border-radius: 50%;
    }
    
    .tpm-chat-button:hover .tpm-chat-button-text {
        display: none;
    }
    
    .tpm-chat-widget.minimized .tpm-chat-container {
        transform: scale(1) translateY(320px);
    }
}
