/* ============================================
 * Magic Darkroom · Darkroom Card
 *
 * Deep purple + red safety light glow.
 * ONLY used inside task cards with status=developing.
 * NEVER apply to page-level or other contexts.
 *
 * Classes:
 *   .md-darkroom        base (gradient bg + red glow)
 *   .md-darkroom__lamp  pulsing red dot
 *   .md-darkroom__paper placeholder for un-developed photo
 *   .md-darkroom__text  carousel text area
 *   .md-darkroom__bar   progress bar container
 *   .md-darkroom__fill  progress bar fill
 * ============================================ */

.md-darkroom {
  background: linear-gradient(135deg, #2A1F3A, #3D2A4D);
  color: #F5E6D4;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: inset 0 0 60px 10px rgba(229, 90, 85, 0.35);
  position: relative;
  overflow: hidden;
  font-weight: 600;
}

/* Noise texture overlay */
.md-darkroom::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  animation: md-darkroom-noise-in 600ms 400ms ease forwards;
}

@keyframes md-darkroom-noise-in {
  to { opacity: 1; }
}

/* ---- Red safety lamp ---- */
.md-darkroom__lamp {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.md-darkroom__lamp-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-dark-red, #E55A55);
  box-shadow: 0 0 20px 6px var(--c-dark-red, #E55A55);
  animation: md-dark-pulse 2.4s ease-in-out infinite;
}

/* ---- Un-developed photo placeholder ---- */
.md-darkroom__paper {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: linear-gradient(145deg, #4a3a5e 0%, #3d2d50 50%, #352545 100%);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

/* Shimmer effect on paper */
.md-darkroom__paper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 230, 212, 0.05) 40%,
    rgba(245, 230, 212, 0.08) 50%,
    rgba(245, 230, 212, 0.05) 60%,
    transparent 100%
  );
  animation: md-darkroom-shimmer 2.8s ease-in-out infinite;
}

@keyframes md-darkroom-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---- Carousel text ---- */
.md-darkroom__text {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: rgba(245, 230, 212, 0.85);
  min-height: 24px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Typewriter caret for darkroom text */
.md-darkroom__text::after {
  content: "\2588";
  display: inline-block;
  margin-left: 2px;
  animation: md-caret 0.7s steps(1) infinite;
  opacity: 0;
  color: rgba(245, 230, 212, 0.4);
  font-weight: 400;
}
.md-darkroom[data-typing="true"] .md-darkroom__text::after {
  opacity: 1;
}

/* ---- Progress bar ---- */
.md-darkroom__bar {
  width: 100%;
  height: 8px;
  background: rgba(245, 230, 212, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.md-darkroom__fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #E55A55, #E89D6F);
  transition: width 0.6s var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
  min-width: 4%;
}

/* ---- Progress percentage text ---- */
.md-darkroom__percent {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: rgba(245, 230, 212, 0.6);
  margin-top: 6px;
  font-family: var(--font-mono, monospace);
}
