/* =========================================================================
   CLE Speech Studio — premium feature components
   (notifications, request modal, premium pitch, voices, recorder)
   Reuses the Emerald Manuscript tokens from style.css.
   ========================================================================= */

/* The `hidden` attribute must always win, even over display:flex/grid rules
   (fixes the request modal and the record-review box showing on load). */
[hidden] { display: none !important; }

/* Flash/system messages are English strings — never render them in the Urdu
   Nastaliq face, even when the UI is in RTL mode. */
.flash,
body[dir="rtl"] .flash { font-family: var(--sans) !important; }

/* ---- admin nav badge / count ---- */
.nav-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  background: var(--err); color: #fff; border-radius: 999px;
}

/* ---- notification bell + panel ---- */
.notif-wrap { position: relative; }
.notif-bell {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
  width: 38px; height: 34px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.notif-bell:hover { border-color: var(--lapis-400); }
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--err); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}
.notif-panel {
  position: absolute; top: 44px; right: 0; width: 320px; max-width: 86vw; z-index: 60;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow, 0 18px 40px rgba(20,40,34,.16)); overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-weight: 600; color: var(--lapis-800); font-size: 14px;
}
.link-btn { background: none; border: none; color: var(--lapis-600); cursor: pointer; font-size: 12px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  padding: 11px 14px; border-bottom: 1px solid var(--rule-line, var(--line));
  font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 4px;
  border-left: 3px solid transparent;
}
.notif-item.unread { background: var(--azure-50); }
.notif-item.success { border-left-color: var(--ok); }
.notif-item.warning { border-left-color: var(--warn); }
.notif-item.info    { border-left-color: var(--lapis-400); }
.notif-time { font-size: 11px; color: var(--muted); }
.notif-empty { padding: 20px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- premium pitch card ---- */
.premium-pitch { position: relative; border-color: var(--gold-300); background:
  linear-gradient(180deg, var(--gold-100) 0%, var(--paper-card) 70%); }
.premium-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--on-gold, #241d06); background: var(--gold-gradient, var(--gold-400));
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px;
}
.premium-list { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; gap: 12px; }
.premium-list li { display: flex; flex-direction: column; gap: 2px; padding-left: 18px; position: relative; }
.premium-list li::before { content: "✦"; position: absolute; left: 0; top: 1px; color: var(--gold-500); }
.premium-list .muted { font-size: 13px; }

/* ---- voices list ---- */
.voice-list { display: grid; gap: 10px; }
.voice-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-card);
}
.voice-item.active { border-color: var(--lapis-500); box-shadow: 0 0 0 3px var(--ring-color); }
.vmeta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vmeta b { color: var(--lapis-800); }
.vmeta .muted { font-size: 12px; }
.vaudio { height: 32px; margin-top: 4px; max-width: 240px; }
.vactions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---- upload / record tabs ---- */
.voice-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.vtab {
  background: var(--paper-sunk); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.vtab.active { background: var(--lapis-700); border-color: var(--lapis-700); color: #fff; }
.vpanel { animation: rise .25s ease both; }

/* ---- recorder ---- */
.recorder { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--err); margin-right: 7px; animation: recpulse 1.2s infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.rec-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--err); font-size: 15px; }
.rec-review { margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.rec-review audio { height: 38px; max-width: 360px; }
.rec-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(19,51,43,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 480px; max-width: 100%; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px;
  box-shadow: 0 30px 70px rgba(19,51,43,.3); animation: rise .25s ease both;
}
.modal h2 { margin: 0 0 4px; font-family: var(--display); color: var(--lapis-800); font-size: 22px; }
.modal .field { margin-top: 14px; }
.modal-foot { display: flex; gap: 10px; margin-top: 20px; }
.modal-x {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 18px; cursor: pointer; color: var(--muted); line-height: 1;
}
.modal-x:hover { color: var(--ink); }

/* ---- RTL niceties ---- */
body[dir="rtl"] .notif-panel { right: auto; left: 0; }
body[dir="rtl"] .notif-badge { right: auto; left: -6px; }
body[dir="rtl"] .notif-item { border-left: none; border-right: 3px solid transparent; }
body[dir="rtl"] .notif-item.success { border-right-color: var(--ok); }
body[dir="rtl"] .notif-item.warning { border-right-color: var(--warn); }
body[dir="rtl"] .notif-item.info { border-right-color: var(--lapis-400); }
body[dir="rtl"] .nav-badge { margin-left: 0; margin-right: 5px; }
body[dir="rtl"] .premium-list li { padding-left: 0; padding-right: 18px; }
body[dir="rtl"] .premium-list li::before { left: auto; right: 0; }
body[dir="rtl"] .rec-dot { margin-right: 0; margin-left: 7px; }
body[dir="rtl"] .modal-x { right: auto; left: 16px; }

@media (max-width: 560px) {
  .voice-item { flex-direction: column; align-items: stretch; }
  .vactions { justify-content: flex-end; }
  .notif-panel { width: 300px; }
}
