/* Nature dé Pivoine — Live Support | refined UI v0.5 */
:root{--ndp-plum:#94627b;--ndp-plum-dark:#75465f;--ndp-ink:#382d34;--ndp-muted:#776872;--ndp-line:#eadde4;--ndp-blush:#f8eff3;--ndp-soft:#fcf9fb}
#ndp-chat-root{position:fixed;right:20px;bottom:20px;z-index:99999;font:14px/1.5 Arial,sans-serif;color:var(--ndp-ink)}
#ndp-chat-root *, .ndp-panel *{box-sizing:border-box}
#ndp-chat-root [hidden],.ndp-panel [hidden]{display:none!important}
#ndp-chat-toggle{background:var(--ndp-plum);color:#fff;border:0;border-radius:40px;padding:14px 22px;box-shadow:0 8px 26px #75445e38;cursor:pointer;font:600 14px Arial,sans-serif;letter-spacing:.2px}
#ndp-chat-toggle:hover{background:var(--ndp-plum-dark)}
#ndp-chat-box{width:min(380px,calc(100vw - 32px));height:min(590px,calc(100dvh - 100px));background:#fff;border:1px solid var(--ndp-line);border-radius:22px;box-shadow:0 18px 65px #44233b2a;overflow:hidden;display:flex;flex-direction:column;margin-bottom:12px}
#ndp-chat-box header{background:linear-gradient(120deg,#faf1f5,#f4e6ed);padding:17px 20px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-shrink:0}
#ndp-chat-box header strong{display:block;font-size:15px;max-width:none;line-height:1.35}
#ndp-presence{display:block;font-size:12px;font-weight:400;margin-top:5px;color:#68525e}
#ndp-chat-close{border:0;background:transparent;color:var(--ndp-ink);font-size:24px;cursor:pointer;line-height:1;padding:4px}
#ndp-faq{flex:1;overflow-y:auto;padding:18px;min-height:0}
.ndp-faq-intro{background:var(--ndp-blush);border-radius:14px;padding:16px;margin-bottom:16px}
.ndp-faq-intro strong{font-size:15px}.ndp-faq-intro p{margin:8px 0 0;line-height:1.55}
#ndp-faq-list{display:grid;gap:9px}#ndp-faq-list h3{font-size:15px;margin:5px 0}
.ndp-faq-category,.ndp-faq-back{border:1px solid var(--ndp-line);border-radius:12px;background:#fff;color:var(--ndp-ink);padding:13px;text-align:left;font:inherit;cursor:pointer;width:100%;transition:background .2s,border-color .2s}
.ndp-faq-category:hover{background:var(--ndp-soft);border-color:#d8b8c8}.ndp-faq-back{border:0;color:var(--ndp-plum-dark);padding:8px}
.ndp-faq-question{border:1px solid var(--ndp-line);border-radius:12px;padding:12px;background:#fff}.ndp-faq-question summary{cursor:pointer;font-weight:600}.ndp-faq-question p{margin:10px 0 0;color:#594c55;white-space:pre-wrap}
#ndp-faq-agent{display:block;width:100%;margin-top:18px;border:0;border-radius:12px;padding:13px;background:var(--ndp-plum);color:#fff;font:600 14px Arial,sans-serif;cursor:pointer}
#ndp-chat-messages{flex:1;min-height:0;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:12px}
#ndp-chat-messages .ndp-msg{margin:0;max-width:88%;padding:11px 14px;line-height:1.55;border-radius:16px;background:#f7f2f4;white-space:pre-wrap;overflow-wrap:anywhere}
#ndp-chat-messages .ndp-msg.visitor{align-self:flex-end;background:#f1dce6;border-bottom-right-radius:5px}
#ndp-chat-messages .ndp-msg.agent{align-self:flex-start;border-bottom-left-radius:5px}
#ndp-chat-form{padding:14px 18px;display:grid;gap:9px;background:#fff;border-top:1px solid #f0e7ec;flex-shrink:0;max-height:70%;overflow-y:auto}
#ndp-chat-identity{display:grid;gap:7px}
#ndp-chat-form label{font-size:12px;font-weight:600;color:#594b54}
#ndp-chat-form input,#ndp-chat-form textarea{width:100%;border:1px solid #dbcbd2;border-radius:10px;padding:11px;font:inherit;color:var(--ndp-ink);background:#fff;outline:none;resize:vertical}
#ndp-chat-form input:focus-visible,#ndp-chat-form textarea:focus-visible{border-color:var(--ndp-plum);box-shadow:0 0 0 3px #9a637d20}
#ndp-chat-form button,#ndp-chat-ended button{border:0;border-radius:11px;background:var(--ndp-plum);color:#fff;padding:12px 14px;font:600 14px Arial,sans-serif;cursor:pointer}
#ndp-chat-form button:hover,#ndp-chat-ended button:hover,#ndp-faq-agent:hover{background:var(--ndp-plum-dark)}
#ndp-chat-ended{padding:18px;border-top:1px solid var(--ndp-line);background:#fff8fb;font-size:13px}
.ndp-chat-note{padding:8px 18px 12px;font-size:11px;color:var(--ndp-muted);margin:0;background:#fff}
/* Optional future KVKK field: only styles elements when they are actually added to HTML. */
#ndp-chat-kvkk{padding:11px 12px;background:var(--ndp-soft);border:1px solid var(--ndp-line);border-radius:11px;font-size:12px;line-height:1.5}
#ndp-chat-kvkk label{display:flex;gap:9px;align-items:flex-start;font-weight:400;cursor:pointer}
#ndp-chat-kvkk input[type=checkbox]{width:16px;height:16px;flex:0 0 16px;margin:2px 0 0;accent-color:var(--ndp-plum)}
#ndp-chat-kvkk a{color:var(--ndp-plum-dark);text-decoration:underline}
/* Operator panel */
.ndp-panel{margin:0;background:var(--ndp-soft);font:15px/1.5 Arial,sans-serif;color:var(--ndp-ink)}
.ndp-panel>header{padding:18px 26px;background:#fff;border-bottom:1px solid var(--ndp-line);display:flex;justify-content:space-between;align-items:center;gap:16px}
.ndp-panel h1{font-size:18px;font-weight:600;margin:0}.ndp-panel h2{margin:0 0 16px;font-size:20px;font-weight:600}
.ndp-panel button{border:0;background:var(--ndp-plum);color:#fff;padding:11px 15px;border-radius:10px;cursor:pointer;font:600 13px Arial,sans-serif;transition:background .2s,opacity .2s}
.ndp-panel button:hover{opacity:.92}.ndp-panel button:disabled{opacity:.55;cursor:not-allowed}
.ndp-panel main{display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);min-height:calc(100vh - 84px)}
.ndp-panel aside{padding:22px 18px;background:#fff;border-right:1px solid var(--ndp-line);min-width:0}
#ndp-unread-total{font-size:13px;color:var(--ndp-plum)}
#ndp-conversations{display:grid;gap:9px}
#ndp-conversations button{display:block;width:100%;margin:0;text-align:left;background:#f7f0f4;color:var(--ndp-ink);white-space:normal;overflow-wrap:anywhere;padding:14px 15px;line-height:1.5}
#ndp-conversations button.selected{background:var(--ndp-plum);color:#fff;box-shadow:0 4px 12px #75445e24}
.ndp-panel main section{padding:24px 28px;display:flex;flex-direction:column;min-width:0;background:var(--ndp-soft);gap:14px}
/* Existing panel.js writes plain text to #ndp-current; this keeps it readable until the JS is updated. */
.ndp-panel #ndp-current{font-size:15px;line-height:1.6;font-weight:500;margin:0;padding:17px 19px;border:1px solid var(--ndp-line);border-radius:16px;background:#fff;overflow-wrap:anywhere;box-shadow:0 3px 16px #3c233008}
/* Structured details to be populated by the next panel.js change. */
.ndp-panel .ndp-conversation-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.ndp-panel .ndp-conversation-heading strong{font-size:18px}
.ndp-panel .ndp-status{display:inline-flex;padding:5px 10px;border-radius:30px;font-size:12px;font-weight:600;background:#e7f4ed;color:#276847}
.ndp-panel .ndp-status.is-closed{background:#f2ebef;color:#745c6a}
.ndp-panel .ndp-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 20px}
.ndp-panel .ndp-detail-item{min-width:0;overflow-wrap:anywhere}
.ndp-panel .ndp-detail-label{display:block;color:var(--ndp-muted);font-size:11px;margin-bottom:3px}
.ndp-panel .ndp-detail-value{display:block;font-size:13px;font-weight:600;line-height:1.5}
.ndp-panel #ndp-panel-messages{flex:1;min-height:250px;max-height:60vh;overflow:auto;padding:10px 2px;display:flex;flex-direction:column;gap:12px}
.ndp-panel #ndp-panel-messages .ndp-msg{margin:0;max-width:85%;padding:13px 16px;line-height:1.55;border-radius:15px;white-space:pre-wrap;overflow-wrap:anywhere}
.ndp-panel #ndp-panel-messages .ndp-msg.visitor{background:#f1dce6;align-self:flex-start;border-bottom-left-radius:5px}
.ndp-panel #ndp-panel-messages .ndp-msg.agent{background:#fff;border:1px solid var(--ndp-line);align-self:flex-end;border-bottom-right-radius:5px}
.ndp-panel #ndp-reply-form{display:flex;gap:10px;align-items:stretch}
.ndp-panel textarea{width:100%;min-width:0;min-height:65px;border:1px solid #d7c7cf;border-radius:11px;padding:12px;font:inherit;resize:vertical;background:#fff;outline:none}
.ndp-panel textarea:focus-visible{border-color:var(--ndp-plum);box-shadow:0 0 0 3px #9a637d20}
.ndp-panel #ndp-reply-form button{flex:0 0 auto}
.ndp-panel #ndp-close-form{margin-top:0}
.ndp-panel #ndp-close-form button{background:#f1e7ed;color:#79566a}
@media(max-width:700px){.ndp-panel main{grid-template-columns:1fr}.ndp-panel aside{border-right:0;border-bottom:1px solid var(--ndp-line);padding:16px}.ndp-panel main section{padding:16px}.ndp-panel #ndp-panel-messages{max-height:48vh}.ndp-panel .ndp-detail-grid{grid-template-columns:1fr 1fr}}
@media(max-width:480px){#ndp-chat-root{right:12px;bottom:12px}#ndp-chat-box{width:calc(100vw - 24px);height:min(610px,calc(100dvh - 95px))}.ndp-panel>header{padding:15px}.ndp-panel h1{font-size:15px}.ndp-panel .ndp-detail-grid{grid-template-columns:1fr}.ndp-panel #ndp-reply-form{flex-direction:column}.ndp-panel #ndp-reply-form button{align-self:stretch}}
@media(prefers-reduced-motion:reduce){#ndp-chat-root *, .ndp-panel *{transition:none!important}}

#ndp-chat-offline {
    padding: 30px 20px;
    text-align: center;
}

#ndp-chat-offline[hidden],
#ndp-chat-form .ndp-kvkk-box[hidden] {
    display: none !important;
}

#ndp-chat-offline h3 {
    margin: 0 0 12px;
    font-size: 19px;
    font-weight: 600;
}

#ndp-chat-offline p {
    margin: 0 0 22px;
    color: #777;
    font-size: 13px;
    line-height: 1.7;
}

.ndp-offline-contact {
    display: block;
    padding: 13px 18px;
    border-radius: 10px;
    background: #9a637d;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease;
}

.ndp-offline-contact:hover {
    background: #80516a;
}

.ndp-customer-details {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ndp-customer-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ndp-customer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ndp-customer-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #faf6f8;
    min-width: 0;
}

.ndp-customer-item small {
    font-size: 12px;
    color: #806b76;
}

.ndp-customer-item span {
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
}


/* Operatör paneli: görüşme işlem butonları */
.ndp-panel section:has(#ndp-close-form) {
    display: flex;
    flex-direction: column;
}

.ndp-panel #ndp-reply-form {
    margin-bottom: 0;
}

.ndp-panel #ndp-close-form,
.ndp-panel #ndp-export-form {
    margin: 0;
}

.ndp-panel #ndp-close-form {
    align-self: flex-end;
    margin-top: 12px;
}

.ndp-panel #ndp-export-form {
    align-self: flex-start;
    margin-top: -44px;
}

.ndp-panel #ndp-export-form button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #94617c;
    border: 1px solid #d8bfcf;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 600;
}

.ndp-panel #ndp-export-form button:hover {
    background: #f7edf2;
}

.ndp-customer-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ndp-export-top {
    margin: 0 0 0 auto !important;
    align-self: center !important;
}

.ndp-export-top button {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid #d8bfcf;
    border-radius: 10px;
    background: #fff;
    color: #94617c;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ndp-export-top button:hover {
    background: #f7edf2;
}

.ndp-delete-button {
    margin-left: 8px;
    padding: 10px 16px;
    border: 1px solid #d9a9b2;
    border-radius: 10px;
    background: #fff;
    color: #a13e53;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ndp-delete-button:hover {
    background: #fff0f2;
}

.ndp-delete-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* NDP operator panel — responsive refinements */
@media (max-width: 700px) {
  .ndp-panel { min-width: 0; }
  .ndp-panel > header { padding: 14px 16px; gap: 10px; }
  .ndp-panel > header h1 { font-size: 16px; line-height: 1.35; }
  .ndp-panel > header button { white-space: nowrap; }
  .ndp-panel main { display: block; min-height: 0; }
  .ndp-panel aside { padding: 15px 14px; border-right: 0; border-bottom: 1px solid var(--ndp-line); }
  .ndp-panel aside h2 { font-size: 16px; margin-bottom: 10px; }
  .ndp-panel #ndp-conversations {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 9px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .ndp-panel #ndp-conversations button {
    flex: 0 0 175px;
    width: 175px;
    min-height: 60px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .ndp-panel main section { padding: 14px; gap: 12px; }
  .ndp-panel #ndp-current { padding: 14px; }
  .ndp-panel .ndp-customer-heading { align-items: flex-start; gap: 8px; }
  .ndp-panel .ndp-customer-heading > strong { flex: 1 1 100%; font-size: 15px; }
  .ndp-panel .ndp-customer-grid { grid-template-columns: 1fr; gap: 9px; }
  .ndp-panel .ndp-customer-item { padding: 10px 12px; }
  .ndp-panel #ndp-export-form.ndp-export-top {
    margin: 0 !important;
    align-self: auto !important;
  }
  .ndp-panel #ndp-export-form.ndp-export-top button,
  .ndp-panel .ndp-delete-button { margin: 0; padding: 9px 11px; font-size: 12px; }
  .ndp-panel #ndp-panel-messages {
    min-height: 260px;
    max-height: 48dvh;
    padding: 10px 0;
    overscroll-behavior: contain;
  }
  .ndp-panel #ndp-panel-messages .ndp-msg { max-width: 92%; padding: 11px 13px; }
  .ndp-panel #ndp-close-form { margin-top: 0; }
}
@media (max-width: 480px) {
  .ndp-panel > header h1 { font-size: 14px; }
  .ndp-panel > header button { padding: 9px 12px; }
  .ndp-panel .ndp-customer-heading { display: flex; flex-wrap: wrap; }
  .ndp-panel .ndp-customer-heading .ndp-status { margin-right: auto; }
  .ndp-panel #ndp-export-form.ndp-export-top { flex: 1 1 100%; }
  .ndp-panel #ndp-export-form.ndp-export-top button { width: 100%; justify-content: center; }
  .ndp-panel .ndp-delete-button { width: 100%; }
  .ndp-panel #ndp-reply-form { flex-direction: column; }
  .ndp-panel #ndp-reply-form button { width: 100%; }
  .ndp-panel #ndp-close-form { align-self: stretch; }
  .ndp-panel #ndp-close-form button { width: 100%; }
}

.ndp-date-group {
    margin-bottom: 12px;
}

.ndp-date-heading {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 6px;
    border: 1px solid #e7dce2;
    border-radius: 9px;
    background: #f8f2f5;
    color: #473640;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.ndp-date-content[hidden] {
    display: none !important;
}

.ndp-date-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 8px;
}

/* Nature dé Pivoine - Görüşme listesi */

#ndp-conversations .ndp-date-heading {
    background: #f7edf2;
    color: #80536c;
    border: 1px solid #ead9e2;
    border-radius: 12px;
    font-weight: 700;
    transition: background .2s ease;
}

#ndp-conversations .ndp-date-heading:hover {
    background: #efdee7;
}

#ndp-conversations .ndp-date-content > button {
    background: #faf6f8;
    color: #443640;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background .2s ease, border-color .2s ease;
}

#ndp-conversations .ndp-date-content > button:hover {
    background: #f1e5eb;
    border-color: #e4ccd8;
}

#ndp-conversations .ndp-date-content > button.selected {
    background: #80536c;
    color: #ffffff;
    border-color: #80536c;
}

/* Toplu silme seçim kutuları */

.ndp-bulk-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ndp-bulk-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #80536c;
    cursor: pointer;
}

.ndp-bulk-row > button {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: #faf6f8;
    color: #443640;
    border: 1px solid transparent;
    border-radius: 12px;
}

.ndp-bulk-row > button.selected {
    background: #80536c;
    color: #fff;
}

/* Toplu Sil butonu - kompakt görünüm */

#ndp-conversations .ndp-bulk-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

#ndp-conversations .ndp-bulk-toggle {
    width: auto;
    flex: none;
    padding: 8px 13px;
    border-radius: 9px;
    background: #80536c;
    color: #ffffff;
    border: 1px solid #80536c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

#ndp-conversations .ndp-bulk-toggle:hover {
    background: #6c435a;
}

#ndp-conversations .ndp-bulk-delete-button {
    width: auto;
    flex: none;
    padding: 8px 11px;
    font-size: 12px;
}
/* Toplu Sil butonunu Görüşmeler başlığı hizasına taşı */

#ndp-conversations {
    position: relative;
}

#ndp-conversations .ndp-bulk-toolbar {
    position: relative;
    margin-top: -49px;
    margin-bottom: 25px;
    min-height: 32px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    pointer-events: none;
}

#ndp-conversations .ndp-bulk-toolbar button {
    pointer-events: auto;
}

/* Aktif ve okunmamış görüşmeler */

#ndp-conversations .ndp-date-content button.ndp-is-active {
    border-left: 4px solid #498c75;
    background: #f0f8f4;
}

#ndp-conversations .ndp-date-content button.ndp-is-closed {
    border-left: 4px solid #d9cbd3;
}

#ndp-conversations .ndp-date-content button.ndp-has-unread {
    border: 2px solid #b67a97;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(182, 122, 151, .12);
}

/* Seçili görüşmenin mürdüm görünümünü koru */

#ndp-conversations .ndp-date-content button.selected {
    background: #80536c;
    color: #ffffff;
    border-color: #80536c;
}
