/* ==========================================================================
   REACT BITS — UI Design System Stylesheet
   Inspired by: https://github.com/DavidHDev/react-bits (by DavidHDev)
   Tailored for: LUMINA 2026 Augmented Reality Art Exhibition
   Components:
     - SpotlightCard (cursor-following radial glow)
     - ShinyText (metallic gold shimmer sweep)
     - DecryptedText (cybernetic scramble decode)
     - TrueFocus (animated focus bracket with blur)
     - MagneticButton (spring-physics magnetic attraction)
     - TiltedCard (3D perspective cursor tilt)
     - StarBorder (flowing perimeter light beam)
     ========================================================================== */

/* 1. Spotlight Card Component */
.rb-spotlight-card {
  position: relative;
  overflow: hidden;
  background: rgba(18, 23, 38, 0.82);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  transition: border-color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
  --spotlight-x: 50%;
  --spotlight-y: 50%;
  --spotlight-color: rgba(212, 175, 55, 0.22);
  --spotlight-size: 320px;
}

.rb-spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle var(--spotlight-size) at var(--spotlight-x) var(--spotlight-y),
    var(--spotlight-color),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.rb-spotlight-card:hover {
  border-color: var(--border-gold, rgba(212, 175, 55, 0.5));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(212, 175, 55, 0.15);
}

.rb-spotlight-card:hover::before {
  opacity: 1;
}

.rb-spotlight-card > * {
  position: relative;
  z-index: 2;
}

tr.rb-spotlight-card::before,
tr.matrix-row-card::before,
tr::before {
  display: none !important;
  content: none !important;
}

/* 2. Shiny Text Component */
.rb-shiny-text {
  display: inline-block;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(212, 175, 55, 0.95) 30%,
    #ffffff 50%,
    rgba(212, 175, 55, 0.95) 70%,
    rgba(255, 255, 255, 0.6) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rb-shine-sweep 4.5s linear infinite;
}

@keyframes rb-shine-sweep {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

/* 3. Decrypted Text Component */
.rb-decrypted-text {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  display: inline-block;
  transition: color 0.2s ease;
}

.rb-decrypted-text.scrambling {
  color: var(--cyan-accent, #00f2fe) !important;
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
}

/* 4. True Focus Component */
.rb-true-focus-container {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rb-focus-word {
  position: relative;
  padding: 3px 6px;
  cursor: pointer;
  transition: filter 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.rb-true-focus-container.has-focus .rb-focus-word:not(.is-focused) {
  filter: blur(2.5px);
  opacity: 0.45;
}

.rb-focus-bracket {
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--gold-primary, #d4af37);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
  border-radius: 6px;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  background: rgba(212, 175, 55, 0.08);
}

.rb-focus-bracket::before,
.rb-focus-bracket::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-color: var(--gold-glow, #f3d069);
  border-style: solid;
}

.rb-focus-bracket::before {
  top: -2px;
  left: -2px;
  border-width: 2px 0 0 2px;
}

.rb-focus-bracket::after {
  bottom: -2px;
  right: -2px;
  border-width: 0 2px 2px 0;
}

/* 5. Magnetic Button Component */
.rb-magnetic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

/* 6. Tilted Card Component */
.rb-tilted-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.rb-tilted-inner {
  transition: transform 0.25s ease;
  transform: translateZ(20px);
}

/* 7. Star Border / Flowing Light Beam Component */
.rb-star-border {
  position: relative;
  border-radius: 14px;
  padding: 1px;
  overflow: hidden;
  display: inline-flex;
}

.rb-star-border::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent 0deg,
    transparent 70deg,
    var(--gold-primary, #d4af37) 120deg,
    var(--gold-glow, #f3d069) 130deg,
    transparent 150deg
  );
  animation: rb-star-rotate 4s linear infinite;
  z-index: 1;
}

@keyframes rb-star-rotate {
  100% {
    transform: rotate(360deg);
  }
}

.rb-star-border-content {
  position: relative;
  z-index: 2;
  background: var(--bg-surface, #0e121d);
  border-radius: 13px;
  width: 100%;
  height: 100%;
}

/* Code Snippet Blocks in React Bits Showcase */
.rb-code-container {
  background: #080a10;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
}

.rb-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
}

.rb-copy-btn {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-glow, #f3d069);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.rb-copy-btn:hover {
  background: var(--gold-primary, #d4af37);
  color: #07090f;
}

.rb-code-block {
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: #c9d1d9;
  overflow-x: auto;
  max-height: 320px;
}

/* Matrix Table Image Visualizer Styles */
.matrix-visual-cell {
  width: 170px;
  min-width: 160px;
}

.matrix-thumb-card {
  position: relative;
  width: 100%;
  height: 95px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.3);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.3s ease;
  background: #000;
}

.matrix-thumb-card:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--gold-glow);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
}

.matrix-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.matrix-thumb-card:hover .matrix-thumb-img {
  transform: scale(1.08);
}

.matrix-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 9, 15, 0.95) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px 8px;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.matrix-thumb-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--gold-glow);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.matrix-zoom-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s ease;
}

.matrix-thumb-card:hover .matrix-zoom-btn {
  background: var(--gold-primary);
  color: #000;
}

.matrix-zoom-icon {
  width: 11px;
  height: 11px;
}

/* Lightbox Modal for Full Resolution Matrix Visuals */
.matrix-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.matrix-lightbox.hidden {
  display: none !important;
}

.lightbox-content {
  background: #0d101a;
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  max-width: 960px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(212, 175, 55, 0.25);
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 23, 38, 0.9);
}

.lightbox-header h3 {
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--gold-glow);
  margin: 0;
}

.lightbox-body {
  padding: 0;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
}

.lightbox-caption {
  padding: 14px 24px;
  font-size: 13.5px;
  color: var(--text-main);
  background: rgba(18, 23, 38, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* React Bits Showcase Grid */
.rb-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
  margin-top: 24px;
}

.rb-component-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rb-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.rb-card-title {
  font-family: var(--font-title);
  font-size: 22px;
  color: #fff;
  margin-bottom: 4px;
}

.rb-card-category {
  font-family: var(--font-en-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-primary);
  background: var(--gold-tint);
  padding: 2px 7px;
  border-radius: 4px;
}

.rb-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.rb-demo-stage {
  min-height: 120px;
  background: rgba(7, 9, 15, 0.75);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}
