/**
 * E-Sohbet.org - Puzzle Slider Captcha Stilleri
 */

.puzzle-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
}

.puzzle-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.puzzle-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  padding: 20px;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-main, #f8fafc);
  position: relative;
  user-select: none;
}

.puzzle-modal-backdrop.active .puzzle-card {
  transform: scale(1) translateY(0);
}

.puzzle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.puzzle-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  margin: 0;
}

.puzzle-header h4 span {
  color: #38bdf8;
}

.puzzle-close-btn,
.puzzle-refresh-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.puzzle-close-btn:hover,
.puzzle-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.puzzle-canvas-wrap {
  position: relative;
  width: 320px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  margin: 0 auto 16px auto;
  background: #0f172a;
}

#puzzleBgCanvas {
  display: block;
  width: 320px;
  height: 180px;
}

#puzzlePieceCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 180px;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.puzzle-slider-track {
  position: relative;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.puzzle-slider-hint {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.puzzle-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.4));
  border-radius: 24px 0 0 24px;
  pointer-events: none;
  transition: background 0.2s ease;
}

.puzzle-slider-handle {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #fff;
  font-size: 16px;
  transition: box-shadow 0.2s ease, transform 0.1s ease;
  z-index: 2;
  touch-action: none;
}

.puzzle-slider-handle:active,
.puzzle-slider-handle.dragging {
  cursor: grabbing;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.8);
  transform: scale(1.05);
}

.puzzle-status-message {
  font-size: 0.82rem;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.puzzle-status-message.success {
  color: #10b981;
}

.puzzle-status-message.error {
  color: #ef4444;
}

/* Sallanma animasyonu */
@keyframes puzzleShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.puzzle-shake {
  animation: puzzleShake 0.4s ease-in-out;
}
