/* Modal and REST Button Flash Styles */

/* Modal Overlay */
.save-set-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Modal Content Box */
.modal-content {
  background: #1a1a2e;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.3s ease-out;
}

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

.modal-content h2 {
  color: #ffffff;
  font-size: 28px;
  margin: 0 0 20px 0;
  font-weight: 600;
}

.modal-content .rep-count {
  font-size: 64px;
  font-weight: bold;
  color: #00d4ff;
  margin: 20px 0;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Modal Buttons */
.btn-save-set {
  background: #00d4ff;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  padding: 15px 50px;
  border: none;
  border-radius: 8px;
  margin: 15px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-save-set:hover {
  background: #00b8e6;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

.btn-save-set:active {
  transform: translateY(0);
}

.btn-keep-going {
  background: transparent;
  border: 2px solid #00d4ff;
  color: #00d4ff;
  font-size: 18px;
  font-weight: 500;
  padding: 12px 40px;
  border-radius: 8px;
  margin: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-keep-going:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: #00b8e6;
  color: #00b8e6;
}

.btn-keep-going:active {
  background: rgba(0, 212, 255, 0.2);
}

/* REST Button Flash Animation */
.flash-animation {
  animation: flash 0.8s ease-in-out infinite;
}

@keyframes flash {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 rgba(0, 212, 255, 0);
  }
  50% {
    opacity: 0.6;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
  }
}

/* REST Button Hint Text */
.rest-hint {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 212, 255, 0.9);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: bounce 1s ease-in-out infinite;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Make sure REST button parent has position: relative */
.rest-button {
  position: relative;
}

/* ============================================================================
   COUNTDOWN TIMER OVERLAY
   ============================================================================ */

.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in-out;
}

.countdown-fade-out {
  animation: fadeOut 0.3s ease-in-out forwards;
}

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

.countdown-content {
  text-align: center;
  position: relative;
  width: 280px;
  height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.countdown-exercise {
  color: #00d4ff;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.countdown-message {
  color: #ffffff;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 30px;
  opacity: 0.9;
}

.countdown-number {
  color: #ffffff;
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 10px;
  z-index: 2;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
}

.countdown-pulse {
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    color: #ffffff;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    color: #00d4ff;
  }
}

.countdown-ring {
  width: 180px;
  height: 180px;
  position: relative;
}

.countdown-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}

.countdown-ring-progress {
  fill: none;
  stroke: #00d4ff;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.countdown-skip-btn {
  margin-top: 30px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 500;
  padding: 10px 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.countdown-skip-btn:hover {
  border-color: #00d4ff;
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.1);
}

.countdown-skip-btn:active {
  background: rgba(0, 212, 255, 0.2);
}

/* ============================================================================
   MOBILE RESPONSIVENESS
   ============================================================================ */

@media (max-width: 768px) {
  .modal-content {
    padding: 30px 20px;
    max-width: 90%;
  }

  .modal-content h2 {
    font-size: 24px;
  }

  .modal-content .rep-count {
    font-size: 52px;
  }

  .btn-save-set {
    font-size: 18px;
    padding: 12px 40px;
    margin: 10px 5px;
  }

  .btn-keep-going {
    font-size: 16px;
    padding: 10px 30px;
    margin: 8px 5px;
  }

  .rest-hint {
    font-size: 12px;
    padding: 6px 12px;
    top: -30px;
  }

  /* Countdown mobile adjustments */
  .countdown-exercise {
    font-size: 26px;
    letter-spacing: 2px;
  }

  .countdown-message {
    font-size: 18px;
    margin-bottom: 24px;
  }

  .countdown-number {
    font-size: 80px;
  }

  .countdown-ring {
    width: 150px;
    height: 150px;
  }

  .countdown-skip-btn {
    font-size: 14px;
    padding: 8px 32px;
    margin-top: 24px;
  }
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}
