/* ============================================
   99 - POPUP AI CHAT
   Style conversationnel avec messages progressifs
   Boutons choix + cards cliquables
   ============================================ */

/* ============================================
   CHAT HEADER
   ============================================ */
.chat-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    display: flex;
    align-items: center;
    gap: 0.75rem;

    background: rgba(255, 255, 255, 0.02);
}

.ai-avatar {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, var(--accent-blue), #26C6DA);
    border-radius: 50%;

    font-weight: 700;
    font-size: 1.1rem;
    color: white;

    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
}

.chat-header span {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============================================
   CHAT MESSAGES CONTAINER
   ============================================ */
.chat-messages-container {
    flex: 1;

    padding: 1.5rem;

    overflow-y: auto;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    gap: 1rem;

    min-height: 300px;
    max-height: 450px;

    scroll-behavior: smooth;
}

/* ============================================
   MESSAGES - Bot & User
   ============================================ */
.bot-message,
.user-message {
    display: flex;
    animation: slideInMessage 0.4s var(--transition-smooth);
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 85%;
    padding: 0.875rem 1.125rem;

    border-radius: 16px;

    font-size: 0.95rem;
    line-height: 1.6;

    word-wrap: break-word;
}

.bot-message .message-content {
    background: rgba(79, 195, 247, 0.12);
    border: 1px solid rgba(79, 195, 247, 0.2);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: rgba(102, 187, 106, 0.15);
    border: 1px solid rgba(102, 187, 106, 0.25);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 5px;

    padding: 0.875rem 1.125rem;

    background: rgba(79, 195, 247, 0.12);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 16px;
    border-bottom-left-radius: 4px;

    width: fit-content;
}

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

.typing-indicator span {
    width: 7px;
    height: 7px;

    background: rgba(79, 195, 247, 0.6);
    border-radius: 50%;

    animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* ============================================
   CHAT INPUT ZONE FIXED (en bas, toujours visible)
   ============================================ */
.chat-input-zone-fixed {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.input-placeholder {
    padding: 0.875rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.chat-textarea-fixed {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-texte, 'Open Sans', sans-serif);
    resize: vertical;
    min-height: 80px;
    margin-bottom: 0.5rem;
}

.chat-textarea-fixed:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(79, 195, 247, 0.4);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.send-btn-full {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.25), rgba(38, 198, 218, 0.25));
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.send-btn-full:hover {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.4), rgba(38, 198, 218, 0.4));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

/* ============================================
   CHOICES IN CHAT (choix dans le fil de conversation)
   ============================================ */
.choices-in-chat {
    margin: 1rem 0;
    padding: 0 0.5rem;
}

/* ============================================
   CHAT INPUT ZONE
   ============================================ */
.chat-input-zone {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);

    display: flex;
    flex-direction: column;
    gap: 0.875rem;

    background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   TEXT INPUT + SEND BUTTON
   ============================================ */
.chat-input-wrapper {
    display: flex;
    gap: 0.625rem;
    align-items: center;
}

.chat-input,
.chat-textarea {
    flex: 1;

    padding: 0.875rem 1rem;

    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;

    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-texte, 'Open Sans', sans-serif);

    transition: all 0.3s ease;
}

.chat-input::placeholder,
.chat-textarea::placeholder {
    color: var(--text-muted);
}

.chat-input:focus,
.chat-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(79, 195, 247, 0.4);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.chat-input.valid {
    border-color: rgba(102, 187, 106, 0.4);
}

.chat-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.send-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, rgba(79, 195, 247, 0.25), rgba(38, 198, 218, 0.25));
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 10px;

    color: var(--text-primary);
    font-size: 1.25rem;

    cursor: pointer;
    transition: all 0.25s ease;
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.4), rgba(38, 198, 218, 0.4));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   CHOICE BUTTONS (Oui/Non)
   ============================================ */
.buttons-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.choice-button {
    flex: 1;
    min-width: 140px;

    padding: 0.875rem 1.5rem;

    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 12px;

    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-texte, 'Open Sans', sans-serif);

    cursor: pointer;
    transition: all 0.3s ease;

    text-align: center;
}

.choice-button:hover {
    background: rgba(79, 195, 247, 0.15);
    border-color: rgba(79, 195, 247, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.2);
}

.choice-button:active {
    transform: translateY(0) scale(0.98);
}

/* ============================================
   CHOICE CARDS COMPACT (Emplacements, Services)
   ============================================ */
.cards-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.choice-card-compact {
    padding: 0.75rem;

    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;

    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);

    text-align: center;

    position: relative;
    overflow: hidden;
}

.choice-card-compact:hover {
    border-color: rgba(79, 195, 247, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 195, 247, 0.2);
}

.choice-card-compact.selected {
    background: rgba(102, 187, 106, 0.15);
    border-color: rgba(102, 187, 106, 0.5);
    transform: scale(0.97);
}

.choice-card-compact.selected::after {
    content: '✓';
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;

    width: 18px;
    height: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--accent-green);
    border-radius: 50%;

    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}

.card-label-compact {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.card-subtitle-compact {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

/* ============================================
   CHOICE BUTTONS COMPACT (Oui/Non)
   ============================================ */
.choice-button-compact {
    flex: 1;
    min-width: 130px;

    padding: 0.75rem 1.25rem;

    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 10px;

    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-texte, 'Open Sans', sans-serif);

    cursor: pointer;
    transition: all 0.3s ease;

    text-align: center;
}

.choice-button-compact:hover {
    background: rgba(79, 195, 247, 0.15);
    border-color: rgba(79, 195, 247, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.2);
}

.choice-button-compact:active {
    transform: translateY(0) scale(0.98);
}

/* ============================================
   CHOICE CARDS (Emplacements, Services)
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.choice-card {
    padding: 1rem;

    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;

    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);

    text-align: center;

    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: linear-gradient(135deg, rgba(79, 195, 247, 0.1), rgba(38, 198, 218, 0.1));

    opacity: 0;
    transition: opacity 0.3s ease;
}

.choice-card:hover::before {
    opacity: 1;
}

.choice-card:hover {
    border-color: rgba(79, 195, 247, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(79, 195, 247, 0.2);
}

.choice-card.selected {
    background: rgba(102, 187, 106, 0.15);
    border-color: rgba(102, 187, 106, 0.5);
    transform: scale(0.95);
}

.choice-card.selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;

    width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--accent-green);
    border-radius: 50%;

    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;

    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.card-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

/* ============================================
   SUMMARY CARD (Résumé final)
   ============================================ */
.summary-card {
    padding: 1.25rem;

    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 12px;

    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;

    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.summary-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

/* ============================================
   CHECKBOX CONTAINER (Politique)
   ============================================ */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;

    padding: 1rem;

    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;

    cursor: pointer;
    accent-color: var(--accent-blue);
}

.checkbox-container label {
    flex: 1;

    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;

    cursor: pointer;
}

.checkbox-container label a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.checkbox-container label a:hover {
    color: #26C6DA;
    text-decoration: underline;
}

/* ============================================
   SUBMIT BUTTON (Final)
   ============================================ */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;

    background: linear-gradient(135deg, var(--accent-green), #4CAF50);
    border: none;
    border-radius: 12px;

    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-texte, 'Open Sans', sans-serif);

    cursor: pointer;
    transition: all 0.3s ease;

    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.3);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 187, 106, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .chat-header {
        padding: 1rem 1.25rem;
    }

    .ai-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .chat-messages-container {
        padding: 1.25rem;
        min-height: 250px;
        max-height: 400px;
    }

    .message-content {
        max-width: 90%;
        font-size: 0.9rem;
    }

    .chat-input-zone {
        padding: 1rem 1.25rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .buttons-container {
        flex-direction: column;
    }

    .choice-button {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .chat-header span {
        font-size: 0.85rem;
    }

    .chat-messages-container {
        padding: 1rem;
    }

    .message-content {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }

    .chat-input,
    .chat-textarea {
        font-size: 0.9rem;
    }

    .card-icon {
        font-size: 1.75rem;
    }

    .card-label {
        font-size: 0.85rem;
    }
}

/* ============================================
   ANIMATIONS SUPPLÉMENTAIRES
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.choice-card:hover {
    animation: shimmer 3s infinite;
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(79, 195, 247, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 1000px 100%;
}