/*
 * cockpit-voice-intake.css
 * ========================
 *
 * Plain language: the look and feel of the microphone overlay, the
 * pulsing recording indicator, and the transcript-edit side panel.
 *
 * Why this file exists:
 *   The voice-intake JS modules render their own DOM rather than
 *   mounting React components; isolating the styling here keeps the
 *   inline DOM small and lets the cockpit theme override colours via
 *   CSS variables (--bg-card, --text-primary, --accent etc).
 *
 * What it does NOT do:
 *   - Override deal-detail or modal-overlay base styles. Those stay
 *     owned by their respective files (cockpit-deal-detail.css etc).
 *   - Provide dark-mode-only or light-mode-only branches. Cockpit
 *     uses CSS-variable theming; this file references the same
 *     variables so the overlay tracks the active theme.
 */

/* =============================================================
 * Voice-intake overlay (microphone capture)
 * ============================================================= */

.vi-overlay {
    /* Inherits .modal-overlay; no override needed. The selector is
       kept for specificity so future tweaks can target the voice
       overlay without touching every modal in the SPA. */
}

.vi-modal {
    width: 480px;
    max-width: 92vw;
    padding: 24px;
}

.vi-deal-strip {
    margin: 8px 0 16px;
    font-size: 13px;
    color: var(--text-secondary, #8b949e);
}

.vi-deal-name {
    font-weight: 600;
    color: var(--text-primary, #c9d1d9);
}

.vi-deal-name--free {
    /* Standalone-memo header reads "Mémo vocal libre" — softer tone
       so the rep knows it's not bound to a deal yet. */
    font-style: italic;
    font-weight: 500;
    color: var(--text-secondary, #8b949e);
}

.vi-record-area {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 12px 0 4px;
}

/* The big record button. Sized generously for thumb use on mobile;
   on desktop it still feels obvious. */
.vi-record-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 22px 16px;
    border: 1px solid var(--border, #30363d);
    border-radius: 12px;
    background: var(--bg-card, #161b22);
    color: var(--text-primary, #c9d1d9);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* WHY: prevents long-press text-selection menu on iOS — would
       interrupt the hold-to-record gesture. */
    transition: background 0.15s ease, border-color 0.15s ease;
}

.vi-record-button:hover {
    background: rgba(56, 139, 253, 0.08);
    border-color: var(--primary, #2f81f7);
}

.vi-record-button:active {
    background: rgba(248, 81, 73, 0.16);
    border-color: rgba(248, 81, 73, 0.7);
}

.vi-mic-icon {
    font-size: 24px;
    line-height: 1;
    color: #f85149;
    /* WHY: red-ish tint for the mic dot. Stays consistent across
       light/dark themes — Cockpit's red token doesn't shift hue much
       between modes so a literal hex is fine here. */
}

.vi-record-label {
    font-size: 14px;
    letter-spacing: 0.2px;
}

/* Status row beneath the button — pulsing dot + plain-language
   status + elapsed timer. */
.vi-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary, #8b949e);
}

.vi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary, #8b949e);
    transition: background 0.2s ease;
}

.vi-dot--recording {
    background: #f85149;
    animation: vi-pulse 1.2s ease-in-out infinite;
}

@keyframes vi-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(1.4); }
}

.vi-timer {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    /* WHY: tabular numbers stop the timer string from jumping width
       as digits change — a small thing but visible at 5 Hz. */
}

.vi-help {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary, #8b949e);
}

.vi-help--secondary {
    border-left: 2px solid var(--border, #30363d);
    padding-left: 10px;
    color: var(--text-tertiary, #6e7681);
}

.vi-error {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.4);
    border-radius: 6px;
    color: #ffa198;
    font-size: 13px;
    line-height: 1.5;
}

/* =============================================================
 * Inline "Mémo vocal" trigger button (intake modal + deal detail)
 * =============================================================
 *
 * Plain language: the small chip that sits next to the notes
 * textarea or in the deal Activité section. Pressing it opens the
 * full overlay above.
 */

.vi-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border, #30363d);
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary, #c9d1d9);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.vi-trigger:hover {
    background: rgba(56, 139, 253, 0.08);
    border-color: var(--primary, #2f81f7);
}

.vi-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.vi-trigger-icon {
    font-size: 14px;
    line-height: 1;
}

/* =============================================================
 * Transcript-edit side panel (Otter pattern)
 * ============================================================= */

.vte-overlay {
    /* Inherits .modal-overlay — see styles.css. */
}

.vte-modal {
    width: 640px;
    max-width: 96vw;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    /* The transcript can be long; we let the textarea scroll inside
       the modal rather than the modal itself — keeps the action bar
       at the bottom always reachable. */
    max-height: 92vh;
}

.vte-header-strip {
    font-size: 13px;
    color: var(--text-secondary, #8b949e);
}

.vte-status-line {
    font-size: 12px;
    color: var(--text-secondary, #8b949e);
}

.vte-status-line--processing {
    color: #d29922;
    /* WHY: amber while transcription is in flight — same colour the
       review-gate uses for "needs attention" so the rep's eye learns
       the signal early. */
}

.vte-status-line--ready {
    color: #56d364;
}

.vte-status-line--error {
    color: #ffa198;
}

.vte-textarea-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 200px;
}

.vte-textarea {
    width: 100%;
    height: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border, #30363d);
    border-radius: 8px;
    background: var(--bg-input, #0d1117);
    color: var(--text-primary, #c9d1d9);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
    resize: vertical;
}

.vte-textarea:focus {
    outline: none;
    border-color: var(--primary, #2f81f7);
    box-shadow: 0 0 0 2px rgba(56, 139, 253, 0.18);
}

.vte-textarea--placeholder {
    color: var(--text-tertiary, #6e7681);
    /* Used during the "transcription en cours" state where the
       textarea displays a non-editable hint rather than blanking. */
}

.vte-help {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary, #8b949e);
}

.vte-error {
    padding: 10px 12px;
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.4);
    border-radius: 6px;
    color: #ffa198;
    font-size: 13px;
    line-height: 1.5;
}

/* =============================================================
 * Inbox-card / Toast / Push variants — surfaced from
 * cockpit-voice-notification.js. Kept in this file so all voice
 * UX shares one stylesheet.
 * ============================================================= */

.vn-inbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border, #30363d);
    border-radius: 8px;
    background: rgba(56, 139, 253, 0.08);
    color: var(--text-primary, #c9d1d9);
    font-size: 13px;
}

.vn-inbox-card--error {
    background: rgba(248, 81, 73, 0.08);
    border-color: rgba(248, 81, 73, 0.4);
    color: #ffa198;
}

.vn-inbox-card-icon {
    font-size: 16px;
}

.vn-inbox-card-meta {
    color: var(--text-secondary, #8b949e);
    font-size: 11px;
}

.vn-inbox-card-action {
    margin-left: auto;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border, #30363d);
    border-radius: 4px;
    color: var(--text-primary, #c9d1d9);
    font-size: 12px;
    cursor: pointer;
}

.vn-inbox-card-action:hover {
    background: rgba(56, 139, 253, 0.12);
    border-color: var(--primary, #2f81f7);
}

.vn-push-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: 1px dashed var(--border, #30363d);
    border-radius: 4px;
    color: var(--text-secondary, #8b949e);
    font-size: 11px;
    cursor: pointer;
}

.vn-push-toggle:hover {
    border-style: solid;
    border-color: var(--primary, #2f81f7);
    color: var(--text-primary, #c9d1d9);
}
