/* ============================================================
   ECSL Product Advisor Chatbot Styles
   Elite Cell Source Labs
   ============================================================ */

:root {
    --ecsl-primary:     #0a2540;
    --ecsl-accent:      #00b4d8;
    --ecsl-accent-dark: #0096c7;
    --ecsl-bg:          #ffffff;
    --ecsl-msg-bot:     #f0f4f8;
    --ecsl-msg-user:    #0a2540;
    --ecsl-radius:      14px;
    --ecsl-shadow:      0 8px 40px rgba(10,37,64,0.18);
    --ecsl-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Bubble ─────────────────────────────────────────── */
#ecsl-chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ecsl-primary), var(--ecsl-accent));
    box-shadow: var(--ecsl-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99998;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}
#ecsl-chatbot-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 48px rgba(10,37,64,0.28);
}
#ecsl-bubble-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #e63946;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ecsl-font);
}

/* ── Chat Window ─────────────────────────────────────── */
#ecsl-chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 120px);
    background: var(--ecsl-bg);
    border-radius: var(--ecsl-radius);
    box-shadow: var(--ecsl-shadow);
    display: none;
    flex-direction: column;
    z-index: 99997;
    overflow: hidden;
    font-family: var(--ecsl-font);
    animation: ecsl-slideUp 0.25s ease;
}
#ecsl-chatbot-window.ecsl-open {
    display: flex;
}

@keyframes ecsl-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ──────────────────────────────────────────── */
#ecsl-chat-header {
    background: linear-gradient(135deg, var(--ecsl-primary), #1a3a5c);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#ecsl-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
#ecsl-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ecsl-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
#ecsl-chat-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}
#ecsl-chat-subtitle {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 2px;
}
#ecsl-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.15s;
}
#ecsl-chat-close:hover { opacity: 1; }

/* ── Messages ────────────────────────────────────────── */
#ecsl-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
#ecsl-chat-messages::-webkit-scrollbar { width: 4px; }
#ecsl-chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.ecsl-message {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: ecsl-fadeIn 0.2s ease;
}
@keyframes ecsl-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ecsl-message.ecsl-bot  { align-self: flex-start; }
.ecsl-message.ecsl-user { align-self: flex-end; }

.ecsl-message-bubble {
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.ecsl-bot  .ecsl-message-bubble { background: var(--ecsl-msg-bot); color: #1a1a2e; border-bottom-left-radius: 4px; }
.ecsl-user .ecsl-message-bubble { background: var(--ecsl-msg-user); color: #fff; border-bottom-right-radius: 4px; }

/* ── Quick-Reply Buttons ─────────────────────────────── */
.ecsl-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}
.ecsl-qr-btn {
    background: #fff;
    border: 1.5px solid var(--ecsl-accent);
    color: var(--ecsl-primary);
    border-radius: 20px;
    padding: 6px 13px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--ecsl-font);
    white-space: nowrap;
}
.ecsl-qr-btn:hover {
    background: var(--ecsl-accent);
    color: #fff;
    border-color: var(--ecsl-accent);
}
.ecsl-qr-btn.ecsl-selected {
    background: var(--ecsl-primary);
    color: #fff;
    border-color: var(--ecsl-primary);
}

/* ── Forms inside chat ───────────────────────────────── */
.ecsl-chat-form {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Form inputs — layout & sizing only (color handled by scoped <style> in widget HTML) */
.ecsl-chat-form input,
.ecsl-chat-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #d0d7e2;
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--ecsl-font);
    box-sizing: border-box;
    background: #ffffff;
    box-shadow: none;
    transition: border-color 0.15s;
    line-height: 1.4;
    margin: 0;
}
.ecsl-chat-form input:focus,
.ecsl-chat-form select:focus {
    outline: none;
    border-color: var(--ecsl-accent);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}
.ecsl-chat-form-row {
    display: flex;
    gap: 8px;
}
.ecsl-chat-form-row input { flex: 1; }
.ecsl-chat-form label,
#ecsl-chatbot-window .ecsl-form-group label,
#ecsl-chatbot-window .ecsl-calc-form label {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin-bottom: 4px !important;
    display: block !important;
    opacity: 1 !important;
}
.ecsl-form-group {
    display: flex;
    flex-direction: column;
}
.ecsl-form-submit {
    background: linear-gradient(135deg, var(--ecsl-primary), #1a3a5c);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--ecsl-font);
    transition: opacity 0.15s;
    margin-top: 4px;
}
.ecsl-form-submit:hover { opacity: 0.88; }
.ecsl-form-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.ecsl-form-error {
    color: #e63946;
    font-size: 12px;
    text-align: center;
}
.ecsl-form-link {
    color: var(--ecsl-accent-dark);
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    font-family: var(--ecsl-font);
    padding: 0;
}
.ecsl-form-link:hover { color: var(--ecsl-primary); }

/* ── Goal Checkboxes ─────────────────────────────────── */
.ecsl-goals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}
.ecsl-goal-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #d0d7e2;
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    color: #1a1a2e;
    user-select: none;
}
.ecsl-goal-item input[type="checkbox"] { display: none; }
.ecsl-goal-item.ecsl-goal-checked {
    background: #e8f7fb;
    border-color: var(--ecsl-accent);
    color: var(--ecsl-primary);
    font-weight: 600;
}
.ecsl-goal-checkmark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.ecsl-goal-checked .ecsl-goal-checkmark {
    background: var(--ecsl-accent);
    border-color: var(--ecsl-accent);
}
.ecsl-goal-checked .ecsl-goal-checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

/* ── Product Cards ───────────────────────────────────── */
.ecsl-product-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.ecsl-product-card {
    background: #fff;
    border: 1.5px solid #e0e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(10,37,64,0.06);
    transition: box-shadow 0.15s;
}
.ecsl-product-card:hover { box-shadow: 0 4px 16px rgba(10,37,64,0.12); }
.ecsl-product-card-inner {
    display: flex;
    padding: 10px;
    gap: 10px;
    align-items: flex-start;
}
.ecsl-product-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f4f8;
}
.ecsl-product-info { flex: 1; min-width: 0; }
.ecsl-product-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--ecsl-primary);
    line-height: 1.3;
    margin-bottom: 2px;
}
.ecsl-product-tagline {
    font-size: 11px;
    color: var(--ecsl-accent-dark);
    font-weight: 600;
    margin-bottom: 3px;
}
.ecsl-product-desc {
    font-size: 11.5px;
    color: #555;
    line-height: 1.4;
    margin-bottom: 4px;
}
.ecsl-product-dosing {
    font-size: 10.5px;
    color: #777;
    line-height: 1.3;
    font-style: italic;
    border-top: 1px solid #eee;
    padding-top: 4px;
    margin-top: 4px;
}
.ecsl-product-price {
    font-weight: 700;
    color: var(--ecsl-primary);
    font-size: 14px;
    margin-top: 2px;
}
.ecsl-product-actions {
    display: flex;
    gap: 6px;
    padding: 0 10px 10px;
}
.ecsl-btn-view {
    flex: 1;
    text-align: center;
    background: var(--ecsl-primary);
    color: #fff;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
    font-family: var(--ecsl-font);
}
.ecsl-btn-view:hover { opacity: 0.85; color: #fff; }
.ecsl-btn-cart {
    flex: 1;
    text-align: center;
    background: var(--ecsl-accent);
    color: #fff;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
    font-family: var(--ecsl-font);
    cursor: pointer;
    border: none;
}
.ecsl-btn-cart:hover { opacity: 0.85; }

/* ── Suggestion bubbles (injected from admin) ────────────── */
.ecsl-suggestion-bubble {
    border-left: 3px solid #00b4d8;
    border-radius: 4px 14px 14px 4px !important;
    font-size: 13.5px !important;
}
.ecsl-sugg-icon { margin-right: 4px; }
.ecsl-sugg-tip      { border-left-color: #00b4d8; background: #e8f7fb !important; }
.ecsl-sugg-protocol { border-left-color: #1a56db; background: #e8f0fe !important; }
.ecsl-sugg-warning  { border-left-color: #f4a261; background: #fff3cd !important; color: #7a5200 !important; }
.ecsl-sugg-faq      { border-left-color: #7c3aed; background: #f3e8ff !important; }
.ecsl-sugg-promo    { border-left-color: #bf125d; background: #fce8f3 !important; }
.ecsl-sugg-general  { border-left-color: #adb5bd; background: #f0f4f8 !important; }

/* ── Typing Indicator ────────────────────────────────── */
.ecsl-typing {
    display: flex;
    gap: 4px;
    padding: 10px 13px;
    background: var(--ecsl-msg-bot);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}
.ecsl-typing span {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: ecsl-typing-dot 1.2s infinite ease-in-out;
}
.ecsl-typing span:nth-child(2) { animation-delay: 0.2s; }
.ecsl-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ecsl-typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Disclaimer ──────────────────────────────────────── */
#ecsl-chat-disclaimer {
    background: #fff8e1;
    border-top: 1px solid #ffe082;
    color: #7a5c00;
    font-size: 10.5px;
    line-height: 1.5;
    padding: 7px 12px;
    flex-shrink: 0;
    text-align: center;
    font-family: var(--ecsl-font);
}

/* ── Progress Bar ────────────────────────────────────── */
.ecsl-progress-bar {
    display: flex;
    gap: 4px;
    margin: 4px 0 8px;
}
.ecsl-progress-step {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: #e0e8f0;
    transition: background 0.3s;
}
.ecsl-progress-step.ecsl-done { background: var(--ecsl-accent); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 430px) {
    #ecsl-chatbot-window { width: calc(100vw - 16px); right: 8px; bottom: 80px; }
    #ecsl-chatbot-bubble { right: 14px; bottom: 14px; }
}

/* ════════════════════════════════════════════════════════
   PEPTIDE CALCULATOR STYLES
════════════════════════════════════════════════════════ */

/* Form container */
.ecsl-calc-form {
    margin-top: 8px;
    width: 100%;
}

/* Hint text under inputs */
.ecsl-calc-hint {
    font-size: 11px;
    color: #6b7c93;
    margin-top: 4px;
    line-height: 1.4;
    font-style: italic;
}

/* Info box showing concentration */
.ecsl-calc-info-box {
    background: #e8f7fb;
    border-left: 3px solid var(--ecsl-accent);
    border-radius: 4px 8px 8px 4px;
    padding: 7px 10px;
    font-size: 12.5px;
    margin-bottom: 10px;
    color: var(--ecsl-primary);
}

/* ── Results panel ────────────────────────────── */
.ecsl-calc-results {
    margin-top: 8px;
    width: 100%;
}

/* Big bold instruction at top of results */
.ecsl-calc-main-result {
    background: linear-gradient(135deg, var(--ecsl-primary), #1a3a5c);
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-align: center;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.ecsl-calc-main-result strong {
    color: #7ee8fa !important;
    font-size: 18px !important;
}

.ecsl-calc-result-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ecsl-primary);
    margin-bottom: 10px;
}

/* 2-column grid for key numbers */
.ecsl-calc-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.ecsl-calc-result-item {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 7px 9px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ecsl-calc-result-label {
    font-size: 10.5px;
    color: #6b7c93;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ecsl-calc-result-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--ecsl-primary);
}

.ecsl-calc-result-value.ecsl-calc-big {
    font-size: 18px;
    color: var(--ecsl-accent-dark);
}

/* ── Visual syringe ──────────────────────────── */
.ecsl-syringe-wrap {
    background: #f8fafc;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    padding: 10px 12px 8px;
    margin-bottom: 10px;
}

.ecsl-syringe-label {
    font-size: 12px;
    color: var(--ecsl-primary);
    margin-bottom: 7px;
    text-align: center;
}

.ecsl-syringe-outer {
    position: relative;
    height: 22px;
    background: #e0e8f0;
    border-radius: 11px;
    overflow: visible;
    border: 1.5px solid #b8c9d9;
}

.ecsl-syringe-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ecsl-accent), var(--ecsl-accent-dark));
    border-radius: 11px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.ecsl-syringe-marker {
    position: absolute;
    top: -5px;
    width: 3px;
    height: 32px;
    background: #e63946;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 3px rgba(230,57,70,0.5);
}

.ecsl-syringe-scale {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #8a9bb0;
    margin-top: 4px;
    padding: 0 2px;
}

/* ── Summary table ───────────────────────────── */
.ecsl-calc-summary {
    background: #fff;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    font-size: 12px;
}

.ecsl-calc-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid #f0f4f8;
    color: var(--ecsl-primary);
}

.ecsl-calc-summary-row:last-child { border-bottom: none; }

.ecsl-calc-summary-row span:first-child {
    color: #6b7c93;
    font-weight: 500;
}

.ecsl-calc-summary-row span:last-child {
    font-weight: 600;
    text-align: right;
}

.ecsl-calc-summary-highlight {
    background: #e8f7fb;
    border-top: 1px solid var(--ecsl-accent) !important;
}

.ecsl-calc-summary-highlight span:last-child {
    color: var(--ecsl-accent-dark);
    font-size: 13px;
}

/* Warning banner */
.ecsl-calc-warning {
    background: #fff3cd;
    border-left: 3px solid #f4a261;
    border-radius: 4px 8px 8px 4px;
    padding: 7px 10px;
    font-size: 12px;
    color: #7a5200;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Disclaimer */
.ecsl-calc-disclaimer {
    font-size: 11px;
    color: #555 !important;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
    padding: 6px 4px;
    font-weight: 500;
}
