/**
 * Design de l'interface de l'Agent IA Glameeto
 * Emplacement : wp-content/themes/votre-theme/assets/css/ai-agent.css
 */

#glameeto-ai-page-container {
    width: 100%;
    max-width: 850px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    height: 650px;
    border: 1px solid #eaeaea;
    overflow: hidden;
}

#ai-chat-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background-color: #fbfbfb;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-msg-row {
    display: flex;
    gap: 14px;
    max-width: 80%;
}

.ai-msg-row.robot {
    align-self: flex-start;
}

.ai-msg-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}

.ai-msg-content {
    display: flex;
    flex-direction: column;
}

.ai-pseudo {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-msg-row.user .ai-pseudo {
    text-align: right;
}

.ai-text {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.5;
}

.ai-msg-row.robot .ai-text {
    background: #f0f0f2;
    color: #2c2c2c;
    border-top-left-radius: 0;
}

.ai-msg-row.user .ai-text {
    background: #000000;
    color: #ffffff;
    border-top-right-radius: 0;
}

#ai-chat-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
}

.ai-avatar-footer {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

#ai-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    padding: 12px 20px;
    border-radius: 30px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

#ai-chat-input:focus {
    border-color: #111111;
}

#ai-chat-footer button {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    transition: background 0.2s, transform 0.1s;
}

#ai-chat-footer button:hover {
    background: #1a1a1a;
}

#ai-chat-footer button:active {
    transform: scale(0.98);
}

.ai-loading {
    font-style: italic;
    color: #777;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Conteneur principal */
.glameeto-ai-section {
    position: relative;
    width: 100%;
    min-height: 100vh; /* Ajuste la hauteur ici */
    overflow: hidden;
}

/* Le fond (copie de la logique agenda) */
.ai-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* L'aplat noir animé */
.ai-overlay {
    position: relative;
    z-index: 1;
    width: 400px; /* Largeur fixe */
    margin-left: 10%; /* Décalé à gauche */
    background: rgba(0, 0, 0, 1);
    padding: 40px;
    color: #fff;
    animation: slideInLeft 1s ease-out forwards;
}

@keyframes slideInLeft {
    0% { transform: translateX(-100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Le chat avec l'ombre (par-dessus) */
.chat-container-shadow {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 850px;
    margin: 50px auto 0 auto; /* Espace sous l'aplat */
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); /* Ombre portée forte */
    height: 580px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media screen and (max-width: 576px) {
    .ai-overlay {
        width: 90%;
        margin-left:0;
    }
    #glameeto-ai-page-container {
        width: 90%;
    }
    #ai-chat-footer {
        padding: 10px 10px;
    }
}