/* ============================================
   CREATION PROGRESS MODAL
   Society Arts - Gallery-first creation experience
   v1.0.0
   ============================================ */

/* ── BACKDROP ── */
.cpm-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(35, 18, 10, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: cpmBackdropIn 0.3s ease;
}

/* ── MODAL CONTAINER ── */
.cpm-modal {
  width: 100%;
  max-width: 1060px;
  max-height: 95vh;
  background-color: #FDFAF5;
  border-radius: 20px;
  box-shadow: 0 40px 120px rgba(35, 18, 10, 0.4), 0 2px 12px rgba(35, 18, 10, 0.12);
  display: flex;
  flex-direction: column;
  animation: cpmModalIn 0.4s cubic-bezier(.16, 1, .3, 1) both;
  overflow: hidden;
}

/* ── CLOSE BUTTON ── */
.cpm-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #ede8df;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #8a7e70;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cpm-close-btn:hover {
  background: #d4cfc5;
  color: #3E2318;
}

/* ── NAV ARROWS ── */
.cpm-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(253, 250, 245, 0.88);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #3E2318;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 16px rgba(62, 35, 24, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 5;
}

.cpm-nav-left { left: 14px; }
.cpm-nav-right { right: 14px; }

.cpm-nav-arrow:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 4px 20px rgba(62, 35, 24, 0.2);
}

/* ── FAVORITE BUTTON ── */
.cpm-fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(253, 250, 245, 0.88);
  backdrop-filter: blur(4px);
  color: #3E2318;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 16px rgba(62, 35, 24, 0.15);
  transition: all 0.25s cubic-bezier(.16, 1, .3, 1);
  z-index: 5;
}

.cpm-fav-btn.active {
  background-color: #C73314;
  color: white;
  transform: scale(1.1);
}

.cpm-fav-btn:hover:not(.active) {
  background-color: rgba(253, 250, 245, 0.95);
  transform: scale(1.05);
}

/* ── IMAGE DOT BUTTONS ── */
.cpm-dot-btn {
  height: 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(.16, 1, .3, 1);
  padding: 0;
}

/* ── FILMSTRIP BUTTON ── */
.cpm-filmstrip-btn {
  padding: 10px 8px 8px;
  border-radius: 12px;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6;
  position: relative;
  background: #f5f2ec;
  font-family: 'Familjen Grotesk', sans-serif;
  overflow: hidden;
}

.cpm-filmstrip-btn.pending:not(.active) {
  opacity: 0.4;
  filter: grayscale(0.7);
}

.cpm-filmstrip-btn:hover:not(.active) {
  background-color: #edeae4;
}

.cpm-filmstrip-btn.pending:hover:not(.active) {
  opacity: 0.6;
}

.cpm-filmstrip-label {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
  transition: color 0.3s;
}

/* ── STATUS BADGE ── */
.cpm-status-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: white;
  border: 2px solid #FDFAF5;
  transition: all 0.3s ease;
}

.cpm-badge-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: white;
  display: block;
  animation: cpmBlinkerDot 1.2s ease infinite;
}

/* ── NOTIFY BUTTON ── */
.cpm-notify-btn {
  padding: 9px 18px;
  border-radius: 8px;
  background-color: transparent;
  border: 1.5px solid #C73314;
  color: #C73314;
  font-family: 'Familjen Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.cpm-notify-btn:hover {
  background-color: #C73314;
  color: white;
}

.cpm-notify-confirmed {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  border-radius: 8px;
  background-color: #eef5ec;
  flex-shrink: 0;
}

.cpm-notify-confirmed.flash {
  animation: cpmSlideDown 0.3s ease both;
}

/* ── DONE BUTTON ── */
.cpm-done-btn {
  padding: 10px 24px;
  border-radius: 8px;
  background-color: #C73314;
  color: white;
  font-family: 'Familjen Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.cpm-done-btn:hover {
  background-color: #a82a10;
}

/* ── TOAST ── */
.cpm-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 3000;
  background-color: #FDFAF5;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 12px 48px rgba(62, 35, 24, 0.22), 0 0 0 1px rgba(62, 35, 24, 0.05);
  max-width: 360px;
  width: 100%;
  animation: cpmSlideInRight 0.5s cubic-bezier(.16, 1, .3, 1) both;
}

/* ── PROCESSING RINGS ── */
.cpm-ring {
  position: absolute;
  border-radius: 18px;
  border-width: 2px;
  border-style: solid;
}

.cpm-ring-1 {
  inset: -8px;
  border-radius: 18px;
  animation: cpmRingExpand 2.8s ease-out infinite;
}

.cpm-ring-2 {
  inset: -4px;
  border-radius: 16px;
  animation: cpmRingExpand 2.8s ease-out 0.9s infinite;
}

.cpm-ring-3 {
  inset: 0;
  border-radius: 14px;
  animation: cpmRingExpand 2.8s ease-out 1.8s infinite;
}

/* ── BRUSH STROKE PROGRESS BAR (Processing indicator) ── */
.cpm-brush-track {
  height: 6px;
  border-radius: 3px;
  background-color: rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
}

.cpm-brush-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 3px;
  animation: cpmBrushSweep 2.4s cubic-bezier(.4,0,.2,1) infinite;
}

/* ── BLINKER DOTS (used in filmstrip badge only now) ── */
.cpm-blinker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: cpmBlinkerDot 2.4s ease-in-out infinite;
}

/* ── SPINNER (image loading) ── */
.cpm-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid #d4cfc5;
  border-top-color: #8a7e70;
  border-radius: 50%;
  animation: cpmSpin 0.8s linear infinite;
}

/* ── PROGRESS PULSE ── */
.cpm-progress-pulse {
  animation: cpmProgressPulse 2s ease infinite;
}

/* ============================================
   KEYFRAMES
   ============================================ */

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

@keyframes cpmModalIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cpmRingExpand {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes cpmBlinkerDot {
  0%, 100% { opacity: 0.12; transform: scale(0.6); }
  25% { opacity: 1; transform: scale(1.15); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

@keyframes cpmBrushSweep {
  0% { left: -40%; width: 40%; }
  50% { left: 30%; width: 50%; }
  100% { left: 110%; width: 40%; }
}

@keyframes cpmProgressPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(199, 51, 20, 0.2); }
  50% { box-shadow: 0 0 0 4px rgba(199, 51, 20, 0); }
}

@keyframes cpmSlideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes cpmSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cpmSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 680px) {
  .cpm-modal {
    max-width: calc(100% - 16px);
    max-height: 98vh;
    border-radius: 16px;
  }

  .cpm-nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .cpm-nav-left { left: 8px; }
  .cpm-nav-right { right: 8px; }

  .cpm-fav-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .cpm-filmstrip-btn {
    padding: 8px 4px 6px;
    border-radius: 10px;
  }
}
