/* ==========================================================
   Audyo — Convertisseur
   ========================================================== */

/* bouton de lancement (barre latérale) */
.cv-launch {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 14px;
  border-radius: 16px; border: 1px solid rgba(34, 197, 94, .45); text-align: left; color: #fff;
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%) -200% 0 / 200% 100% no-repeat,
    linear-gradient(135deg, #062b2a, #0b3d2e 50%, #0e2a52);
  box-shadow: 0 8px 22px rgba(34, 197, 94, .2);
  animation: cvShine 5s ease-in-out infinite;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cv-launch:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(34, 197, 94, .35); }
.cv-launch:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.cv-launch-ico {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #22c55e, #22d3ee); color: #03241a;
}
.cv-launch-ico .ico { width: 20px; height: 20px; animation: spin 4s linear infinite; }
.cv-launch-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.cv-launch-txt strong { font-family: var(--font-title); font-size: 20px; font-weight: 800; }
.cv-launch-txt small { font: 700 10.5px var(--font-mono); color: #a7f3d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes cvShine { 0%, 60% { background-position: -200% 0, 0 0; } 100% { background-position: 200% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .cv-launch, .cv-launch-ico .ico { animation: none; } }

/* vue */
.conv { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; }
.conv[hidden] { display: none; }
.cv-card {
  min-height: 0; display: flex; flex-direction: column; padding: 16px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 35, 92, .8), rgba(17, 26, 74, .8)); border: 1px solid var(--line);
}
.cv-card h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-title); font-size: 20px; }
.cv-card h2 .ico { color: var(--green); }
.cv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cv-sum { margin: 2px 0 0; font: 600 12.5px var(--font-mono); color: var(--muted); }
.cv-tools { display: flex; gap: 6px; flex-wrap: wrap; }

.cv-cols, .cv-row-job { display: grid; grid-template-columns: 52px minmax(0, 1fr) 170px 170px 28px; gap: 10px; align-items: center; }
.cv-cols { padding: 0 10px 6px; border-bottom: 1px solid var(--line); font: 800 10px var(--font-mono); letter-spacing: .5px; color: var(--dim); text-transform: uppercase; }
.cv-cols span:nth-child(1) { grid-column: 1 / 3; }
.cv-list { list-style: none; margin: 6px 0 0; padding: 0 4px 0 0; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; scrollbar-color: var(--panel3) transparent; }
.cv-list[hidden] { display: none; }
.cv-row-job { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .03); transition: background-color .15s ease; }
.cv-row-job:hover { background: rgba(255, 255, 255, .06); }
.cv-ext { font: 800 11px var(--font-mono); text-align: center; padding: 6px 0; border-radius: 8px; background: rgba(255, 255, 255, .07); color: var(--yellow); }
.cv-name { min-width: 0; display: flex; flex-direction: column; }
.cv-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-name small { font: 600 11.5px var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-status { display: flex; flex-direction: column; gap: 5px; font-weight: 800; font-size: 12.5px; color: var(--muted); }
.cv-bar { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.cv-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #22d3ee); transform-origin: left; transform: scaleX(0); transition: transform .2s linear; }
.st-wait .cv-bar { opacity: .4; }
.st-work { color: var(--cyan); }
.st-work span::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; border-radius: 50%; border: 2px solid rgba(34, 211, 238, .35); border-top-color: var(--cyan); animation: spin .8s linear infinite; vertical-align: -1px; }
.st-done { color: #86efac; }
.st-done .cv-bar > i { background: var(--green); }
.st-error { color: #fda4af; }
.st-error .cv-bar { display: none; }
.cv-result { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cv-res { display: flex; flex-direction: column; font-family: var(--font-mono); line-height: 1.2; }
.cv-res b { font-size: 13px; }
.cv-res small { font-size: 11px; font-weight: 700; }
.cv-res .gain { color: #86efac; } .cv-res .loss { color: var(--yellow); }
.cv-acts { display: flex; gap: 4px; }
.cv-acts button, .cv-saved {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); color: var(--text);
}
.cv-acts button:hover { background: rgba(34, 197, 94, .2); color: #86efac; }
.cv-saved { color: var(--green); }
.cv-err { font-size: 12px; color: #fda4af; line-height: 1.3; }
.cv-del { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--dim); display: grid; place-items: center; opacity: 0; transition: opacity .15s ease, background-color .15s ease; }
.cv-row-job:hover .cv-del, .cv-del:focus-visible { opacity: 1; }
.cv-del:hover { background: rgba(255, 71, 87, .2); color: var(--red); }

.cv-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 30px 16px; margin-top: 8px; border: 2px dashed var(--line2); border-radius: 16px; color: var(--muted); line-height: 1.6;
}
.cv-empty[hidden] { display: none; }
.cv-empty strong { color: var(--text); font-size: 17px; }
.cv-empty p { margin: 0; max-width: 52ch; }
.cv-empty-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #22c55e, #22d3ee); color: #03241a; box-shadow: 0 12px 30px rgba(34, 197, 94, .35); }
body.dragging.mode-convert .cv-queue { box-shadow: 0 0 0 3px var(--green), 0 0 30px rgba(34, 197, 94, .35); }
body.dragging.mode-convert .cv-empty { border-color: var(--green); background: rgba(34, 197, 94, .08); }

/* réglages */
.cv-settings { gap: 14px; overflow-y: auto; scrollbar-width: thin; }
.cv-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cv-fmt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-height: 58px; padding: 9px 10px; border-radius: 12px; text-align: left;
  border: 1px solid color-mix(in srgb, var(--fc) 35%, transparent);
  background: color-mix(in srgb, var(--fc) 7%, transparent);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.cv-fmt b { font-family: var(--font-title); font-size: 19px; line-height: 1; color: var(--fc); }
.cv-fmt small { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.cv-fmt:hover { background: color-mix(in srgb, var(--fc) 16%, transparent); }
.cv-fmt.active { background: var(--fc); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--fc) 45%, transparent); }
.cv-fmt.active b, .cv-fmt.active small { color: #061026; }
.cv-na { display: none; position: absolute; top: 6px; right: 6px; font: 700 9px var(--font-mono); color: #fda4af; font-style: normal; }
.cv-fmt.na { opacity: .5; }
.cv-fmt.na .cv-na { display: block; }
.cv-desc { margin: -4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.cv-opts { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.cv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.cv-row select { height: 36px; font-size: 13px; max-width: 62%; }
.cv-row select:disabled { opacity: .5; }
.cv-check, .cv-radio { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cv-check input, .cv-radio input { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.cv-check small { color: var(--dim); font-weight: 600; margin-left: 4px; }
.cv-check[hidden], .cv-radio[hidden] { display: none; }
.cv-out { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.cv-out h3 { margin: 0; font-family: var(--font-title); font-size: 16px; }
.cv-dest { display: flex; gap: 14px; flex-wrap: wrap; }
.cv-dirname { margin: 0; font: 600 12px var(--font-mono); color: #86efac; }
.cv-dirname:empty { display: none; }
.cv-go {
  position: relative; overflow: hidden; min-height: 56px; border: 0; border-radius: 16px; color: #03241a; margin-top: auto;
  background: linear-gradient(120deg, #22c55e, #22d3ee); box-shadow: 0 10px 26px rgba(34, 197, 94, .35);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.cv-go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(34, 197, 94, .5); }
.cv-go:disabled { filter: grayscale(.7); opacity: .55; cursor: not-allowed; }
.cv-go-fill { position: absolute; inset: 0; background: rgba(255, 255, 255, .35); transform-origin: left; transform: scaleX(0); transition: transform .25s linear; }
.cv-go-txt { position: relative; display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 17px; font-weight: 800; }
.cv-go.running { background: linear-gradient(120deg, #ff8a1f, #ff4757); color: #fff; }
.cv-zipall { width: 100%; }
.cv-zipall[hidden] { display: none; }

@media (max-width: 1180px) {
  .conv { grid-template-columns: minmax(0, 1fr); overflow-y: auto; grid-template-rows: minmax(420px, auto) auto; }
  .cv-settings { overflow: visible; }
}
@media (max-width: 760px) {
  .cv-cols { display: none; }
  .cv-row-job { grid-template-columns: 44px minmax(0, 1fr) 28px; grid-template-areas: "ext name del" "st st st" "res res res"; }
  .cv-ext { grid-area: ext; } .cv-name { grid-area: name; } .cv-del { grid-area: del; opacity: 1; }
  .cv-status { grid-area: st; } .cv-result { grid-area: res; }
  .cv-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
