/* ============================================
   J.A.R.V.I.S. v3.0 — Interplanetary HUD
   Tony Stark Workshop / Holographic Layer
   Inspirado em: Jayse Hansen FUI / MCU Iron Man HUD
   ============================================ */

:root {
  --gold-warm: #ffb347;
  --magenta-accent: #ff2e8a;
  --plasma: #00ffe5;
  --deep-space: #00060e;
  --hologram: rgba(0, 212, 255, 0.08);
  --reactor-red: #ff1744;
}

/* === STAR FIELD (interplanetário) === */
.hud-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 23%, rgba(255,255,255,0.6) 50%, transparent),
    radial-gradient(1px 1px at 30% 67%, rgba(0,212,255,0.7) 50%, transparent),
    radial-gradient(1px 1px at 47% 12%, rgba(255,255,255,0.5) 50%, transparent),
    radial-gradient(1.5px 1.5px at 62% 89%, rgba(255,255,255,0.7) 50%, transparent),
    radial-gradient(1px 1px at 78% 34%, rgba(0,212,255,0.5) 50%, transparent),
    radial-gradient(1px 1px at 91% 56%, rgba(255,255,255,0.6) 50%, transparent),
    radial-gradient(1px 1px at 5% 78%, rgba(255,255,255,0.4) 50%, transparent),
    radial-gradient(1px 1px at 22% 92%, rgba(0,212,255,0.6) 50%, transparent),
    radial-gradient(1.5px 1.5px at 56% 41%, rgba(255,255,255,0.8) 50%, transparent),
    radial-gradient(1px 1px at 84% 18%, rgba(0,212,255,0.5) 50%, transparent);
  animation: starsTwinkle 8s ease-in-out infinite;
}

@keyframes starsTwinkle {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* === ORBITAL RINGS NO BACKGROUND === */
.orbit-ring {
  position: fixed;
  border-radius: 50%;
  border: 1px dashed rgba(0, 212, 255, 0.12);
  pointer-events: none;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.orbit-ring-1 { width: 80vmin; height: 80vmin; animation: orbitRot 60s linear infinite; }
.orbit-ring-2 { width: 110vmin; height: 110vmin; animation: orbitRot 90s linear infinite reverse; border-style: dotted; opacity: 0.6; }
.orbit-ring-3 { width: 140vmin; height: 140vmin; animation: orbitRot 120s linear infinite; opacity: 0.4; }

@keyframes orbitRot {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === REACTOR ORBITAL SVG HUD === */
.reactor-orbital-hud {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: 110%;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
}
.orbit-rotate-slow { animation: rotSlow 40s linear infinite; transform-origin: 300px 300px; transform-box: fill-box; }
.orbit-rotate-rev  { animation: rotSlow 30s linear infinite reverse; transform-origin: 300px 300px; transform-box: fill-box; }
@keyframes rotSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.reticle-pulse { animation: reticleP 3s ease-in-out infinite; }
@keyframes reticleP {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.orbital-ticks line {
  filter: drop-shadow(0 0 1px #00d4ff);
}

.center-reactor {
  position: relative;
}

/* === LISTENER BADGE (header) === */
.listener-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #00d4ff;
  background: rgba(0, 30, 50, 0.4);
  transition: all 0.2s;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}
.listener-badge i { font-size: 12px; }
.listener-badge.listening {
  border-color: rgba(0, 212, 255, 0.6);
  color: #00d4ff;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}
.listener-badge.listening i {
  animation: listenPulse 1.4s ease-in-out infinite;
}
.listener-badge.awake {
  border-color: rgba(255, 217, 0, 0.7);
  color: #ffd700;
  background: rgba(60, 50, 0, 0.4);
  box-shadow: 0 0 16px rgba(255, 217, 0, 0.4);
}
.listener-badge.processing {
  border-color: rgba(0, 255, 136, 0.7);
  color: #00ff88;
  background: rgba(0, 60, 30, 0.4);
}
.listener-badge.off {
  border-color: rgba(255, 0, 64, 0.5);
  color: #ff4477;
  opacity: 0.6;
}
@keyframes listenPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* === PROJECTS MINI LIST (card direita) === */
.hud-card-action {
  background: none;
  border: none;
  color: rgba(0, 212, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}
.hud-card-action:hover {
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.15);
}

.projects-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}
.project-mini-item {
  padding: 8px 10px;
  background: rgba(0, 40, 70, 0.3);
  border-left: 2px solid #00d4ff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
}
.project-mini-item:hover {
  background: rgba(0, 60, 100, 0.5);
  border-left-color: #5fffff;
  transform: translateX(2px);
}
.project-mini-item .pm-name {
  color: #b0e8ff;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.project-mini-item .pm-meta {
  font-size: 10px;
  color: rgba(0, 212, 255, 0.6);
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.project-mini-item .pm-status {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.2);
  text-transform: uppercase;
  font-size: 9px;
}

.new-project-btn {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, rgba(255, 46, 138, 0.15), rgba(0, 212, 255, 0.15));
  border: 1px dashed rgba(0, 212, 255, 0.4);
  color: #00d4ff;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-size: 11px;
  transition: all 0.2s;
}
.new-project-btn:hover {
  border-color: #00d4ff;
  background: linear-gradient(135deg, rgba(255, 46, 138, 0.25), rgba(0, 212, 255, 0.25));
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

/* ============================================
   PROJECTS WORKSPACE (Claude Modal Full)
   ============================================ */

.projects-workspace {
  position: fixed;
  inset: 0;
  background: rgba(0, 6, 14, 0.96);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: pwFadeIn 0.4s ease-out;
}
.projects-workspace.hidden { display: none; }

@keyframes pwFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Adiciona background HUD próprio na workspace */
.projects-workspace::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 46, 138, 0.08), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.08), transparent 50%),
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 50px 50px, 50px 50px;
  pointer-events: none;
}

.pw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.25);
  background: linear-gradient(180deg, rgba(0, 30, 50, 0.7), transparent);
  position: relative;
  z-index: 1;
}
.pw-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pw-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff2e8a, #00d4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 0 28px rgba(255, 46, 138, 0.5), 0 0 18px rgba(0, 212, 255, 0.4);
  animation: pwLogoSpin 12s linear infinite;
}
@keyframes pwLogoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.pw-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #00d4ff;
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}
.pw-sub {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(0, 212, 255, 0.7);
  text-transform: uppercase;
  margin-top: 2px;
}

.pw-body {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* === PROJECT SIDEBAR === */
.pw-sidebar {
  border-right: 1px solid rgba(0, 212, 255, 0.2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: rgba(0, 10, 20, 0.4);
}
.pw-new-btn {
  padding: 12px;
  background: linear-gradient(135deg, #ff2e8a, #d4145a);
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(255, 46, 138, 0.4);
  transition: all 0.2s;
}
.pw-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255, 46, 138, 0.6);
}
.pw-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pw-list-item {
  padding: 12px 14px;
  background: rgba(0, 30, 50, 0.5);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.pw-list-item:hover {
  border-color: #00d4ff;
  background: rgba(0, 50, 80, 0.6);
  transform: translateX(3px);
}
.pw-list-item.active {
  border-color: #ff2e8a;
  background: rgba(80, 0, 40, 0.4);
  box-shadow: -3px 0 0 #ff2e8a, 0 0 12px rgba(255, 46, 138, 0.25);
}
.pw-list-item .pli-name {
  font-weight: 700;
  color: #b0e8ff;
  font-size: 14px;
  letter-spacing: 0.5px;
}
.pw-list-item .pli-meta {
  font-size: 10.5px;
  color: rgba(0, 212, 255, 0.65);
  margin-top: 4px;
  display: flex;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pw-list-item .pli-status {
  padding: 1px 7px;
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.2);
  font-size: 9.5px;
}
.pw-list-item .pli-progress {
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: rgba(0, 212, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
.pw-list-item .pli-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--p, 0%);
  background: linear-gradient(90deg, #00d4ff, #5fffff);
  box-shadow: 0 0 6px #00d4ff;
}
.pw-empty {
  text-align: center;
  color: rgba(0, 212, 255, 0.45);
  padding: 30px 10px;
  font-size: 12px;
  font-style: italic;
}

/* === PROJECT MAIN AREA === */
.pw-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pw-project-info {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  background: rgba(0, 15, 25, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pw-project-info.hidden { display: none; }

.pw-project-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pw-project-name {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.4);
  font-size: 20px;
  font-weight: 700;
  color: #5fffff;
  padding: 6px 4px;
  outline: none;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1.5px;
}
.pw-project-name:focus {
  border-bottom-color: #00d4ff;
  box-shadow: 0 1px 0 #00d4ff;
}
.pw-project-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pw-select {
  padding: 6px 10px;
  background: rgba(0, 30, 50, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  border-radius: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.pw-save-btn, .pw-delete-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.pw-save-btn {
  background: linear-gradient(135deg, #00d4ff, #0088ff);
  color: #001020;
}
.pw-save-btn:hover { box-shadow: 0 0 14px rgba(0, 212, 255, 0.6); }
.pw-delete-btn {
  background: rgba(255, 23, 68, 0.2);
  color: #ff4477;
  border: 1px solid rgba(255, 23, 68, 0.4);
}
.pw-delete-btn:hover { background: rgba(255, 23, 68, 0.4); }

.pw-textarea {
  width: 100%;
  background: rgba(0, 30, 50, 0.4);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: #b0e8ff;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: all 0.2s;
}
.pw-textarea:focus {
  border-color: #00d4ff;
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.3);
  background: rgba(0, 40, 60, 0.6);
}
.pw-label {
  font-size: 11px;
  color: #00d4ff;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.pw-blueprint-wrap, .pw-milestones-wrap {
  display: flex;
  flex-direction: column;
}

/* === CLAUDE CHAT === */
.pw-claude-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0, 10, 20, 0.5), rgba(0, 5, 12, 0.7));
}
.pw-claude-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  background: rgba(0, 20, 35, 0.6);
}
.pw-claude-header > i:first-child {
  font-size: 28px;
  background: linear-gradient(135deg, #ff2e8a, #00d4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pw-claude-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 3px;
  color: #ff2e8a;
  font-size: 16px;
  text-shadow: 0 0 8px rgba(255, 46, 138, 0.4);
}
.pw-claude-tag {
  font-size: 10px;
  color: rgba(0, 212, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.pw-claude-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #00ff88;
  letter-spacing: 1px;
}
.pw-claude-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pw-claude-welcome {
  text-align: center;
  padding: 40px 20px;
  color: rgba(0, 212, 255, 0.85);
}
.pw-claude-welcome i {
  font-size: 56px;
  background: linear-gradient(135deg, #ff2e8a, #00d4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
  display: inline-block;
}
.pw-claude-welcome h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  margin: 8px 0 12px;
  color: #b0e8ff;
  letter-spacing: 1px;
}
.pw-claude-welcome p {
  max-width: 540px;
  margin: 0 auto 20px;
  line-height: 1.6;
  color: rgba(176, 232, 255, 0.85);
  font-size: 14px;
}
.pw-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto;
}
.pw-sug-btn {
  padding: 8px 14px;
  background: rgba(0, 40, 70, 0.5);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #b0e8ff;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.pw-sug-btn:hover {
  background: rgba(0, 60, 100, 0.7);
  border-color: #ff2e8a;
  color: #ffd0e8;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 46, 138, 0.25);
}

.pw-msg {
  display: flex;
  gap: 12px;
  animation: pwMsgIn 0.3s ease-out;
}
@keyframes pwMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.pw-msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.pw-msg.user .pw-msg-avatar {
  background: linear-gradient(135deg, #00d4ff, #0088ff);
  color: #001020;
}
.pw-msg.assistant .pw-msg-avatar {
  background: linear-gradient(135deg, #ff2e8a, #d4145a);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 46, 138, 0.5);
}
.pw-msg-content {
  flex: 1;
  background: rgba(0, 30, 50, 0.5);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 12px 16px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  color: #d0eaff;
  font-size: 13.5px;
  line-height: 1.6;
}
.pw-msg.user .pw-msg-content {
  background: rgba(0, 60, 100, 0.4);
  border-color: rgba(0, 212, 255, 0.4);
}
.pw-msg.assistant .pw-msg-content {
  background: linear-gradient(135deg, rgba(80, 0, 40, 0.2), rgba(0, 30, 50, 0.5));
  border-color: rgba(255, 46, 138, 0.3);
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
}
.pw-msg-content strong {
  color: #5fffff;
  font-weight: 700;
}
.pw-msg-content code {
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12.5px;
  color: #5fffff;
}

.pw-claude-input-wrap {
  padding: 14px 20px;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(0, 10, 20, 0.7);
}
.pw-claude-input {
  flex: 1;
  background: rgba(0, 30, 50, 0.5);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #b0e8ff;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 120px;
  transition: all 0.2s;
}
.pw-claude-input:focus {
  border-color: #ff2e8a;
  box-shadow: 0 0 0 1px rgba(255, 46, 138, 0.3);
}
.pw-claude-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ff2e8a, #00d4ff);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 14px rgba(255, 46, 138, 0.4);
}
.pw-claude-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 22px rgba(255, 46, 138, 0.6);
}
.pw-claude-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === GLASSMORPHISM nos cards (refinamento) === */
.hud-card {
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 900px) {
  .pw-body {
    grid-template-columns: 1fr;
  }
  .pw-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    max-height: 200px;
  }
  .reactor-orbital-hud { display: none; }
}
