/* Custom Premium CSS for Taboo Cluster */

/* Root Custom Properties & Reset */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  
  /* Shared Base Palette */
  --bg-dark: #060309;
  --bg-glass: rgba(15, 8, 22, 0.75);
  --border-glass: rgba(168, 85, 247, 0.15);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Default/Active Theme (Changes dynamically per engine in React App) */
  --theme-color: #a855f7;
  --theme-color-glow: rgba(168, 85, 247, 0.4);
  --theme-gradient: linear-gradient(135deg, #a855f7 0%, #ff4cff 100%);
  
  /* Engine-specific Color Themes (Used as CSS custom states) */
  --color-confession: #ec4899;
  --color-secret: #8b5cf6;
  --color-shame: #14b8a6;
  --color-desire: #f97316;
  --color-regret: #3b82f6;
  --color-forgiveness: #eab308;
  --color-boundary: #ef4444;
  --color-debris: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100-vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 76, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(15, 8, 22, 0.5) 0%, #060309 100%);
  background-attachment: fixed;
  line-height: 1.5;
}

/* Base Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--theme-color);
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  font-weight: 700;
}

/* Page Container Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Header styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .app-header {
    flex-direction: column;
    text-align: center;
  }
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.1);
  transition: all 0.5s ease;
}

.logo-icon svg {
  stroke: var(--theme-color);
  transition: all 0.5s ease;
}

.brand-title {
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, var(--theme-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.5s ease;
}

.brand-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Top Dashboard Statistics */
.header-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  padding-right: 2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  text-align: right;
}

.stat-item:last-child {
  border-right: none;
  padding-right: 0;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 1.5rem;
  align-items: start;
  flex: 1;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 280px 1fr;
  }
  .right-column {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .left-column, .right-column, .center-column {
    grid-column: span 1 !important;
  }
}

/* Premium Card Components (Glassmorphism) */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  position: relative;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--theme-color), transparent);
  opacity: 0.3;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.05);
}

.card-title {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

/* Engine Selector list */
.engine-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.engine-btn {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
}

.engine-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.engine-btn.active {
  color: var(--text-primary);
  border-color: var(--theme-color);
  background: radial-gradient(circle at 0% 50%, var(--theme-color-glow) 0%, transparent 60%);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(168, 85, 247, 0.15);
}

.engine-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.engine-name {
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-heading);
}

.engine-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.engine-btn.active .engine-tag {
  color: var(--theme-color);
}

.engine-virality {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.35rem;
  padding: 0.2rem 0.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.engine-btn.active .engine-virality {
  background: var(--theme-color-glow);
  border-color: var(--theme-color);
  color: white;
}

/* Center Ritual Column */
.ritual-card {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ritual-details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.ritual-meta {
  display: flex;
  flex-direction: column;
}

.ritual-title {
  font-size: 1.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ritual-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.ritual-badge {
  background: var(--theme-color-glow);
  border: 1px solid var(--theme-color);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  box-shadow: 0 0 10px var(--theme-color-glow);
}

/* Form controls */
.ritual-input-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.ritual-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.ritual-textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 0.85rem;
  padding: 1.25rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  resize: none;
  min-height: 140px;
  flex: 1;
  transition: all 0.3s ease;
}

.ritual-textarea:focus {
  border-color: var(--theme-color);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 15px var(--theme-color-glow);
}

.ritual-actions {
  display: flex;
  gap: 1rem;
}

.btn-premium {
  flex: 1;
  background: var(--theme-gradient);
  border: none;
  border-radius: 0.85rem;
  padding: 1rem;
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px var(--theme-color-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-premium:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--theme-color-glow);
  filter: brightness(1.1);
}

.btn-premium:active:not(:disabled) {
  transform: translateY(0);
}

.btn-premium:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Simulated Result / Output Card */
.ritual-output-box {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(20, 10, 30, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
  animation: slideUp 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.ritual-output-box::before {
  content: 'RITUAL METAMORPHOSIS OUTPUT';
  position: absolute;
  top: -8px;
  left: 20px;
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.55rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--theme-color);
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.reframing-message {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: #f1f5f9;
  font-style: italic;
}

.reframing-action-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Monetization / Tip Jar Component */
.monetization-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.micro-payment-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 0.85rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}

.micro-payment-card:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--theme-color);
}

.payment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--theme-color);
  background: var(--theme-color-glow);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.payment-price {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.payment-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin-top: 0.5rem;
}

.payment-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.25rem;
  flex-grow: 1;
}

.btn-payment {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.5rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.75rem;
  transition: all 0.3s ease;
}

.btn-payment:hover:not(:disabled) {
  background: var(--theme-color);
  border-color: var(--theme-color);
  box-shadow: 0 0 10px var(--theme-color-glow);
}

/* Interlock Network Map SVG Container */
.network-map-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.network-svg {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  margin: 1rem 0;
}

.network-node {
  cursor: pointer;
  transition: all 0.3s ease;
}

.network-node circle {
  fill: #130a1c;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1.5;
  transition: all 0.3s ease;
}

.network-node:hover circle, .network-node.active circle {
  stroke: var(--node-color, var(--theme-color));
  stroke-width: 3px;
  filter: drop-shadow(0 0 8px var(--node-color-glow, var(--theme-color-glow)));
}

.network-node text {
  fill: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.network-node.active text {
  fill: white;
  font-weight: 800;
}

.network-link {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 2;
  transition: all 0.5s ease;
}

.network-link.active-loop {
  stroke: var(--theme-color);
  stroke-width: 3.5;
  stroke-dasharray: 5,5;
  animation: dash 15s linear infinite;
  filter: drop-shadow(0 0 4px var(--theme-color-glow));
}

@keyframes dash {
  to {
    stroke-dashoffset: -100;
  }
}

/* Telemetry Stream Logger styling */
.telemetry-section {
  grid-column: span 3;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1200px) {
  .telemetry-section {
    grid-column: span 2;
  }
}
@media (max-width: 900px) {
  .telemetry-section {
    grid-column: span 1;
  }
}

.telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.telemetry-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulse 2s infinite ease-in-out;
}

.status-dot.pulsing {
  background-color: var(--theme-color);
  transform: scale(1.3);
  box-shadow: 0 0 10px var(--theme-color);
}

.telemetry-badge {
  font-size: 0.6rem;
  font-family: var(--font-heading);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: #a855f7;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.telemetry-logs-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 0.85rem;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.75rem;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.telemetry-row {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.01);
  align-items: center;
}

.telemetry-row:last-child {
  border-bottom: none;
}

.telemetry-time {
  color: #64748b;
  flex-shrink: 0;
}

.telemetry-type-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--badge-color, var(--text-muted));
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.telemetry-message {
  color: #cbd5e1;
}

.telemetry-noi {
  margin-left: auto;
  font-weight: 700;
  color: #10b981;
}

/* Footer Styling */
.app-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.7rem;
  color: #475569;
}

.app-footer a {
  color: var(--theme-color);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* General Animations */
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modals & Overlays (Stripe Simulated Checkout) */
.checkout-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.checkout-modal {
  width: 100%;
  max-width: 460px;
  background: #0d0914;
  border: 1px solid var(--theme-color);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.25);
  border-radius: 1.25rem;
  padding: 2rem;
  animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.checkout-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-title {
  font-size: 1.25rem;
  color: white;
  font-family: var(--font-heading);
}

.checkout-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.checkout-close-btn:hover {
  color: white;
}

.checkout-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checkout-summary-row.total {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

.stripe-sim-card {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 0.85rem;
}

.sim-input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.35rem;
  padding: 0.5rem;
  color: white;
  width: 100%;
  margin-top: 0.5rem;
  outline: none;
  font-family: monospace;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
