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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.serviceflow-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;
    max-height: 120px;
    line-height: 1.4;
    background: #fff !important;
    color: #333 !important;
    overflow: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
}

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

.serviceflow-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;
}

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

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

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

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

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

/* ── Shortcode [serviceflow_options] — Carte d'options ────────── */
.serviceflow-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);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.serviceflow-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;
}

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

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

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

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

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

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