/* ============================================================
   PULSE CODING — Injected UI on Lovable page
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&family=Orbitron:wght@600;700&display=swap');

/* ============================================================
   Floating Badge
   ============================================================ */
#pc-badge {
  position: fixed !important;
  top: 9px !important;
  right: 270px !important;
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #e8e8e8;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#pc-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
}

#pc-badge:active {
  transform: translateY(0);
}

#pc-badge .pc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4A4A5A;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

#pc-badge .pc-label {
  font-family: 'Orbitron', sans-serif !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.15em;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

#pc-badge .pc-state {
  opacity: 0.9;
  min-width: 24px;
  text-align: right;
  font-weight: 700;
  font-size: 10px !important;
}

/* OFF State */
#pc-badge[data-state="off"] {
  border-color: rgba(255, 59, 59, 0.2);
}
#pc-badge[data-state="off"] .pc-dot {
  background: #FF3B3B;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.6), 0 0 16px rgba(255, 59, 59, 0.3);
}
#pc-badge[data-state="off"] .pc-state {
  color: #FF3B3B !important;
}

/* ON State */
#pc-badge[data-state="on"] {
  border-color: rgba(0, 255, 163, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 255, 163, 0.1);
}
#pc-badge[data-state="on"] .pc-dot {
  background: #00FFA3;
  box-shadow: 0 0 8px rgba(0, 255, 163, 0.7), 0 0 20px rgba(0, 255, 163, 0.35);
}
#pc-badge[data-state="on"] .pc-state {
  color: #00FFA3 !important;
}

/* NO LICENSE State */
#pc-badge[data-state="nolic"] {
  border-color: rgba(255, 59, 59, 0.3);
}
#pc-badge[data-state="nolic"] .pc-dot {
  background: #FF3B3B;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.6);
}
#pc-badge[data-state="nolic"] .pc-state {
  color: #FF3B3B !important;
}

/* Busy (loading) */
#pc-badge[data-busy="1"] .pc-dot {
  animation: pc-pulse 0.9s ease-in-out infinite;
}

@keyframes pc-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.4; }
}

/* Flash OK */
#pc-badge[data-flash="ok"] {
  color: #00FFA3;
  border-color: rgba(0, 255, 163, 0.35);
}
#pc-badge[data-flash="ok"] .pc-dot {
  background: #00FFA3;
  box-shadow: 0 0 8px rgba(0, 255, 163, 0.7);
}

/* Flash Error */
#pc-badge[data-flash="err"] {
  color: #FF3B3B;
  border-color: rgba(255, 59, 59, 0.35);
}

/* ============================================================
   Error Toast
   ============================================================ */
#pc-toast {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 2147483647 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #FF3B3B;
  border: 1px solid rgba(255, 59, 59, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 59, 59, 0.1);
  padding: 12px 16px;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 12px !important;
  max-width: 380px;
  line-height: 1.4;
  animation: pc-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pc-toast.pc-toast-out {
  animation: pc-slide-out 0.3s ease forwards;
}

#pc-toast .pc-toast-msg {
  flex: 1;
}

#pc-toast .pc-toast-retry {
  all: unset;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid rgba(255, 59, 59, 0.3);
  border-radius: 8px;
  background: transparent;
  color: #FF3B3B;
  cursor: pointer;
  transition: all 0.2s;
}
#pc-toast .pc-toast-retry:hover {
  background: rgba(255, 59, 59, 0.1);
  border-color: #FF3B3B;
}

#pc-toast .pc-toast-close {
  all: unset;
  cursor: pointer;
  color: #FF3B3B;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
#pc-toast .pc-toast-close:hover { opacity: 1; }

@keyframes pc-slide-in {
  from { transform: translateX(20px) translateY(10px); opacity: 0; }
  to { transform: translateX(0) translateY(0); opacity: 1; }
}

@keyframes pc-slide-out {
  to { transform: translateX(20px); opacity: 0; }
}

/* ============================================================
   Plan Confirmation Modal
   ============================================================ */
#pc-plan-confirm {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'Inter', -apple-system, sans-serif !important;
  animation: pc-fade-in 0.2s ease;
}

@keyframes pc-fade-in { from { opacity: 0; } to { opacity: 1; } }

#pc-plan-confirm .pc-pc-box {
  position: relative;
  background: linear-gradient(180deg, #111113 0%, #0A0A0B 100%);
  color: #e8e8e8;
  border: 1px solid rgba(162, 89, 255, 0.25);
  border-radius: 20px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(162, 89, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 28px 24px 24px;
  width: 92%;
  max-width: 420px;
  animation: pc-modal-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pc-modal-in {
  from { transform: translateY(16px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

#pc-plan-confirm .pc-pc-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: 0;
  color: #444;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 8px;
}
#pc-plan-confirm .pc-pc-close:hover {
  color: #FF3B3B;
  background: rgba(255, 59, 59, 0.08);
}

/* Header row: icon + title/subtitle */
#pc-plan-confirm .pc-pc-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

#pc-plan-confirm .pc-pc-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 230, 10, 0.12), rgba(255, 90, 0, 0.12));
  border: 1px solid rgba(255, 230, 10, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#pc-plan-confirm .pc-pc-icon-inner {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(255, 230, 10, 0.4));
}

#pc-plan-confirm .pc-pc-title {
  margin: 0;
  font-family: 'Inter', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  color: #f0f0f0;
  text-align: left;
}

#pc-plan-confirm .pc-pc-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}

/* Steps timeline */
#pc-plan-confirm .pc-pc-steps {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 4px 0;
  margin-bottom: 20px;
}

#pc-plan-confirm .pc-pc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

#pc-plan-confirm .pc-pc-step-divider {
  height: 1px;
  margin: 0 16px;
  background: rgba(255, 255, 255, 0.05);
}

#pc-plan-confirm .pc-pc-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  flex-shrink: 0;
}

#pc-plan-confirm .pc-pc-step-num-pulse {
  background: linear-gradient(135deg, rgba(162, 89, 255, 0.15), rgba(91, 140, 255, 0.15));
  border-color: rgba(162, 89, 255, 0.3);
  color: #A259FF;
}

#pc-plan-confirm .pc-pc-step-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#pc-plan-confirm .pc-pc-step-label {
  font-size: 13px;
  font-weight: 600;
  color: #ddd;
}

#pc-plan-confirm .pc-pc-step-detail {
  font-size: 11px;
  color: #777;
  line-height: 1.3;
}

#pc-plan-confirm .pc-pc-step-detail b {
  font-weight: 700;
}

#pc-plan-confirm .pc-pc-step:first-child .pc-pc-step-detail b {
  color: #FFE60A;
}

#pc-plan-confirm .pc-pc-step:last-child .pc-pc-step-detail b {
  color: #00FFA3;
}

#pc-plan-confirm .pc-pc-step-badge {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 5px;
  flex-shrink: 0;
}

#pc-plan-confirm .pc-pc-step-lovable {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #666;
}

#pc-plan-confirm .pc-pc-step-pulse {
  background: linear-gradient(135deg, rgba(255, 90, 0, 0.12), rgba(162, 89, 255, 0.12));
  border: 1px solid rgba(162, 89, 255, 0.2);
  color: #A259FF;
}

/* Action buttons */
#pc-plan-confirm .pc-pc-actions {
  display: flex;
  gap: 10px;
}

#pc-plan-confirm .pc-pc-btn {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #aaa;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#pc-plan-confirm .pc-pc-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #ddd;
}

#pc-plan-confirm .pc-pc-go {
  background: linear-gradient(135deg, #FF5A00, #FF2D55);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 20px rgba(255, 90, 0, 0.25);
}

#pc-plan-confirm .pc-pc-go:hover {
  box-shadow: 0 6px 28px rgba(255, 90, 0, 0.4);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

#pc-plan-confirm .pc-pc-btn:focus-visible {
  outline: 2px solid #A259FF;
  outline-offset: 2px;
}

/* ============================================================
   Pulse IA Tag (injected above processed chat bubbles)
   ============================================================ */
.pc-pulse-tag {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  margin: 8px 0 4px auto;
  background: linear-gradient(135deg, rgba(162, 89, 255, 0.08), rgba(91, 140, 255, 0.06));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(162, 89, 255, 0.2);
  border-radius: 20px;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 10px !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  width: fit-content;
  user-select: none;
  align-self: flex-end;
  margin-left: auto;
  animation: pc-tag-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: all 0.2s ease;
}

.pc-pulse-tag:hover {
  border-color: rgba(162, 89, 255, 0.4);
  background: linear-gradient(135deg, rgba(162, 89, 255, 0.12), rgba(91, 140, 255, 0.1));
  box-shadow: 0 2px 12px rgba(162, 89, 255, 0.15);
}

.pc-pulse-tag .pc-pulse-dot {
  font-size: 12px;
  line-height: 1;
  background: linear-gradient(135deg, #FF5A00, #FF2D55, #A259FF);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 3px rgba(162, 89, 255, 0.4));
  animation: pc-dot-shift 3s ease infinite;
}

.pc-pulse-tag span:last-child {
  background: linear-gradient(90deg, #c4a0ff, #8cb4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes pc-tag-in {
  from { transform: translateY(-6px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes pc-dot-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 200% 50%; }
}

