/* ============================================
   WorkoutApp — Custom CSS (Tailwind companion)
   Glassmorphism + Micro-interactions
   ============================================ */

/* === Animations === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(74,222,128,0.15), 0 0 60px rgba(74,222,128,0.05); }
  50% { box-shadow: 0 0 40px rgba(74,222,128,0.3), 0 0 80px rgba(74,222,128,0.1); }
}

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

.animate-float { animation: float 3.5s ease-in-out infinite; }
.animate-fade-in { animation: fade-in 0.5s ease forwards; }
.animate-slide-up { animation: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-shimmer {
  background: linear-gradient(90deg, #1a1a1d 25%, #222226 50%, #1a1a1d 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
.animate-pulse-glow { animation: pulse-glow 2.5s ease-in-out infinite; }

/* === Glass Card === */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-hover:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.glass-active:active {
  background: rgba(255, 255, 255, 0.07);
  transform: scale(0.98);
}

/* === Nav Active Item === */
.nav-item.active {
  color: #4ade80 !important;
}

.nav-item.active .nav-icon {
  transform: translateY(-3px);
}

/* === Toggle Switch iOS === */
.toggle-track {
  width: 50px;
  height: 30px;
  background: #27272a;
  border-radius: 999px;
  border: 2px solid #3f3f46;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.toggle-track.active {
  background: #4ade80;
  border-color: #4ade80;
}

.toggle-track.active::after {
  transform: translateX(20px);
}

/* === Timer SVG === */
.timer-ring {
  filter: drop-shadow(0 0 30px rgba(74,222,128,0.2));
  transition: filter 0.4s;
}

.timer-ring.finished {
  filter: drop-shadow(0 0 40px rgba(248,113,113,0.5));
}

.timer-ring circle {
  transition: stroke-dashoffset 0.4s linear, stroke 0.5s;
}

/* === Progress bar fill === */
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #86efac);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}

/* === Chip active === */
.chip-active {
  background: #4ade80 !important;
  color: #000 !important;
  border-color: #4ade80 !important;
  font-weight: 700;
}

/* === Day chip variations === */
.day-chip-natacion {
  background: linear-gradient(160deg, #0a1e3d, #111c30) !important;
  border-color: rgba(56,189,248,0.25) !important;
}

.day-chip-natacion.active-chip {
  border-color: #38bdf8 !important;
  background: linear-gradient(160deg, #0b2448, #162440) !important;
}

.day-chip-descanso {
  opacity: 0.35;
}

/* === Scrollbar hide === */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* === Skeleton === */
.skeleton {
  background: linear-gradient(90deg, #1a1a1d 25%, #222226 50%, #1a1a1d 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: white;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 300;
  box-shadow: 0 10px 30px rgba(239,68,68,0.3);
  animation: fade-in 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

/* === Input autofill override === */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px #1a1a1d inset !important;
  -webkit-text-fill-color: white !important;
  transition: background-color 5000s ease-in-out 0s;
}