/* ==========================================================================
   Clielo — Styles (couleurs gérées en inline par PHP)
   ========================================================================== */

/* ── Zone messages ───────────────────────────────────────── */
.clielo-messages {
    flex: 1;
    height: 340px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
}

.clielo-loading,
.clielo-empty {
    text-align: center;
    color: #999;
    padding: 30px 20px;
    font-size: 14px;
}

/* ── Message ─────────────────────────────────────────────── */
.clielo-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: clielo-msg-in 0.2s ease;
}

.clielo-message--mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.clielo-message--other {
    align-self: flex-start;
}

.clielo-message--system {
    align-self: center;
    max-width: 90%;
}

@keyframes clielo-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Avatar */
.clielo-avatar {
    flex-shrink: 0;
}

.clielo-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Bulle */
.clielo-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.clielo-message--other .clielo-bubble {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* Nom utilisateur */
.clielo-username {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #555;
}

/* Heure */
.clielo-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.clielo-message--mine .clielo-time {
    text-align: right;
}

/* ── Formulaire ──────────────────────────────────────────── */
.clielo-form {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}

.clielo-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.clielo-input {
    flex: 1;
    border: 1px solid #d0d5dd !important;
    border-radius: 20px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-family: inherit;
    resize: none !important;
    outline: none;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 120px !important;
    line-height: 1.4;
    background: #fff !important;
    color: #333 !important;
    overflow: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
}

.clielo-input::-webkit-scrollbar {
    display: none;
}

.clielo-send {
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 50% !important;
    color: #fff !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: transform 0.1s;
}

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

.clielo-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Login notice ────────────────────────────────────────── */
.clielo-login-notice {
    padding: 16px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    background: #fefce8;
    flex-shrink: 0;
}

.clielo-login-notice p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.clielo-login-notice a {
    text-decoration: none;
    font-weight: 600;
}

/* ── Shortcode [clielo_options] — Carte d'options ────────── */
.clielo-sc-card {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.clielo-sc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* Offre de base */
.clielo-sc-base {
    padding: 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e8e8e8;
}

.clielo-sc-base-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 4px;
}

.clielo-sc-base-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 2px;
}

.clielo-sc-base-price {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
}

.clielo-sc-base-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

/* Séparateur */
.clielo-sc-separator {
    height: 0;
    border-top: 1px solid #e8e8e8;
}

/* Titre options */
.clielo-sc-opts-title {
    padding: 12px 16px 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

/* Option individuelle */
.clielo-sc-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
}

.clielo-sc-opt:last-of-type {
    border-bottom: none;
}

.clielo-sc-opt:hover {
    background: #f9fafb;
}

.clielo-sc-opt input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.clielo-sc-opt-info {
    flex: 1;
    min-width: 0;
}

.clielo-sc-opt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.clielo-sc-opt-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.clielo-sc-opt-price {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.clielo-sc-opt-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
    margin-top: 2px;
}

/* Footer : total + bouton */
.clielo-sc-footer {
    padding: 14px 16px;
    border-top: 2px solid #e8e8e8;
    background: #fafafa;
}

.clielo-sc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
}

.clielo-sc-order {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.clielo-sc-order:hover {
    opacity: 0.9;
}

.clielo-sc-order:active {
    transform: scale(0.98);
}

/* ── Scrollbar messages ──────────────────────────────────── */
.clielo-messages::-webkit-scrollbar { width: 6px; }
.clielo-messages::-webkit-scrollbar-track { background: transparent; }
.clielo-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .clielo-messages {
        height: 260px;
    }

    .clielo-message {
        max-width: 92%;
    }

    #clielo-container {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
    }
}
