
/* ===== CHAT WIDGET ===== */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 90px;
    z-index: 9999;
}

.chat-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tech-gradient-3), var(--primary-color));
    color: white;
    border: none;
    padding: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 180, 219, 0.4);
    transition: all 0.3s ease;
}

.chat-button-text {
    display: none;
}

.chat-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 180, 219, 0.5);
}

.chat-button.active {
    display: none;
}

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

.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff5733;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse-badge 2s infinite;
    display: none;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 120px);
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chat-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    background: linear-gradient(135deg, var(--tech-gradient-1), var(--tech-gradient-2));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    padding: 5px;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--tech-gradient-1);
}

.status-indicator.online {
    background: #4CAF50;
}

.chat-info h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-status {
    margin: 5px 0 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

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

.bot-message {
    flex-direction: row;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    padding: 5px;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.bot-message .message-content {
    align-items: flex-start;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 80%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--tech-gradient-3), var(--primary-color));
    color: white;
}

.message-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.chat-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: var(--tech-gradient-3);
    box-shadow: 0 0 0 3px rgba(0, 180, 219, 0.1);
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--tech-gradient-3), var(--primary-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 180, 219, 0.4);
}

.chat-send-btn i {
    font-size: 16px;
}

.chat-footer-text {
    text-align: center;
    color: #999;
}

/* Scrollbar personnalisé pour les messages */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget {
        right: 80px;
    }
    
    .chat-box {
        width: calc(100% - 30px);
        max-height: calc(100vh - 140px);
        height: auto;
        bottom: 80px;
        right: 15px;
        left: 15px;
        border-radius: 15px;
    }
}

@media (max-width: 480px) {
    .chat-box {
        width: calc(100% - 20px);
        max-height: calc(100vh - 120px);
        bottom: 70px;
        right: 10px;
        left: 10px;
    }
}

/* ===== DARK MODE FOR CHAT WIDGET ===== */
body.dark-mode .chat-box {
    background: #141925;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(0, 180, 219, 0.2);
}

body.dark-mode .chat-header {
    background: linear-gradient(135deg, #0f1823, #1a2942);
    border-bottom: 1px solid rgba(0, 180, 219, 0.2);
}

body.dark-mode .chat-avatar {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 180, 219, 0.3);
}

body.dark-mode .status-indicator.online {
    box-shadow: 0 0 10px #4CAF50;
}

body.dark-mode .chat-messages {
    background: #0a0e1a;
}

body.dark-mode .message-bubble {
    background: #1a1f2e;
    color: #e4e8f0;
    border: 1px solid rgba(0, 180, 219, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .user-message .message-bubble {
    background: linear-gradient(135deg, #00B4DB, #2f55d4);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 180, 219, 0.4);
}

body.dark-mode .message-time {
    color: #7d8599;
}

body.dark-mode .chat-input-area {
    background: #141925;
    border-top: 1px solid rgba(0, 180, 219, 0.2);
}

body.dark-mode .chat-input {
    background: #0a0e1a;
    color: #e4e8f0;
    border-color: rgba(0, 180, 219, 0.2);
}

body.dark-mode .chat-input:focus {
    background: #141925;
    border-color: #00B4DB;
    box-shadow: 0 0 0 3px rgba(0, 180, 219, 0.2);
}

body.dark-mode .chat-input::placeholder {
    color: #7d8599;
}

body.dark-mode .chat-send-btn {
    box-shadow: 0 4px 15px rgba(0, 180, 219, 0.4);
}

body.dark-mode .chat-send-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 180, 219, 0.6);
}

body.dark-mode .chat-footer-text small {
    color: #7d8599;
}

body.dark-mode .chat-button {
    box-shadow: 0 10px 30px rgba(0, 180, 219, 0.5);
}

body.dark-mode .chat-button:hover {
    box-shadow: 0 15px 40px rgba(0, 180, 219, 0.7),
                0 0 30px rgba(0, 180, 219, 0.3);
}


