/* css/styles.css
   GhostAI Labs — unified dark theme + plexus-safe background + navbar + page helpers

   FIXES INCLUDED:
   - Removes duplicate/conflicting blocks from your pasted CSS
   - Adds real vertical spacing under "Generate Voice" area (no more bunched UI)
   - Ensures #audioActions (Download) is visible + spaced when JS removes d-none
   - Keeps Bootstrap layout intact (no table-like collapsing)
*/

/* ----------------------------
   Theme variables
---------------------------- */
:root{
  --panel-bg: rgba(30,30,30,0.92);
  --panel-border: rgba(255,255,255,0.14);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);

  --bg0: #000;
  --bg1: #05070c;

  --radius-lg: 16px;
  --radius-md: 12px;

  --focus: rgba(0,123,255,0.35);
  --focus-strong: rgba(0,123,255,0.55);

  --shadow-soft: 0 10px 26px rgba(0,0,0,0.14);
}

/* ----------------------------
   Base reset / safety
---------------------------- */
html, body{ height: 100%; }

*,
*::before,
*::after{ box-sizing: border-box; }

body,
body.app-body{
  margin: 0;
  padding: 0;
  background: var(--bg0) !important;
  color: var(--text);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

/* Prevent accidental horizontal scroll from media */
img, svg, video, canvas{
  max-width: 100%;
  height: auto;
}

/* Keep wrappers transparent (don’t override bootstrap components) */
header, main, footer, nav, section{
  background: transparent;
}

/* Bootstrap containers should never paint white blocks */
.container,
.container-fluid{
  background: transparent !important;
}

/* Focus: remove default outlines, replace with consistent ring where we set it */
:focus{ outline: none; }

/* Better selection on dark */
::selection{
  background: rgba(0,123,255,0.25);
}

/* ----------------------------
   Plexus background layer
---------------------------- */
.plexus-container{
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg0);
}

/* Canvas fills viewport; JS should set pixel width/height */
#plexus-canvas,
canvas.plexus{
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Content above plexus */
.app-main{
  position: relative;
  z-index: 1;
}

/* ----------------------------
   Navbar (Ghost style)
---------------------------- */
.navbar-ghost{
  background: rgba(0,0,0,0.88) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Only apply body padding when you opt-in */
body.has-fixed-nav{
  padding-top: 74px;
}
@media (max-width: 991.98px){
  body.has-fixed-nav{ padding-top: 66px; }
}

.navbar-ghost .navbar-brand{
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.95) !important;
  padding: .35rem 0;
}

.navbar-ghost .brand-mark{
  font-size: 1.15rem;
  margin-right: 8px;
  line-height: 1;
}

.navbar-ghost .brand-badge{
  margin-left: 10px;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,123,255,0.35);
  color: rgba(170,210,255,0.95);
  background: rgba(0,123,255,0.12);
}

.navbar-ghost .nav-link{
  color: rgba(255,255,255,0.82) !important;
  padding: .48rem .62rem;
  margin: 0 2px;
  border-radius: 10px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  font-size: 0.98rem;
}

.navbar-ghost .nav-link:hover,
.navbar-ghost .nav-link:focus{
  color: rgba(255,255,255,0.95) !important;
  background: rgba(0,123,255,0.12);
}

.navbar-ghost .nav-link.active,
.navbar-ghost .nav-item.active .nav-link{
  color: rgba(255,255,255,0.98) !important;
  background: rgba(0,123,255,0.18);
  box-shadow: 0 0 0 1px rgba(0,123,255,0.20) inset;
}

.navbar-ghost .nav-divider{
  width: 1px;
  height: 26px;
  margin: 0 10px;
  background: rgba(255,255,255,0.12);
}

.navbar-ghost .nav-ico{
  display: inline-block;
  margin-right: 7px;
  line-height: 1;
}

.navbar-ghost .nav-cta{
  margin-left: 6px;
  border-radius: 10px;
  padding: .42rem .78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.navbar-ghost .btn-info{
  background: rgba(0,123,255,0.95);
  border-color: rgba(0,123,255,0.95);
  box-shadow: 0 8px 22px rgba(0,123,255,0.15);
}

.navbar-ghost .btn-info:hover,
.navbar-ghost .btn-info:focus{
  background: rgba(0,98,204,1);
  border-color: rgba(0,98,204,1);
  box-shadow: 0 10px 26px rgba(0,123,255,0.18);
}

.navbar-ghost .btn-outline-info{
  color: rgba(170,210,255,0.95);
  border-color: rgba(0,123,255,0.55);
  background: rgba(0,123,255,0.10);
}

.navbar-ghost .btn-outline-info:hover,
.navbar-ghost .btn-outline-info:focus{
  color: rgba(255,255,255,0.98);
  background: rgba(0,123,255,0.22);
  border-color: rgba(0,123,255,0.75);
}

.navbar-ghost .navbar-toggler{
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 12px;
  padding: .35rem .55rem;
}

.navbar-ghost .navbar-toggler:focus{
  box-shadow: 0 0 0 0.2rem var(--focus);
}

/* Tighten nav so it stays one row on desktop; wrap on smaller */
.navbar-ghost .nav-tight{ flex-wrap: nowrap; }
@media (max-width: 1199.98px){
  .navbar-ghost .nav-tight{ flex-wrap: wrap; }
}

@media (max-width: 991.98px){
  .navbar-ghost .navbar-collapse{
    background: rgba(0,0,0,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 10px;
    margin-top: 10px;
  }
  .navbar-ghost .nav-link{ padding: .65rem .8rem; }
}

/* ----------------------------
   Header
---------------------------- */
.header-container{
  position: relative;
  z-index: 1;
  background: #000 !important;
  color: #fff;
  padding: 70px 20px;
}

.header-inner{
  max-width: 980px;
  margin: 0 auto;
}

/* ----------------------------
   Titles / section helpers
---------------------------- */
.make-title{
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 2.2rem 0 1.6rem;
}

.section-title{
  color: #fff;
  font-weight: 800;
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.stack-gap{ margin-top: 14px; }

.text-muted-lite{ color: var(--muted) !important; }

.provider-substatus{
  margin-top: 8px;
  font-size: .95rem;
  color: var(--muted);
}

/* Your original had a negative top margin; that contributes to “bunched” UI.
   Keep it normal and let panels handle spacing. */
.char-count{
  font-size: 1.05rem;
  color: #aaa;
  margin: 0;
}

/* ----------------------------
   Panels
---------------------------- */
.panel{
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.panel + .panel{ margin-top: 16px; }

#console, #voiceConsole{
  min-height: 60px;
  border-radius: 10px;
  padding: 14px;
}

/* ----------------------------
   Inputs / selects
---------------------------- */
.form-control{
  background-color: rgba(255,255,255,0.95);
  color: #111;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
}

.form-control:focus{
  box-shadow: 0 0 0 0.2rem var(--focus);
  border-color: var(--focus-strong);
}

/* Bootstrap 4 doesn’t have .form-select; you’re using it anyway.
   Keep it, but don’t let it collapse inside flex layouts. */
.form-select{
  display: inline-block;
  width: auto;
  padding: .5rem 2.25rem .5rem .75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: .3rem;
}

input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-text-fill-color: #111 !important;
  -webkit-box-shadow: 0 0 0px 1000px rgba(255,255,255,0.95) inset !important;
  box-shadow: 0 0 0px 1000px rgba(255,255,255,0.95) inset !important;
}

textarea[readonly],
input[readonly]{
  background: rgba(255,255,255,0.95) !important;
  color: #111 !important;
}

/* ----------------------------
   Pills
---------------------------- */
.remaining-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,43,43,0.10);
  border: 1px solid rgba(255,43,43,0.35);
  margin-left: 10px;
}
.remaining-dot{
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #ff2b2b;
  box-shadow: 0 0 10px rgba(255,43,43,0.6);
}
.remaining-count{
  font-size: 1.05rem;
  font-weight: 800;
  color: #ff2b2b;
  text-shadow: 0 0 12px rgba(255,43,43,0.25);
  white-space: nowrap;
}

.voice-quota-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(40,167,69,0.10);
  border: 1px solid rgba(40,167,69,0.35);
}
.voice-quota-dot{
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #28a745;
  box-shadow: 0 0 10px rgba(40,167,69,0.45);
}
.voice-quota-count{
  font-size: 1.05rem;
  font-weight: 800;
  color: #28a745;
  white-space: nowrap;
}
.voice-quota-sub{
  margin-top: 8px;
  font-size: .92rem;
  color: rgba(255,255,255,0.75);
}

/* ----------------------------
   Buttons / layout fixes
---------------------------- */
.btn-row{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 8px;
}

.btn-row .btn{
  margin: 0 !important;
  min-width: 190px;
  padding: 12px 18px;
  border-radius: 10px;
}

.btn.btn-sm{
  border-radius: 10px;
}

/* Emotion buttons */
.emo-btns .btn{
  margin: 6px;
  min-width: 120px;
}
.emo-btns .btn.active{
  box-shadow: 0 0 0 .2rem rgba(255,255,255,0.15);
}

.emo-weight-row label{
  color: rgba(255,255,255,0.85);
  margin-bottom: 6px;
}
.emo-weight-value{
  color: #fff;
  font-weight: 800;
  margin-left: 10px;
}
.emo-hint{
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ----------------------------
   VOICE AREA — spacing fixes (this is the “bunched” fix)
---------------------------- */

/* The select + button row */
.voice-row{
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 10px; /* creates breathing room below button row */
}

/* Ensure the select doesn't shrink weirdly */
.voice-row .form-select{
  min-width: 240px;
}

/* Add a little padding so the button doesn't look jammed */
#generateVoiceButton{
  padding: 12px 26px;
  border-radius: 12px;
}

/* Give the console and audio area real separation */
#voiceConsole{
  margin-top: 14px !important;
  margin-bottom: 0 !important;
}

/* Audio player spacing */
#audioPlayer{
  margin-top: 14px;
  width: 100%;
  max-width: 760px;
}

/* Download/actions spacing (visible when JS removes d-none) */
#audioActions{
  width: 100%;
  max-width: 760px;
  margin: 14px auto 0;
  padding-top: 6px; /* this is your “<br>” but cleaner */
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

#audioActions .btn{
  border-radius: 12px;
  padding: 10px 18px;
}

#audioActions .audio-fn{
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  opacity: 0.9;
}

/* If something is forcing a table-like layout, this prevents it from collapsing. */
.voice-row,
#audioActions{
  min-height: 1px;
}

/* ----------------------------
   Footer (do NOT fix to viewport)
---------------------------- */
.footer{
  position: static !important;
  width: 100%;
  background-color: #000;
  color: #fff;
  padding: 14px 0;
}

/* ----------------------------
   Frame/gradient prevention (SAFE)
---------------------------- */
.header-container,
.panel,
.footer,
.navbar-ghost,
.plexus-container{
  background-image: none !important;
}

/* ----------------------------
   Article Studio helpers
---------------------------- */
.wip-badge{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.35);
}

.wip-pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(40,167,69,0.35);
  background: rgba(40,167,69,0.10);
  color: rgba(200,255,220,0.92);
  font-size: .85rem;
}

.card-lite{
  background:#fff;
  color:#111;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow-soft);
}

.card-lite h1,
.card-lite h2,
.card-lite h3,
.card-lite h4,
.card-lite h5{
  color:#111;
}

.card-lite .text-muted{
  color:#555 !important;
}

/* Make Bootstrap table + list group text readable on white */
.card-lite .table,
.card-lite .table th,
.card-lite .table td{
  color:#111 !important;
}

.card-lite .list-group-item{
  border-color: rgba(0,0,0,0.10);
}

.tag-chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.12);
  background: rgba(0,123,255,0.08);
  color:#0b2545;
  font-weight:700;
  font-size:.85rem;
}

.card-lite code{
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 8px;
  color: #0b2545;
}

/* WIP overlay for disabled mock UIs */
.wip-overlay{
  position:absolute;
  inset: 52px 18px 18px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.72));
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 18px;
  pointer-events: none;
}

.wip-overlay-inner{ max-width: 520px; }

.wip-overlay-title{
  font-size: 1.25rem;
  font-weight: 800;
  color: rgba(255,255,255,0.95);
}

.wip-overlay-sub{
  margin-top: 6px;
  color: rgba(255,255,255,0.78);
}

/* Simple pipeline styling */
.pipeline-step{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin: 10px 0;
}

.dot{
  width:10px;
  height:10px;
  border-radius:999px;
  margin-top: 6px;
}
.dot-live{ background:#28a745; box-shadow:0 0 12px rgba(40,167,69,0.35); }
.dot-wip{ background:#ffc107; box-shadow:0 0 12px rgba(255,193,7,0.25); }

.pipeline-title{ font-weight:800; color:#111; }
.pipeline-sub{ color:#333; font-size:.92rem; }

/* Preview typography (article demo) */
#previewBox h2, #previewBox h3{
  margin-top: 10px;
  margin-bottom: 8px;
}
#previewBox blockquote{
  border-left: 4px solid rgba(0,123,255,0.35);
  padding-left: 12px;
  color: #333;
  margin: 10px 0;
}
#previewBox pre{
  background: rgba(0,0,0,0.05);
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
}
#previewBox pre code{
  background: transparent;
  padding: 0;
}

/* Optional navbar padding helper */
.px-nav{
  padding-left: 18px;
  padding-right: 18px;
}
/* ============================
   Members CV page (panel-native)
============================ */

.cv-panel{
  padding: 18px;
}

/* top area */
.cv-top{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:flex-start;
  justify-content:space-between;
}

.cv-kicker{
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .78rem;
  color: rgba(255,255,255,0.70);
}

.cv-desc{
  margin-top: 8px;
  max-width: 760px;
  color: rgba(255,255,255,0.82);
  line-height: 1.55;
}

.cv-tags{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 12px;
}

.cv-tag{
  display:inline-flex;
  align-items:center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,123,255,0.35);
  background: rgba(0,123,255,0.10);
  color: rgba(210,235,255,0.95);
  font-weight: 800;
  font-size: .92rem;
  white-space: nowrap;
}

/* mini stats */
.cv-top-right{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}

.cv-mini{
  min-width: 140px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 12px;
}

.cv-mini-label{
  color: rgba(255,255,255,0.70);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cv-mini-value{
  margin-top: 6px;
  color: rgba(255,255,255,0.95);
  font-weight: 950;
}

/* main grid */
.cv-grid{
  display:grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 991.98px){
  .cv-grid{ grid-template-columns: 1fr; }
}

.cv-section-title{
  margin-bottom: 12px;
}

/* demo blocks */
.cv-demo{
  padding: 0;
}

.cv-demo-head{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cv-demo-kicker{
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .75rem;
  color: rgba(255,255,255,0.70);
}

.cv-demo-title{
  margin-top: 4px;
  font-weight: 950;
  font-size: 1.12rem;
  color: rgba(255,255,255,0.96);
}

.cv-demo-actions{
  display:flex;
  gap: 10px;
  align-items:center;
}

/* framed vertical embed so it looks intentional */
.cv-embed-wrap{
  width: 100%;
  display:flex;
  justify-content:center;
}

.cv-embed{
  position: relative;
  width: min(420px, 100%);
  padding-top: 177.78%; /* 9:16 */
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.45);
  box-shadow: 0 12px 26px rgba(0,0,0,0.25);
}

.cv-embed iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

/* divider */
.cv-hr{
  border: 0;
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 16px 0;
}

/* note */
.cv-note{
  margin-top: 12px;
  color: rgba(255,255,255,0.72);
  font-size: .92rem;
  line-height: 1.45;
}

/* prompt blocks */
.cv-prompt-block{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.cv-prompt-head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cv-prompt-title{
  font-weight: 950;
  color: rgba(255,255,255,0.92);
}

.cv-textarea{
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.95);
  color: #111;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92rem;
}

/* pipeline */
.cv-pipe{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.cv-step{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
}

.cv-step-dot{
  width:10px;
  height:10px;
  border-radius: 999px;
  margin-top: 6px;
  background: #28a745;
  box-shadow: 0 0 12px rgba(40,167,69,0.28);
}

.cv-step-title{
  font-weight: 950;
  color: rgba(255,255,255,0.92);
}

.cv-step-sub{
  margin-top: 2px;
  color: rgba(255,255,255,0.74);
  font-size: .92rem;
}

/* bottom actions */
.cv-actions-row{
  margin-top: 14px;
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}

/* toast */
.cv-toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(0,0,0,0.90);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 950;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  max-width: 92vw;
  text-align:center;
}
.cv-toast.show{ opacity: 1; }
