/**
 * Chatbot Claude AI - Styles modernes
 * DJ Prestige Sound
 */

:root {
    --chat-primary: #D4AF37;
    --chat-primary-dark: #B8941F;
    --chat-secondary: #1a1a1a;
    --chat-bg: #ffffff;
    --chat-message-user: linear-gradient(135deg, #D4AF37 0%, #F4E4BC 100%);
    --chat-message-assistant: #f7f7f7;
    --chat-text: #333333;
    --chat-text-light: #666666;
    --chat-border: #e0e0e0;
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --chat-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --chat-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container principal */
.claude-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Bouton flottant */
.claude-chat-bubble {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-message-user);
    border: none;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    transition: var(--chat-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chat-secondary);
}

.claude-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(212, 175, 55, 0.4);
}

.claude-chat-bubble svg {
    width: 28px;
    height: 28px;
    transition: var(--chat-transition);
}

.claude-chat-bubble .close-icon {
    display: none;
    position: absolute;
}

.claude-chat-bubble.active .bubble-icon {
    display: none;
}

.claude-chat-bubble.active .close-icon {
    display: block;
}

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

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

/* Fenêtre du chat */
.claude-chat-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: var(--chat-bg);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: var(--chat-transition);
}

.claude-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header du chat */
.claude-chat-header {
    padding: 20px;
    background: var(--chat-message-user);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--chat-secondary);
}

.claude-chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--chat-shadow-sm);
}

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

.claude-chat-info {
    flex: 1;
}

.claude-chat-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.claude-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--chat-secondary);
    opacity: 0.8;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.claude-chat-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chat-transition);
}

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

.claude-chat-close svg {
    width: 18px;
    height: 18px;
    color: var(--chat-secondary);
}

/* Zone des messages */
.claude-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.claude-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* Messages */
.claude-message {
    display: flex;
    gap: 10px;
    animation: fadeInUp 0.3s ease-out;
}

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

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

.claude-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-border);
    overflow: hidden;
}

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

.claude-message-avatar svg {
    width: 18px;
    height: 18px;
    color: var(--chat-text-light);
}

.claude-message.user .claude-message-avatar {
    background: var(--chat-primary);
    color: white;
}

.claude-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--chat-text);
    word-wrap: break-word;
}

.claude-message.assistant .claude-message-bubble {
    background: var(--chat-message-assistant);
    border-bottom-left-radius: 4px;
}

.claude-message.user .claude-message-bubble {
    background: var(--chat-message-user);
    color: var(--chat-secondary);
    border-bottom-right-radius: 4px;
}

.claude-message.error .claude-message-bubble {
    background: #fee;
    border: 1px solid #fcc;
}

.claude-message-bubble strong {
    font-weight: 600;
}

.claude-message-bubble a {
    color: var(--chat-primary-dark);
    text-decoration: underline;
}

/* Suggestions */
.claude-chat-suggestions {
    padding: 0 20px 10px;
    display: none;
    gap: 8px;
    flex-wrap: wrap;
}

.claude-suggestion-btn {
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--chat-text);
    cursor: pointer;
    transition: var(--chat-transition);
    white-space: nowrap;
}

.claude-suggestion-btn:hover {
    background: var(--chat-primary);
    color: var(--chat-secondary);
    border-color: var(--chat-primary);
    transform: translateY(-2px);
    box-shadow: var(--chat-shadow-sm);
}

/* Indicateur de frappe */
.claude-typing-indicator {
    padding: 10px 20px;
    display: none;
    gap: 5px;
}

.claude-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chat-text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

.claude-typing-indicator 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;
    }
}

/* Zone d'input */
.claude-chat-input-container {
    padding: 15px 20px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-bg);
    border-radius: 0 0 20px 20px;
}

.claude-chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#claude-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--chat-border);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: var(--chat-transition);
    background: #fafafa;
    color: var(--chat-text);
}

#claude-chat-input::placeholder {
    color: var(--chat-text-light);
    opacity: 0.6;
}

#claude-chat-input:focus {
    border-color: var(--chat-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.claude-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--chat-message-user);
    color: var(--chat-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chat-transition);
    flex-shrink: 0;
}

.claude-send-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--chat-shadow-sm);
}

.claude-send-btn:active {
    transform: scale(0.95);
}

.claude-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Bouton reconnaissance vocale */
.claude-voice-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #6c757d;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-right: 8px;
}

.claude-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background: #5a6268;
}

.claude-voice-btn:active {
    transform: scale(0.95);
}

.claude-voice-btn svg {
    width: 20px;
    height: 20px;
}

/* Animation pendant l'écoute */
.claude-voice-btn.listening {
    background: #dc3545;
    animation: voice-pulse 1.5s infinite;
}

@keyframes voice-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

.claude-powered-by {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: var(--chat-text-light);
}

.claude-powered-by strong {
    color: var(--chat-primary-dark);
}

.claude-logo {
    font-size: 13px;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .claude-chatbot {
        bottom: 15px;
        right: 15px;
    }

    .claude-chat-bubble {
        width: 56px;
        height: 56px;
    }

    .claude-chat-bubble svg {
        width: 24px;
        height: 24px;
    }

    .claude-chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
        border-radius: 20px 20px 0 0;
    }

    .claude-chat-window.active {
        bottom: 0;
    }

    .claude-chat-header {
        border-radius: 20px 20px 0 0;
    }

    .claude-chat-messages {
        padding: 15px;
    }

    .claude-message-bubble {
        max-width: 80%;
        font-size: 15px;
    }

    .claude-chat-input-container {
        padding: 12px 15px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    #claude-chat-input {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --chat-bg: #1e1e1e;
        --chat-message-assistant: #2a2a2a;
        --chat-text: #e0e0e0;
        --chat-text-light: #a0a0a0;
        --chat-border: #3a3a3a;
    }

    #claude-chat-input {
        background: #2a2a2a;
        color: #e0e0e0;
    }

    #claude-chat-input:focus {
        background: #333;
    }

    .claude-suggestion-btn {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #e0e0e0;
    }
}

/* ===============================================
   BOUTONS D'ACTION DANS LES RÉPONSES
   =============================================== */

/* Boutons d'action stylisés (liens vers pages du site) */
.chatbot-action-button {
    display: inline-block;
    margin: 8px 4px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-dark));
    color: #fff !important;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    border: none;
    cursor: pointer;
}

.chatbot-action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, var(--chat-primary-dark), var(--chat-primary));
    text-decoration: none;
}

.chatbot-action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

/* Liens normaux dans les réponses */
.chatbot-link {
    color: var(--chat-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--chat-primary);
    transition: all 0.2s ease;
}

.chatbot-link:hover {
    color: var(--chat-primary-dark);
    border-bottom-color: var(--chat-primary-dark);
}

/* Animation d'apparition des boutons */
@keyframes slideInButton {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-action-button,
.chatbot-link {
    animation: slideInButton 0.4s ease forwards;
}

/* Responsiveness pour mobile */
@media (max-width: 480px) {
    .chatbot-action-button {
        display: block;
        width: 100%;
        margin: 6px 0;
        text-align: center;
    }
}

/* ===============================================
   📧 FORMULAIRE DE CAPTURE DE LEADS
   =============================================== */

.claude-lead-form {
    max-width: 90%;
    background: white;
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    padding: 15px;
    margin: 5px 0;
    box-shadow: var(--chat-shadow-sm);
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-form input,
.lead-form select {
    padding: 10px 12px;
    border: 1px solid var(--chat-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--chat-transition);
    background: #fafafa;
}

.lead-form input:focus,
.lead-form select:focus {
    outline: none;
    border-color: var(--chat-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.lead-form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.lead-submit-btn,
.lead-skip-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--chat-transition);
}

.lead-submit-btn {
    background: var(--chat-message-user);
    color: var(--chat-secondary);
}

.lead-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.lead-skip-btn {
    background: white;
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
}

.lead-skip-btn:hover {
    background: #f5f5f5;
}

.lead-form-buttons button:active {
    transform: translateY(0);
}

/* Animation d'apparition du formulaire */
.claude-lead-form {
    animation: slideInForm 0.4s ease-out;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .claude-lead-form {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }

    .lead-form input,
    .lead-form select {
        background: #1e1e1e;
        color: #e0e0e0;
        border-color: #3a3a3a;
    }

    .lead-skip-btn {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #e0e0e0;
    }

    .lead-skip-btn:hover {
        background: #333;
    }

    /* Labels des services - surcharger le style inline */
    #quick-contact-form label,
    #claude-lead-form label {
        color: #e0e0e0 !important;
    }

    /* Background des checkboxes services en dark mode */
    #quick-contact-form div[style*="background: rgba(0,0,0,0.05)"] {
        background: rgba(255,255,255,0.05) !important;
    }
}

/* Mode light - forcer les labels sombres pour le formulaire de lead */
@media (prefers-color-scheme: light) {
    #claude-lead-form label {
        color: #333333 !important;
    }

    .lead-services-checkboxes label {
        color: #333333 !important;
    }
}
