/* ============================
   CHAT — MESSAGES
   ============================ */
#livre-chat-messages{
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
    font-size: 14px;
}
.livre-msg{ margin-bottom: 10px; white-space: pre-wrap; }
.livre-msg.user{ text-align: right; color: #0073b1; font-weight: bold; }
.livre-msg.bot{ text-align: left; color: #000; }

/* ============================
   CHAT — LOADER
   ============================ */
.loader-wrapper{
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    white-space: pre-wrap;
    color: #000;
}
.book-loader{
    display: inline-block;
    font-size: 32px;
    line-height: 32px;
    margin-top: 4px;
    animation: bookFlip 0.7s infinite ease-in-out;
    transform-origin: center center;
}
@keyframes bookFlip{
    0%   { transform: rotateY(0deg) scale(1);    opacity: 1; }
    25%  { transform: rotateY(45deg) scale(1.05); opacity: 0.9; }
    50%  { transform: rotateY(90deg) scale(1.12); opacity: 0.7; }
    75%  { transform: rotateY(45deg) scale(1.05); opacity: 0.9; }
    100% { transform: rotateY(0deg) scale(1);    opacity: 1; }
}

/* ============================
   CHAT — TRANSITIONS
   ============================ */
.page-turn{
    animation: pageTurn 0.6s ease-in-out forwards;
    transform-origin: left center;
}
@keyframes pageTurn{
    0%   { transform: perspective(600px) rotateY(0deg);   opacity: 1; }
    50%  { transform: perspective(600px) rotateY(-70deg); opacity: 0.4; }
    100% { transform: perspective(600px) rotateY(-90deg); opacity: 0; }
}

.page-slide-in{
    animation: slideFlip 0.6s ease forwards;
    transform-origin: left center;
}
@keyframes slideFlip{
    0%   { transform: translateX(100%) rotateY(60deg); opacity: 0; }
    50%  { transform: translateX(20%)  rotateY(20deg); opacity: 0.6; }
    100% { transform: translateX(0)    rotateY(0);     opacity: 1; }
}

/* ============================
   CHAT — INPUT / CLARIFY
   ============================ */
#livre-chat-clarify-zone{
    border-top: 1px dashed #ccc;
    padding: 8px;
    font-size: 13px;
    background: #fff8e1;
    display: none;
}

#livre-chat-input-area{
    display: flex;
    padding: 8px;
    border-top: 2px solid #0073b1;
    background: #fff;
}
#livre-chat-input{
    flex: 1;
    font-size: 14px;
    padding: 5px;
    border: 2px solid #0073b1;
    border-radius: 6px;
}
#livre-chat-send{
    padding: 5px 12px;
    margin-left: 6px;
    font-size: 14px;
    background: #0073b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ==========================================
   CHAT — COLONNE DROITE (Historique / Glossaire)
   ========================================== */

#livre-side-col{
    width: 280px;
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#livre-side-col{
    margin-left: 25px;
}

.livre-side-header{
    background:#0073b1;
    color:#fff;
    padding:6px 8px;
    border-top-left-radius:6px;
    border-top-right-radius:6px;
    font-weight:bold;
    font-size:12px;
}

.livre-side-panel{
    background: rgba(255,255,255,0.97);
    border:1px solid #ccc;
    border-radius:6px;
    font-size:12px;
    overflow-y: auto;
    box-shadow: 8px 12px 18px rgba(0,0,0,0.35);
    max-height: 40vh;
    padding: 10px 12px;
}

/* Espacement des questions historiques */
#livre-chat-historique-content br{
    line-height: 4px;
}

/* Responsive : colonne droite sous le chat */
@media (max-width: 900px){
    #livre-side-col{ width: 100%; flex: 1 1 auto; }
    .livre-side-panel{ max-height: none; }
}

/* ============================
   MEMO — BOUTONS Enregistrer / Impression
   ============================ */
.save-print-inline{
    display: flex;                 /* sur une ligne */
    justify-content: flex-end;     /* calé à droite */
    gap: 10px;                     /* espace entre boutons */
    margin-top: 10px;
}

.livre-btn-action{
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    background: #0073b1;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

.livre-btn-action:hover{
    opacity: 0.85;
}
/* =========================================================
   FENÊTRE LATERALE IA-BOOK (recréation)
   ========================================================= */

#infoPanel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 42%;
    max-width: 520px;
    height: 100vh;

    background: #ffffff;
    box-shadow: -4px 0 12px rgba(0,0,0,0.25);

    z-index: 9999;
    transition: right 0.35s ease;
    overflow-y: auto;
}

/* En-tête */
#infoPanelHeader {
    position: sticky;
    top: 0;
    background: #0073b1;
    color: #fff;
    padding: 12px 16px;
    font-weight: bold;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Titre */
#infoPanelTitle {
    font-size: 16px;
}

/* Bouton fermeture */
#infoPanelClose {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

/* Contenu */
#infoPanelContent {
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
}
