/* Mini Chat CSS avec Avatars - views/css/minichat.css */

/* Chat Launcher Button */
#minichat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #d341a2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9998;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#minichat-launcher:hover {
    transform: scale(1.1);
}

.minichat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
}

/* Chat Widget */
#minichat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.minichat-header {
    background: linear-gradient(135deg, #667eea 0%, #d341a2 100%);
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.minichat-title {
    font-weight: 600;
    font-size: 16px;
}

.minichat-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.3s;
}

.minichat-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.minichat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.minichat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

/* Message avec Avatar */
.minichat-message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s;
    align-items: flex-start;
}

.minichat-message.own {
    flex-direction: row-reverse;
}

/* Avatar */
.minichat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 0 10px;
}

.minichat-message.own .minichat-avatar {
    margin-left: 10px;
    margin-right: 0;
}

/* Message Content */
.minichat-message-content {
    max-width: 65%;
    display: flex;
    flex-direction: column;
}

.minichat-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
}

.minichat-message.own .minichat-message-header {
    justify-content: flex-end;
}

.minichat-customer-name {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}

.minichat-customer-id {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    color: #6c757d;
    font-weight: 500;
}

.minichat-message-time {
    margin-left: 8px;
    color: #999;
    font-size: 10px;
}

.minichat-message.own .minichat-message-time {
    margin-left: 0;
    margin-right: 8px;
}

.minichat-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.minichat-message.own .minichat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #d341a2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.minichat-message.other .minichat-bubble {
    background: white;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Input Area */
.minichat-input-wrapper {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

#chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.minichat-send {
    margin-left: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #d341a2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.minichat-send:hover {
    transform: scale(1.05);
}

.minichat-send:active {
    transform: scale(0.95);
}

.minichat-char-counter {
    padding: 0 15px 10px;
    font-size: 11px;
    color: #999;
    text-align: right;
    background: white;
    border-radius: 0 0 12px 12px;
}

.minichat-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.minichat-notice {
    padding: 40px 20px;
    text-align: center;
}

.minichat-notice p {
    margin-bottom: 20px;
    color: #666;
}

/* Typing Indicator */
.minichat-typing {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.minichat-typing-dots {
    display: inline-flex;
    margin-left: 5px;
}

.minichat-typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.minichat-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.minichat-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Online Status */
.minichat-online-status {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    right: 2px;
    border: 2px solid white;
}

.minichat-online-status.offline {
    background: #9e9e9e;
}

/* Responsive */
@media (max-width: 480px) {
    #minichat-widget {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 80px;
        height: 70vh;
    }
    
    .minichat-message-content {
        max-width: 75%;
    }
}

/* Scrollbar */
.minichat-messages::-webkit-scrollbar {
    width: 6px;
}

.minichat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.minichat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.minichat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}