:root { --primary-color: #007bff; }

@font-face {
    font-family: 'lato';
    src: url('./../fonts/Lato-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'poppins';
    src: url('./../fonts/Poppins-Regular.ttf') format('truetype');
}

body { margin: 0; }

.d-none { display: none !important; }

strong { font-weight: bold; }

menu, ol, ul, li {
    display: inline;
    list-style: none;
    margin: 0;
    padding: 0;
}

.andy-position-right #chat-bubble,
.andy-position-right #chatbox {
    right: 20px;
    left: auto;
}

.andy-position-left #chat-bubble,
.andy-position-left #chatbox {
    left: 20px;
    right: auto;
}

.andy-position-right #chat-tooltip.small {
    bottom: 70px;
    right: 70px;
    left: auto;
}

.andy-position-right #chat-tooltip.medium {
    bottom: 80px;
    right: 80px;
    left: auto;
}

.andy-position-right #chat-tooltip.big {
    bottom: 90px;
    right: 90px;
    left: auto;
}

.andy-position-right #chat-tooltip.very-big {
    bottom: 100px;
    right: 100px;
    left: auto;
}

.andy-position-left #chat-tooltip.small {
    bottom: 70px;
    left: 70px; 

    right: auto;
}

.andy-position-left #chat-tooltip.medium {
    bottom: 80px;
    left: 80px;

    right: auto;
}

.andy-position-left #chat-tooltip.big {
    bottom: 90px;
    left: 90px;

    right: auto;
}

.andy-position-left #chat-tooltip.very-big {
    bottom: 100px;
    left: 100px;

    right: auto;
}

.andy-position-right #chat-tooltip { border-bottom-left-radius: 10px; }
.andy-position-left #chat-tooltip { border-bottom-right-radius: 10px; }
.andy-position-left #chat-bubble svg { transform: scaleX(-1); }

/* Bulle de chat */
#chat-bubble {
    position: fixed;
    bottom: 20px;

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

    color: white;
    background-color: var(--primary-color);

    border-radius: 50%;

    font-size: 30px;

    cursor: pointer;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

    z-index: 100000;

    transition: transform .3s ease;
}

#chat-bubble.small {
    width: 50px;
    height: 50px;
}

#chat-bubble.small svg {
    width: 25px;
    height: 25px;
}

#chat-bubble.medium {
    width: 60px;
    height: 60px;
}

#chat-bubble.medium svg {
    width: 30px;
    height: 30px;
}

#chat-bubble.big {
    width: 70px;
    height: 70px;
}

#chat-bubble.big svg {
    width: 35px;
    height: 35px;
}

#chat-bubble.very-big {
    width: 80px;
    height: 80px;
}

#chat-bubble.very-big svg {
    width: 40px;
    height: 40px;
}

#chat-bubble:hover {
    transform: scale(1.1);
}

/* Fenêtre de chat */
#chatbox {
    position: fixed;

    display: none;
    flex-direction: column;

    min-width: 500px;
    height: 600px;

    padding: 10px;

    border-radius: 16px;

    background-color: white;    

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

    z-index: 100000;

    box-sizing: content-box !important;

    overscroll-behavior-y: contain;
}

#chat-bubble.small + #chatbox { bottom: 85px; }
#chat-bubble.medium + #chatbox { bottom: 95px; }
#chat-bubble.big + #chatbox { bottom: 105px; }
#chat-bubble.very-big + #chatbox { bottom: 115px; }

#chat-content {
    display: flex;
    flex-grow: 1;
    flex-direction: column;

    overflow-y: auto;

    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
}

#chat-content::-webkit-scrollbar { width: auto !important; }
#chat-content::-webkit-scrollbar-track { border-radius: initial !important; }

#chat-content::-webkit-scrollbar-thumb { 
    background: initial !important;
    
    border-radius: initial !important;
}
 
.andy-message {
    display: flex;
    align-items: flex-start;

    margin-bottom: 10px;
}

.andy-message:nth-child(1) { margin-top: 10px; }

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

.andy-message p {
    line-height: 1.5;

    font-size: 16px;
    font-family: 'lato', Arial, sans-serif;
    font-style: normal;

    padding: 10px !important;

    border-radius: 8px;

    word-break: break-word;

    margin: 0 !important;
    letter-spacing: normal !important;
}

.andy-message p a {
    color: var(--primary-color);

    text-decoration: underline;
}

.andy-message p a:hover { text-decoration: none; }

.andy-message.user p {
    color: white;
    background-color: var(--primary-color); }

.andy-message.bot p {
    color: rgba(63, 63, 63);
    background-color: #f0f0f0;
}

/* Champ de texte et bouton d'envoi */
#chat-input-container { display: flex; }

#chat-input {
    width: 100%;

    min-height: 28px !important;
    height: 28px !important;

    padding: 10px;

    border: 1px solid #ddd;
    border-radius: 16px;

    outline: none;

    color: rgb(63, 63, 63);
    background-color: unset !important;

    font-size: 14px;
    font-family: Arial, sans-serif !important;

    margin-bottom: 0 !important;
    box-sizing: content-box !important;
    letter-spacing: normal !important;
    line-height: normal !important;
}

#chat-input::placeholder { color: #999 !important; }

#send-button { display: flex; }
#microphone-button { display: none; }

#send-button,
#microphone-button {
    justify-content: center;
    align-items: center;

    min-width: 50px;
    width: 50px;

    height: 50px;

    padding: 0 !important;

    margin-left: 7px;

    color: white;
    background-color: var(--primary-color);

    border: none;
    border-radius: 16px;

    cursor: pointer;
}

#send-button:disabled { background-color: #ccc; }

#chat-input-container svg {
    position: relative;

    top: 1px;
    left: 1px;
}

.no-select {
    -webkit-touch-callout: none; /* Safari */
    -webkit-user-select: none; /* Chrome */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera, and Edge */
}

/* Chat Header Style */
#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: -10px -10px 0 -10px;
    padding: 5px 15px;

    border-radius: 16px 16px 0 0;

    color: white;
    background-color: var(--primary-color);
}

#chat-header-svg-container {
    display: flex;
    align-items: center;
    justify-content: center;

    line-height: 1 !important;
}

#chat-header-svg-container svg { display: inline; }

#chat-header #new-conversation-request-header-button { margin-right: 5px; }

#chat-header #human-request-header-button,
#chat-header #new-conversation-request-header-button {
    cursor: pointer;
}

#chat-header #center-header-div {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

#chat-header #center-header-div a {
    display: flex;
    flex-direction: row;
    align-items: center;

    text-decoration: none;
}

#chat-header h2 {
    color: white;

    margin: 0 !important;
    padding: 0 !important;

    line-height: normal !important;

    font-size: 16px !important;
    font-weight: bold !important;
    font-family: 'poppins', Arial, sans-serif !important;

    text-transform: none !important;

    letter-spacing: normal !important;
}

#close-button {
    margin-top: -2px;
    padding: 0;

    border: none;

    color: white;
    background-color: transparent;

    font-size: 30px;
    font-weight: bold;

    line-height: 20px;

    cursor: pointer;
}

/* Profile picture for bot messages */
.profile-pic {
    width: 40px;
    height: 40px;

    border-radius: 50%;

    margin-right: 6px; /* Space between the picture and the message */

    object-fit: cover; /* Ensures the image is properly cropped to fit the circle */

    cursor: pointer;
}

.dots { display: inline-flex; }

.dot {
  width: 6px;
  height: 6px;

  margin: 0 2px;

  border-radius: 50%;

  background-color: rgba(63, 63, 63, .5);

  animation: andy-bounce 1s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.1s; }
.dot:nth-child(3) { animation-delay: 0.2s; }

@keyframes andy-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
}

#chat-tooltip {
    position: fixed;

    padding: 8px 14px;

    border: 1px solid #e0e0e050;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;

    color: rgb(63, 63, 63, 0.9);
    background-color: #f0f0f0;

    font-family: 'poppins', Arial, sans-serif;
    font-size: 16px;

    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);

    opacity: 0;

    pointer-events: none;

    transition: opacity .5s ease;

    z-index: 99999;
}

#chat-tooltip.visible {
    opacity: 1;

    pointer-events: auto;
}

@media (max-width: 550px), (max-height: 720px) {
    #chatbox {
        top: 0 !important;
        left: 0 !important;

        width: 100% !important;
        min-width: unset;

        height: 100% !important;

        border-radius: 0 !important;

        box-sizing: border-box !important;
    }

    #chat-header {
        border-radius: 0 !important;
    }
}

#human-request-overlay,
#new-conversation-request-overlay {
    position: fixed;
    top: 0;
    left: 0;

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

    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.6);

    z-index: 2000000;
}

#human-request,
#new-conversation-request {
    box-sizing: border-box;

    width: 90%;
    max-width: 650px;

    padding: 2rem;

    border-radius: 16px;

    background-color: #fff;

    text-align: center;

    animation: fadeIn .5s ease;
}

@keyframes fadeIn {
    from {
        transform: translateY(20px);

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

#human-request p,
#new-conversation-request p {
    margin-top: 0;
    margin-bottom: 1rem;
    
    font-size: 16px;
    font-family: 'poppins', Arial, sans-serif;

    color: #4b5563;
}

#human-request #confirm-human-request,
#human-request #cancel-human-request,
#new-conversation-request #confirm-new-conversation-request,
#new-conversation-request #cancel-new-conversation-request {
    width: 100%;

    padding: 0.75rem;

    border: none;
    border-radius: 16px;

    color: white;
    
    font-family: 'poppins', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;

    cursor: pointer;

    transition: background-color .3s ease;
}

#human-request #confirm-human-request,
#new-conversation-request #confirm-new-conversation-request {
    margin-bottom: 10px;

    background-color: var(--primary-color);
}

#human-request #cancel-human-request,
#new-conversation-request #cancel-new-conversation-request {
    color: #333;
    background-color: #e0e0e0;
}

#human-request #confirm-human-request:hover,
#new-conversation-request #confirm-new-conversation-request:hover {
    background-color: var(--primary-color);
}

#human-request #cancel-human-request:hover,
#new-conversation-request #cancel-new-conversation-request:hover {
    background-color: #cfcfcf;
}

.andy-date {
    display: flex;
    justify-content: center;
    align-items: center;

    margin: 10px 0;

    font-size: 14px;
    font-family: 'poppins', Arial, sans-serif;

    color: #999;
}

.andy-hour {
    display: flex;
    justify-content: space-between;

    margin-bottom: -14px;

    font-size: 13px;

    line-height: 35px;
}

.andy-hour span:nth-child(1) { margin-right: 50px; }

.andy-message.bot .andy-hour { color: #666; }
.andy-message.user .andy-hour { color: #eee; }

#FAQs { margin-bottom: 8px; }

#FAQs ul {
    display: flex;
    flex-direction: column;

    margin: 0;
    padding: 0 !important;

    text-align: center;
}

#FAQs ul li {
    padding: 5px 10px;

    color: var(--primary-color);
    background-color: white;

    border: 1px solid var(--primary-color);
    border-radius: 16px;

    font-family: 'poppins', Arial, sans-serif;
    font-size: 16px;

    cursor: pointer;

    transition: all .3s ease;
}

#FAQs ul li:not(:last-child) { margin-bottom: 5px; }

#FAQs ul li:hover {
    background-color: var(--primary-color);
    color: white;
}

.preview-card {
    max-width: 400px;

    margin-bottom: 10px;

    border: 1px solid #ddd;
    border-radius: 12px;

    background-color: #f9f9f9;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

    transition: box-shadow 0.2s ease;
}

.preview-card:hover { box-shadow: 0 3px 9px rgba(0, 0, 0, 0.15); }

.preview-card a { text-decoration: none; }

.preview-card img {
    display: block;

    width: 100%;
    height: 200px;  /* Set a fixed height */

    border-bottom: 1px solid #ddd;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;

    object-fit: contain;  /* Ensures the image covers the area without distorting */
}

.preview-card h4 {
    display: -webkit-box;           /* Allows the text to be truncated */

    line-clamp: 1;

    -webkit-line-clamp: 1;         /* Limits the title to 1 line */
    -webkit-box-orient: vertical;  /* Needed for the clamp to work */

    margin: 10px 12px 4px 12px;

    font-family: 'poppins', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;

    color: #333;

    overflow: hidden;              /* Hides overflow */

    text-overflow: ellipsis;       /* Adds the "..." when the text is too long */
}

.preview-card p {
    margin: 0 12px 0 12px;

    font-family: 'lato', Arial, sans-serif;
    font-size: 14px;

    color: #444;
}

.preview-card-url {
    display: block;

    margin: 6px 12px 12px 12px;

    font-family: 'lato', Arial, sans-serif;
    font-size: 14px;

    color: #999;
}