/* ==========================================================================
   Sangar UI Studio — Galería de Referencias & Prompts UI (Warm Studio OS)
   Layered on top of public/assets/app.css + styles.css
   ========================================================================== */

.components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: var(--sg-gap);
  margin-top: 8px;
}

@media (max-width: 640px) {
  .components-grid {
    grid-template-columns: 1fr;
  }
}

/* Component Container Card */
.component-showcase-card {
  background: var(--sg-bg-panel);
  border: 1px solid var(--sg-gris-12);
  border-radius: var(--sg-radius);
  overflow: hidden;
  box-shadow: var(--sg-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-fast);
}

.component-showcase-card:hover {
  border-color: var(--sg-coral-light);
  box-shadow: var(--sg-shadow-md);
}

.comp-card-header {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--sg-gris-12);
  background: var(--sg-bg-panel);
}

.comp-card-title {
  flex: 1;
  min-width: 200px;
}

.comp-card-title h3 {
  font-family: var(--sg-titular);
  font-size: 18px;
  font-weight: 700;
  color: var(--sg-negro);
  letter-spacing: -0.01em;
}

.comp-card-title p {
  font-size: 13px;
  color: var(--sg-gris-55);
  margin-top: 4px;
  line-height: 1.45;
}

/* Toggle Preview vs Code */
.comp-tabs-switch {
  display: inline-flex;
  background: var(--sg-bg-hover);
  padding: 4px;
  border-radius: var(--sg-radius-sm);
  border: 1px solid var(--sg-gris-12);
  flex-shrink: 0;
}

.comp-tab-btn {
  background: transparent;
  color: var(--sg-gris-55);
  border: none;
  padding: 6px 12px;
  font-family: var(--sg-texto);
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.comp-tab-btn:hover {
  color: var(--sg-negro);
}

.comp-tab-btn.active {
  background: var(--sg-bg-panel);
  color: var(--sg-coral);
  box-shadow: var(--sg-shadow-sm);
}

/* Preview Canvas Area (Intentional Dark Interactive Stage) */
.comp-preview-stage {
  color-scheme: dark;
  padding: 42px 24px;
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #131211;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 126, 103, 0.08) 0%, transparent 65%),
    linear-gradient(rgba(240, 236, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 236, 232, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px, 22px 22px;
  position: relative;
  overflow: hidden;
  color: #F0ECE8;
}

/* Code Panel Area (Dark Code Surface) */
.comp-code-stage {
  color-scheme: dark;
  display: none;
  background: #161413;
  color: #F0ECE8;
  padding: 18px 20px;
  min-height: 270px;
  max-height: 340px;
  overflow-y: auto;
  position: relative;
}

.comp-code-stage.active {
  display: block;
}

.code-subtabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.code-type-pill {
  font-size: 11px;
  font-family: var(--sg-mono);
  font-weight: 700;
  background: rgba(255, 126, 103, 0.16);
  color: #FF9E8A;
  padding: 3px 10px;
  border-radius: 999px;
}

.comp-code-stage .btn-copy-mini {
  background: #24211F;
  border-color: rgba(255, 255, 255, 0.12);
  color: #F0ECE8;
}

.comp-code-stage .btn-copy-mini:hover {
  border-color: #FF7E67;
  color: #FF9E8A;
}

.comp-code-block {
  font-family: var(--sg-mono);
  font-size: 12.5px;
  color: #EDE7DE;
  line-height: 1.55;
  white-space: pre-wrap;
  user-select: all;
}

/* Card Footer */
.comp-card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--sg-gris-12);
  background: var(--sg-bg-hover);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   LIVE INTERACTIVE COMPONENT DEMOS (Warm Studio OS Engine)
   ========================================================================== */

/* 1. Spotlight Card */
.comp-spotlight-card {
  position: relative;
  background: #1C1A18;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.65);
  transition: border-color 0.3s ease;
}

.comp-spotlight-card:hover {
  border-color: rgba(255, 126, 103, 0.5);
}

.comp-spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(350px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(255, 126, 103, 0.24), transparent 75%);
  pointer-events: none;
}

.spotlight-icon {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
}

.spotlight-content h3 {
  font-family: var(--sg-titular);
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.spotlight-content p {
  font-size: 13px;
  color: #A09890;
  line-height: 1.45;
  margin-bottom: 14px;
}

.spotlight-tag {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 126, 103, 0.16);
  color: #FF9E8A;
  padding: 4px 10px;
  border-radius: 999px;
}

/* 2. Border Beam */
.comp-border-beam-card {
  position: relative;
  background: #191716;
  border-radius: 16px;
  padding: 2px;
  border: 1px solid #2A2724;
  overflow: hidden;
  max-width: 320px;
  width: 100%;
}

.beam-glow {
  position: absolute;
  inset: -150%;
  background: conic-gradient(from 0deg, transparent 74%, #FF7E67 88%, #F0A26A 100%);
  animation: rotateBeam 4s linear infinite;
  pointer-events: none;
  opacity: 0.9;
}

@keyframes rotateBeam {
  to { transform: rotate(360deg); }
}

.beam-content {
  position: relative;
  z-index: 1;
  background: #191716;
  padding: 20px;
  border-radius: 14px;
}

.badge-cyan {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #FF9E8A;
  background: rgba(255, 126, 103, 0.15);
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 8px;
}

.beam-content h3 {
  font-family: var(--sg-titular);
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.beam-content p {
  font-size: 13px;
  color: #A09890;
  line-height: 1.45;
}

/* 3. Text Scramble */
.comp-text-scramble-box {
  text-align: center;
  padding: 20px;
}

.label-dim {
  display: block;
  font-size: 11px;
  color: #A09890;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.scramble-trigger {
  font-family: var(--sg-mono);
  font-size: 20px;
  font-weight: 700;
  color: #FF8E7A;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(255, 126, 103, 0.08);
  border: 1px dashed rgba(255, 126, 103, 0.4);
  display: inline-block;
  transition: all 0.2s ease;
}

.scramble-trigger:hover {
  background: rgba(255, 126, 103, 0.16);
  border-color: #FF7E67;
  box-shadow: 0 0 24px rgba(255, 126, 103, 0.28);
}

/* 4. Magnetic Button */
.comp-magnetic-wrapper {
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comp-magnetic-btn {
  background: linear-gradient(135deg, #FF7E67, #F2664D);
  color: #FFFFFF;
  border: none;
  padding: 14px 28px;
  border-radius: 9999px;
  font-family: var(--sg-texto);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.2s ease;
  box-shadow: 0 6px 24px rgba(255, 126, 103, 0.4);
  user-select: none;
}

.comp-magnetic-btn:hover {
  box-shadow: 0 10px 30px rgba(255, 126, 103, 0.55);
}

/* 5. macOS Dock */
.comp-dock-container {
  display: flex;
  justify-content: center;
  padding: 10px;
}

.comp-dock-bar {
  display: flex;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(36, 33, 31, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.dock-item {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #2C2826;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), background 0.2s;
  user-select: none;
}

.dock-item:hover {
  transform: scale(1.4) translateY(-10px);
  background: #3A3532;
  border-color: rgba(255, 126, 103, 0.45);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* 6. 3D Tilt Card */
.comp-tilt-card-wrapper {
  perspective: 1000px;
  display: flex;
  justify-content: center;
}

.comp-tilt-card {
  width: 290px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: #FFFFFF;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.tilt-card-badge {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #FF9E8A;
  background: rgba(255, 126, 103, 0.16);
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 8px;
}

.comp-tilt-card h3 {
  font-family: var(--sg-titular);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.comp-tilt-card p {
  font-size: 13px;
  color: #A09890;
  line-height: 1.45;
}

/* 7. Dynamic Island */
.comp-island-wrapper {
  display: flex;
  justify-content: center;
}

.comp-dynamic-island {
  background: #0B0A0A;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border-radius: 9999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  user-select: none;
}

.comp-dynamic-island.expanded {
  border-radius: 24px;
  padding: 18px 22px;
  width: 320px;
}

.island-collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.island-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5DBF8A;
  animation: pulse 1.5s infinite;
}

.island-wave {
  font-size: 11px;
  color: #FF8E7A;
  letter-spacing: 2px;
}

.island-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.track-art {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #FF7E67, #F0A26A);
  display: flex;
  align-items: center;
  justify-content: center;
}

.island-track-info strong {
  display: block;
  font-size: 14px;
}

.island-track-info span {
  font-size: 12px;
  color: #A09890;
}

.island-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.btn-ctrl {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.btn-ctrl:hover {
  opacity: 1;
}

/* 8. Shimmer Button */
.comp-shimmer-btn {
  position: relative;
  overflow: hidden;
  background: #1C1A18;
  color: #FFFFFF;
  border: 1px solid rgba(255, 126, 103, 0.35);
  border-radius: 12px;
  padding: 14px 28px;
  font-family: var(--sg-texto);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.comp-shimmer-btn:hover {
  border-color: #FF7E67;
  transform: translateY(-1px);
}

.shimmer-sweep {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 126, 103, 0.32), transparent);
  animation: shimmerAnim 2.5s infinite;
}

@keyframes shimmerAnim {
  100% { left: 100%; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Aurora & Shader Canvas Animations */
@keyframes floatAurora {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.15); }
}

@keyframes pulseShader {
  0% { opacity: 0.8; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.02); }
}

.comp-expansion-demo {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.comp-expansion-demo.is-expanded {
  background: linear-gradient(135deg, rgba(255, 126, 103, 0.25), rgba(18, 20, 30, 0.95)) !important;
  border-color: #FF7E67 !important;
  box-shadow: 0 0 25px rgba(255, 126, 103, 0.35) !important;
}

@media (prefers-reduced-motion: reduce) {
  .beam-glow,
  .shimmer-sweep,
  .island-dot,
  .comp-aurora-blob {
    animation: none !important;
  }
}

/* ==========================================================================
   SUITE SWITCHER: Sangar Studio Core vs. Sangar Motion Vault
   ========================================================================== */
.sg-suite-selector {
  display: inline-flex;
  gap: 6px;
  background: rgba(28, 25, 23, 0.85);
  border: 1px solid var(--sg-borde, rgba(255, 255, 255, 0.08));
  border-radius: 9999px;
  padding: 4px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}

.sg-suite-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  font-family: var(--sg-texto);
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-gris-70, #B8B0A8);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  text-decoration: none;
}

.sg-suite-pill:hover {
  color: var(--sg-blanco, #FFFFFF);
  background: rgba(255, 255, 255, 0.05);
}

.sg-suite-pill.is-active {
  background: var(--sg-coral, #FF7E67);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(255, 126, 103, 0.35);
}

.sg-suite-pill .badge-count {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}

/* ==========================================================================
   SANGAR MOTION VAULT SUITE (880 Components)
   ========================================================================== */
.moxen-controls {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.moxen-category-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
}

.moxen-category-scroll::-webkit-scrollbar {
  width: 5px;
}

.moxen-category-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.moxen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}

.moxen-card {
  background: var(--sg-tarjeta-bg, #1C1A18);
  border: 1px solid var(--sg-tarjeta-borde, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s, box-shadow 0.22s;
  position: relative;
}

.moxen-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 126, 103, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(255, 126, 103, 0.12);
}

.moxen-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #11100E;
  overflow: hidden;
  cursor: pointer;
}

.moxen-card__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.moxen-card:hover .moxen-card__poster {
  transform: scale(1.02);
}

.moxen-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.moxen-card__video.is-playing {
  opacity: 1;
}

.moxen-card__play-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(18, 16, 15, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.2s;
}

.moxen-card__body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.moxen-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.moxen-card__category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sg-coral, #FF7E67);
  background: rgba(255, 126, 103, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
}

.moxen-card__deps {
  font-size: 11px;
  color: var(--sg-gris-55, #8C847C);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.moxen-card__title {
  font-family: var(--sg-titular);
  font-size: 16px;
  font-weight: 700;
  color: var(--sg-blanco, #FFFFFF);
  margin: 0 0 4px;
  line-height: 1.3;
}

.moxen-card__tagline {
  font-size: 12.5px;
  color: var(--sg-gris-70, #B8B0A8);
  line-height: 1.45;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.moxen-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--sg-borde, rgba(255, 255, 255, 0.06));
}

.moxen-card__footer .sg-btn {
  flex: 1;
  justify-content: center;
  font-size: 12px;
  padding: 7px 10px;
}

.moxen-load-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 48px;
}

.moxen-counter-text {
  font-size: 13px;
  color: var(--sg-gris-55, #8C847C);
}

/* ==========================================================================
   VAULT DETAIL MODAL (<dialog>)
   ========================================================================== */
.sg-moxen-dialog {
  padding: 0;
  border: 1px solid var(--sg-tarjeta-borde, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  background: var(--sg-modal-bg, #181615);
  color: var(--sg-texto-color, #E8E2DC);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  max-width: 780px;
  width: 92vw;
  max-height: 90vh;
  overflow: hidden;
}

.sg-moxen-dialog::backdrop {
  background: rgba(10, 9, 8, 0.75);
  backdrop-filter: blur(10px);
}

.sg-moxen-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
}

.sg-moxen-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.sg-moxen-modal-head h3 {
  font-family: var(--sg-titular);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #FFFFFF;
}

.sg-moxen-modal-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0A0908;
  position: relative;
}

.sg-moxen-modal-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-moxen-modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sg-moxen-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sg-moxen-prompt-box {
  background: #11100E;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.sg-moxen-prompt-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sg-moxen-prompt-text {
  font-family: var(--sg-codigo, monospace);
  font-size: 12px;
  line-height: 1.6;
  color: #E0DAD3;
  white-space: pre-wrap;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 6px;
}
