/**
 * simulator.css — [terminal_price_simulator] styles
 *
 * Issue #3997 — Pricing Simulator Shortcode
 * @author Olivier RAVEAU - Oliv.Ai 🥷
 * @date 2026-03-01
 */

/* ── Simulator wrapper ─────────────────────────────────────────────────── */

.wcp-simulator-wrap {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    padding: 2rem 2.25rem 1.5rem;
    margin-bottom: 2rem;
    font-family: inherit;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.wcp-sim-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.wcp-sim-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.wcp-sim-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
}

/* ── Sentence form ───────────────────────────────────────────────────────── */

.wcp-sim-sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.4rem;
    font-size: 1.5rem;
    color: #212529;
    line-height: 2;
    margin-bottom: 0.5rem;
}

.wcp-sim-word {
    font-size: 1.5rem;
    color: #212529;
}

/* Inline select — looks like a clickable underlined word */
.wcp-sim-select {
    display: inline-block;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid #e8572a;
    border-radius: 0;
    padding: 0 1.4rem 0 0.1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #e8572a;
    cursor: pointer;
    outline: none;
    /* Caret icon using inline SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e8572a' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.2rem center;
    background-size: 10px 7px;
    max-width: 10rem;
    vertical-align: baseline;
    line-height: inherit;
}

.wcp-sim-select:focus {
    border-bottom-color: #b03e1b;
    color: #b03e1b;
}

.wcp-sim-select:hover {
    border-bottom-style: solid;
}

/* Date input wrapper */
.wcp-sim-date-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

.wcp-sim-date-icon {
    font-size: 1.2rem;
}

.wcp-sim-date-input {
    max-width: 9rem;
    padding-right: 0.2rem;
    background-image: none; /* date inputs have native UI */
}

.wcp-sim-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
    margin-bottom: 0;
    font-style: italic;
}

/* ── Result area ─────────────────────────────────────────────────────────── */

.wcp-sim-result {
    margin-top: 1.25rem;
    min-height: 4rem;
}

/* ── Price card ──────────────────────────────────────────────────────────── */

.wcp-price-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-left: 4px solid #e8572a;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wcp-price-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.wcp-price-card__service {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.wcp-price-card__badge {
    display: inline-block;
    background: #212529;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.25rem 0.9rem;
    border-radius: 2rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.wcp-price-card__badge--free {
    background: #198754;
}

.wcp-price-card__badge--no-match {
    background: #dc3545;
    font-size: 1rem;
}

/* Breakdown list */
.wcp-price-card__breakdown-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.wcp-price-card__breakdown {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
}

.wcp-price-card__breakdown li {
    padding: 0.2rem 0;
    border-bottom: 1px dashed #f0f0f0;
}

.wcp-price-card__breakdown li:last-child {
    border-bottom: none;
}

/* Rule reference */
.wcp-price-card__rule-ref {
    font-size: 0.78rem;
    color: #adb5bd;
    font-style: italic;
    margin-top: 0.75rem;
}

/* No-match state */
.wcp-price-card--no-match {
    border-left-color: #ffc107;
    background: #fffdf0;
}

/* ── Loading shimmer ──────────────────────────────────────────────────────── */

.wcp-sim-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #6c757d;
    font-size: 0.95rem;
    padding: 0.75rem 0;
}

.wcp-sim-loading .spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
    color: #e8572a;
}

/* ── Admin debug panel ───────────────────────────────────────────────────── */

.wcp-sim-debug {
    margin-top: 1rem;
    background: #1e1e1e;
    border-radius: 0.4rem;
    overflow: hidden;
    font-size: 0.82rem;
}

.wcp-sim-debug summary {
    background: #2d2d2d;
    color: #e0e0e0;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    user-select: none;
    font-family: monospace;
    font-size: 0.85rem;
    list-style: none;
}

.wcp-sim-debug summary::-webkit-details-marker { display: none; }
.wcp-sim-debug summary::before { content: '▶ '; }
details.wcp-sim-debug[open] summary::before { content: '▼ '; }

.wcp-sim-debug__body {
    padding: 0.75rem;
}

.wcp-sim-debug__entry {
    margin-bottom: 0.6rem;
}

.wcp-sim-debug__label {
    color: #ce9178;
    font-family: monospace;
    font-weight: 600;
}

.wcp-sim-debug__query {
    display: block;
    color: #9cdcfe;
    font-family: monospace;
    word-break: break-all;
    white-space: pre-wrap;
    margin: 0.15rem 0 0.1rem 0.5rem;
}

.wcp-sim-debug__note {
    display: block;
    color: #6a9955;
    font-family: monospace;
    font-size: 0.78rem;
    margin-left: 0.5rem;
}

/* ── CTA link ────────────────────────────────────────────────────────────── */

.wcp-sim-cta {
    text-align: right;
    margin-top: 0.75rem;
}

.wcp-sim-cta-link {
    font-size: 0.88rem;
    color: #6c757d;
    text-decoration: none;
    transition: color 0.15s;
}

.wcp-sim-cta-link:hover {
    color: #e8572a;
    text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 576px) {
    .wcp-simulator-wrap {
        padding: 1.25rem 1rem 1rem;
    }

    .wcp-sim-sentence {
        font-size: 1.2rem;
        line-height: 2.2;
    }

    .wcp-sim-word {
        font-size: 1.2rem;
    }

    .wcp-sim-select {
        font-size: 1.2rem;
        max-width: 8rem;
    }

    .wcp-price-card__badge {
        font-size: 1.1rem;
    }
}
