/* shadcn/ui CSS Variables */
:root {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 47.9 95.8% 53.1%;
  --primary-foreground: 26 83.3% 14.1%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
  --radius: 0.75rem;
}

/* Custom Animations */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.6);
  }
}

@keyframes timer-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Timer Running State */
.timer-running #timer {
  animation: timer-pulse 2s ease-in-out infinite;
  transform: scale(1.05);
}

.timer-running .btn[data-action="start"] {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Timer Display Enhancement */
#timer {
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

/* Smaller minute buttons */
.timer-controls button[data-action="adjust"],
.timer-controls button[data-action="quick"] {
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  min-width: auto;
}

/* Responsive timer size adjustments */
@media (max-width: 768px) {
  #timer {
    font-size: 4rem !important;
  }

  .timer-controls {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  #timer {
    font-size: 3rem !important;
  }

  .timer-controls button[data-action="adjust"],
  .timer-controls button[data-action="quick"] {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }
}

/* Background Slideshow */
.background-slideshow .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.background-slideshow .slide.active {
  opacity: 1;
}

/* Music Player Responsive */
#musicPlayer.visible {
  width: 100%;
  height: 80px;
  max-width: 400px;
}

/* Custom Scrollbar */
select option {
  background-color: rgb(30 41 59);
  color: white;
}

/* Button States */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

/* Status Messages */
.status-message {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .timer-controls {
    grid-template-columns: 1fr 1fr;
  }

  #timer {
    font-size: 3rem !important;
  }
}

@media (max-width: 480px) {
  .timer-controls {
    grid-template-columns: 1fr;
  }

  .flex.gap-3 {
    flex-direction: column;
  }

  #timer {
    font-size: 2.5rem !important;
  }
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Focus States */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgb(234 179 8);
  outline-offset: 2px;
}

/* Cache Status Indicator */
.cache-indicator {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cache-indicator.show {
  opacity: 1;
}
.cache-indicator.success {
  background: rgba(34, 197, 94, 0.8);
}
.cache-indicator.error {
  background: rgba(239, 68, 68, 0.8);
}

/* ===== Aviso divertido DURANTE execução ===== */
.run-fun {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: #fff;
}

.run-fun.hidden {
  display: none;
}

.run-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 9999px;
  background: rgba(226, 85, 3, 0.85); /* fundo destacado */
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 15px rgba(255, 200, 0, 0.6);
  backdrop-filter: blur(6px);
  animation: wobble 2.6s ease-in-out infinite;
}

.run-emoji {
  font-size: 1.4rem;
  display: inline-block;
  animation: bob 1.5s ease-in-out infinite;
  transform-origin: center;
}

.run-text {
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Bolinhas animadas */
.run-loader {
  display: inline-flex;
  gap: 0.35rem;
}
.run-loader span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #fff;
  display: inline-block;
  animation: blink 1.2s infinite;
}
.run-loader span:nth-child(2) {
  animation-delay: 0.15s;
}
.run-loader span:nth-child(3) {
  animation-delay: 0.3s;
}

/* Animações do aviso */
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
@keyframes wobble {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(1deg);
  }
  75% {
    transform: rotate(-1deg);
  }
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.9);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

#musicPlayer {
  width: 100% !important;
  height: 250px !important; /* mostra barra de volume */
  max-width: 600px;
}

/* ===== Opções de mensagem (pills) ===== */
.msg-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.msg-option {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  user-select: none;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(4px);
}
.msg-option:hover {
  transform: translateY(-1px);
}
.msg-option.active {
  background: rgba(234, 179, 8, 0.9); /* amarelo/destaque */
  color: #111827;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.45);
}
