/**
 * Copyright (c) 2026 PrestaShop SA
 * This file is part of PrestaShop AskAI.
 */

/* ── Layout ──────────────────────────────────────────────── */
#ps-ask-ai-page { max-width: 650px; margin: 0 auto; }

/* ── Card ────────────────────────────────────────────────── */
.psai-card { background: #fff; border: 1px solid #dddddd; margin-top: 20px; }
.psai-card__header { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-bottom: 1px solid #eeeeee; }
.psai-card__body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

/* ── Form fields ─────────────────────────────────────────── */
.psai-field { display: flex; flex-direction: column; gap: 6px; }
.psai-label { font-size: 14px; font-weight: 600; color: #1d1d1b; margin-bottom: 0; }
.psai-input {
    width: 100%; padding: 8px 12px; border: 1px solid #dddddd; border-radius: 2px;
    font-size: 14px; color: #1d1d1b; box-sizing: border-box; background: #fff; line-height: 1.5;
}
.psai-input:hover    { border-color: #1d1d1b; }
.psai-input:focus    { border-color: #1d1d1b; outline: none; box-shadow: 0 0 0 2px rgba(23,78,239,0.12) inset; }
.psai-input:disabled { background: #fff !important; color: #bbbbbb; border-color: #dddddd; cursor: not-allowed; }
.psai-input--readonly { background: #fff !important; cursor: default; font-family: monospace; letter-spacing: 1px; color: #5e5e5e; }

/* ── Select ──────────────────────────────────────────────── */
.psai-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%235e5e5e' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; padding-right: 38px;
}

/* ── Masked key wrapper ───────────────────────────────────── */
.psai-masked-wrapper { position: relative; display: flex; align-items: center; }
.psai-masked-wrapper .psai-input { width: 100%; padding-right: 80px; }
.psai-input__replace {
    position: absolute; right: 10px; background: none; border: none; padding: 0;
    font-size: 13px; font-weight: 600; color: #1d1d1b; text-decoration: underline;
    cursor: pointer; white-space: nowrap;
}
.psai-input__replace:hover { color: #3f3f3d; }

/* ── Password reveal ─────────────────────────────────────── */
.psai-password-wrapper { position: relative; display: flex; align-items: center; }
.psai-password-wrapper .psai-input { width: 100%; padding-right: 36px; }
.psai-input__reveal {
    position: absolute; right: 10px; display: flex; align-items: center;
    cursor: pointer; color: #3f3f3d; user-select: none; background: none; border: none; padding: 0; line-height: 1;
}
.psai-input__reveal:hover { color: #1d1d1b; }
.psai-input__reveal .material-symbols-rounded { font-size: 16px; }

/* ── Buttons ─────────────────────────────────────────────── */
.psai-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 20px; font-size: 13px; font-weight: 600; border-radius: 0;
    cursor: pointer; border: none; text-decoration: none; line-height: 1; transition: background 0.15s;
}
.psai-btn--primary                      { background: #1d1d1b; color: #fff; }
.psai-btn--primary:hover:not(:disabled) { background: #3f3f3d; color: #fff; }
.psai-btn--primary:disabled             { background: #bbbbbb; border-color: #bbbbbb; cursor: not-allowed; }
.psai-btn--secondary                    { background: #fff; color: #1d1d1b; border: 1px solid #1d1d1b; }
.psai-btn--secondary:hover              { background: #f5f5f5; color: #1d1d1b; }
.psai-btn--text { background: none; border: none; color: #174eef; font-size: 13px; font-weight: 600; padding: 8px 12px; cursor: pointer; border-radius: 0; }
.psai-btn--text:hover { background: #f0f4ff; }
.psai-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 4px; }

/* ── Inline notifications ────────────────────────────────── */
.psai-notify { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 4px; border-left: 4px solid; font-size: 13px; line-height: 1.5; }
.psai-notify--success { background: #e8f5e9; border-color: #207f4b; color: #1d5e35; }
.psai-notify--danger  { background: #fce8e8; border-color: #cc2121; color: #8b1a1a; }
.psai-notify--warning { background: #fff8e1; border-color: #e67e00; color: #7d4500; }
.psai-notify--info    { background: #e8f0fe; border-color: #174eef; color: #0d3291; }
.psai-help { font-size: 12px; color: #5e5e5e; font-style: italic; margin: 0; }

/* ── Provider API key help ───────────────────────────────── */
.psai-help-toggle { background:none; border:none; padding:0; font-size:12px; color:#174eef; text-decoration:none; cursor:pointer; white-space:nowrap; }
.psai-help-toggle:hover { text-decoration:underline; }
.psai-help-toggle:focus:not(:focus-visible) { outline:none; }
.psai-provider-help { background:#f7f8fc; border-left:3px solid #1d1d1b; padding:10px 14px; font-size:13px; color:#3f3f3d; line-height:1.5; }
.psai-provider-help ol { margin:4px 0 0 16px; padding:0; }
.psai-provider-help li { margin-bottom:2px; }
.psai-provider-help a { color:#1d1d1b; text-decoration:underline; }
.psai-provider-help a:hover { color:#3f3f3d; }
.psai-provider-help a:focus:not(:focus-visible) { outline:none !important; }
.psai-provider-help__warning { margin:6px 0 0 0; font-size:12px; color:#7d4500; }

/* ── Puik alert ──────────────────────────────────────────── */
.puik-alert { position: relative; display: flex; flex-direction: row; align-items: flex-start; padding: 1rem; border: 1px solid; color: #1d1d1b; font-size: 14px; }
.puik-alert__container { display: flex; flex-direction: column; flex: 1; gap: 8px; }
.puik-alert__content   { display: flex; flex-direction: row; align-items: flex-start; gap: 9px; }
.puik-alert__icon      { flex-shrink: 0; margin-top: 1px; font-size: 1.25rem !important; }
.puik-alert__text      { flex: 1; }
.puik-alert__title       { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.puik-alert__description { font-size: 14px; margin: 0; }
.puik-alert--success { background-color: #ecfdf3; border-color: #207f4b; }
.puik-alert--success .puik-alert__icon { color: #207f4b; font-variation-settings: 'FILL' 1; }
.puik-alert--info    { background-color: #e8f0fe; border-color: #174eef; }
.puik-alert--info .puik-alert__icon    { color: #174eef; font-variation-settings: 'FILL' 1; }
.puik-alert--warning .puik-alert__button {
    background: #fff5e5; color: #1d1d1b !important; border: 1px solid #ffb000; border-radius: 0;
    padding: 9px 20px; font-size: 13px; font-weight: 600; text-decoration: none !important;
    white-space: nowrap; display: inline-flex; align-items: center;
}
.puik-alert--warning .puik-alert__button:hover  { background: #ffeccc; color: #1d1d1b !important; text-decoration: none !important; }
.puik-alert--warning .puik-alert__button:active { background: #ffd999; }

/* ── Store-access alert banner ───────────────────────────── */
.ps-ask-ai-alert { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-top: 20px; background: #fff; border: 1px solid #e0e0e0; box-sizing: border-box; }
.ps-ask-ai-alert__icon { flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: #1d1d1b; color: #fff; font-size: 22px; }
.ps-ask-ai-alert__body  { flex: 1; min-width: 0; }
.ps-ask-ai-alert__title { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #1d1d1b; }
.ps-ask-ai-alert__desc  { font-size: 13px; color: #6c757d; }
.ps-ask-ai-alert__btn {
    flex-shrink: 0; display: inline-block; padding: 10px 20px; background: #1d1d1b;
    color: #fff !important; font-size: 13px; font-weight: 600; text-decoration: none !important;
    white-space: nowrap; border: 1px solid #1d1d1b;
}
.ps-ask-ai-alert__btn:hover,
.ps-ask-ai-alert__btn:focus              { color: #fff !important; text-decoration: none !important; background: #3f3f3d; }
.ps-ask-ai-alert__btn--secondary         { background: #fff; color: #1d1d1b !important; }
.ps-ask-ai-alert__btn--secondary:hover,
.ps-ask-ai-alert__btn--secondary:focus   { background: #f5f5f5; color: #1d1d1b !important; }
