/* ================================================================
   voice.css — Voice overlay, orb, cart, audit, quick actions
   ================================================================ */

/* ---- Voice Overlay ---- */
.voice-overlay { position: fixed; inset: 0; z-index: 100; display: flex; background: rgba(23, 23, 20, .92); backdrop-filter: blur(10px); color: white; }
.voice-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.voice-overlay > button:first-child { position: absolute; top: 22px; right: 22px; display: grid; width: 38px; height: 38px; place-items: center; color: white; background: rgba(255,255,255,.12); border-radius: 99px; font-size: 22px; }
.voice-orb { position: relative; display: grid; width: 150px; height: 150px; place-items: center; margin-bottom: 30px; }
.voice-orb span { width: 82px; height: 82px; background: radial-gradient(circle at 32% 28%, #ffd1b8, #ef5a2f 53%, #7c2310); border-radius: 99px; box-shadow: 0 0 50px rgba(239,90,47,.55); animation: breathe 2s ease-in-out infinite; }
.voice-orb i { position: absolute; inset: 15px; border: 1px solid rgba(255,142,106,.35); border-radius: 99px; animation: rings 2s ease-out infinite; }
.voice-orb i:last-child { inset: 0; animation-delay: 1s; }
.voice-overlay .eyebrow { color: #ff9777; }
.voice-overlay h2 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.voice-overlay > p:not(.eyebrow) { max-width: 420px; min-height: 42px; margin: 13px 0 24px; color: #aaa79e; font-size: 11px; line-height: 1.6; }
.voice-levels { display: flex; height: 32px; align-items: center; gap: 4px; }
.voice-levels i { width: 3px; height: 8px; background: #ff8b68; border-radius: 99px; animation: voiceLevel .7s ease-in-out infinite alternate; }
.voice-levels i:nth-child(2), .voice-levels i:nth-child(6) { height: 20px; animation-delay: .2s; }
.voice-levels i:nth-child(3), .voice-levels i:nth-child(5) { height: 29px; animation-delay: .4s; }
.voice-levels i:nth-child(4) { height: 15px; animation-delay: .6s; }
.end-voice-button { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 16px; margin-top: 25px; color: white; background: #cf3f35; border-radius: 99px; font-size: 9px; font-weight: 900; }
.end-voice-button svg { width: 15px; transform: rotate(135deg); }

/* ---- Voice Cart ---- */
.voice-cart { width: 320px; display: flex; flex-direction: column; padding: 22px; background: rgba(255,255,255,.06); border-left: 1px solid rgba(255,255,255,.08); }
.voice-cart-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px; }
.voice-cart-head strong { font-size: 11px; }
.voice-cart-head span { font-size: 13px; font-weight: 900; }
.voice-cart-lines { flex: 1; overflow: auto; display: grid; gap: 8px; }
.voice-cart .cart-line { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); color: white; }
.voice-cart .cart-line-copy strong { color: white; }
.voice-cart .cart-line-art { background: linear-gradient(145deg, #ff9268, var(--accent)); }
.voice-cart-summary { padding: 12px 0 0; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.voice-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 10px; }
.voice-summary-row span { color: #aaa79e; }
.voice-summary-row strong { color: white; font-size: 11px; }
.voice-cart-line .voice-qty { display: block; margin-top: 2px; color: #ff8b68; font-size: 9px; font-weight: 800; }

/* ---- Voice Cart Toggle ---- */
.voice-cart-toggle {
  position: absolute; top: 22px; left: 22px; z-index: 5;
  display: grid; width: 40px; height: 40px; place-items: center;
  color: white; background: rgba(255,255,255,.12);
  border-radius: 99px;
}
.voice-cart-toggle svg { width: 18px; }
.voice-cart-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  display: grid; place-items: center;
  padding: 0 5px; color: white; background: var(--accent);
  border-radius: 99px; font-size: 9px; font-weight: 900;
}
.voice-cart-badge.hidden { display: none; }

/* ---- Voice Quick Actions ---- */
.voice-quick-actions { margin-top: 20px; }
.voice-quick-actions button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px; min-height: 42px;
  color: white; background: var(--accent);
  border-radius: 99px; font-size: 10px; font-weight: 900;
  box-shadow: 0 8px 24px rgba(239,90,47,.35);
  animation: rise .3s ease both;
}
.voice-quick-actions button svg { width: 16px; }

/* ---- Voice Interrupt ---- */
.voice-interrupt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  margin-top: 12px;
  color: white;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 900;
}
.voice-interrupt-btn:hover { background: rgba(255, 255, 255, .22); }

/* ---- Voice Levels States ---- */
.voice-levels { opacity: .35; transition: opacity .25s ease; }
.voice-levels-active { opacity: 1; }
.voice-levels-active i { animation: voiceLevel .7s ease-in-out infinite alternate; }
.voice-levels-processing { opacity: .55; }
.voice-levels-processing i { animation: voiceLevel 1.4s ease-in-out infinite alternate; height: 12px !important; }
.voice-levels-speaking { opacity: 1; }
.voice-levels-speaking i { animation: wave 1s ease-in-out infinite alternate; }
.voice-overlay[data-voice-state="processing"] .voice-orb span { animation: breathe 1.4s ease-in-out infinite; }
.voice-overlay[data-voice-state="speaking"] .voice-orb span { box-shadow: 0 0 60px rgba(239, 90, 47, .75); }

/* ---- Voice Audit Panel ---- */
.voice-audit-toggle {
  position: absolute; bottom: 22px; right: 22px; z-index: 5;
  display: grid; width: 34px; height: 34px; place-items: center;
  color: rgba(255,255,255,.6); background: rgba(255,255,255,.08);
  border-radius: 99px; transition: .2s ease;
}
.voice-audit-toggle:hover { color: white; background: rgba(255,255,255,.15); }
.voice-audit-toggle svg { width: 16px; }
.voice-audit {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 120;
  width: 320px; display: flex; flex-direction: column;
  background: rgba(18,16,14,.98); backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255,255,255,.08);
  color: white;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.voice-audit.open { transform: translateX(0); }
.voice-audit-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.voice-audit-head strong { font-size: 11px; }
.voice-audit-head button { margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; color: rgba(255,255,255,.5); background: rgba(255,255,255,.08); border-radius: 99px; font-size: 18px; }
.voice-audit-badge {
  padding: 3px 8px; color: white; background: #cf3f35;
  border-radius: 99px; font-size: 8px; font-weight: 900; text-transform: uppercase;
  animation: pulse 1.5s ease-in-out infinite;
}
.voice-audit-body { flex: 1; overflow: auto; padding: 12px 16px; }
.voice-audit-section { margin-bottom: 16px; }
.voice-audit-section small { display: block; margin-bottom: 8px; color: #aaa79e; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.voice-audit-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 10px; }
.voice-audit-row span { color: #aaa79e; }
.voice-audit-row strong { color: white; font-size: 10px; font-weight: 600; }
.voice-audit-log { display: flex; flex-direction: column; gap: 6px; font-size: 9px; }
.voice-audit-log .audit-entry { padding: 8px 10px; background: rgba(255,255,255,.05); border-radius: 8px; border-left: 2px solid rgba(255,255,255,.15); }
.voice-audit-log .audit-entry.transcript { border-left-color: #4caf50; }
.voice-audit-log .audit-entry.error { border-left-color: #cf3f35; }
.voice-audit-log .audit-entry.speak { border-left-color: #2196f3; }
.voice-audit-log .audit-time { color: #777; font-size: 8px; margin-bottom: 2px; }
.voice-audit-log .audit-label { color: #aaa79e; font-size: 8px; text-transform: uppercase; font-weight: 800; margin-bottom: 2px; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .voice-overlay { flex-direction: column; }
  .voice-main { padding: 22px 18px; justify-content: flex-start; padding-top: 80px; }
  .voice-cart {
    position: fixed; right: 0; bottom: 0; left: 0; z-index: 110;
    width: auto; max-height: 55vh;
    border-left: none; border-top: 1px solid rgba(255,255,255,.1);
    background: rgba(30,28,24,.98);
    transform: translateY(110%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
    padding: 16px 18px 24px;
  }
  .voice-cart.open { transform: translateY(0); }
  .voice-cart-head { margin-bottom: 10px; }
  .voice-cart-lines { max-height: 180px; }
  .voice-audit { width: 100%; top: auto; bottom: 0; left: 0; right: 0; height: 60vh; transform: translateY(110%); border-left: none; border-top: 1px solid rgba(255,255,255,.08); }
  .voice-audit.open { transform: translateY(0); }
}
