/* ============================================
   taskvel - Premium Effects
   Efectos visuales premium: grain, glass,
   gradients, animaciones, scrollbar
   ============================================ */

/* --- Film grain overlay --- */
.ft-grain {
  position: relative;
}

.ft-grain::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* --- Accent gradient --- */
.ft-accent-gradient {
  background: linear-gradient(135deg, var(--ft-accent) 0%, #8b5cf6 50%, #ec4899 100%);
}

.ft-accent-gradient-text {
  background: linear-gradient(135deg, var(--ft-accent) 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Glass effect --- */
.ft-glass {
  background: var(--ft-glass-bg);
  backdrop-filter: blur(var(--ft-glass-blur));
  -webkit-backdrop-filter: blur(var(--ft-glass-blur));
  border: 1px solid var(--ft-glass-border);
}

/* --- Page enter animation --- */
.ft-page-enter {
  animation: ft-fade-up 0.3s var(--ft-ease-out) both;
}

/* --- Task complete animation --- */
.ft-task-complete {
  animation: ft-task-check 0.5s var(--ft-ease-spring) both;
}

@keyframes ft-task-check {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.95);
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

/* --- Priority indicators --- */
.ft-priority-none {
  color: var(--ft-priority-none);
}

.ft-priority-low {
  color: var(--ft-priority-low);
}

.ft-priority-medium {
  color: var(--ft-priority-medium);
}

.ft-priority-high {
  color: var(--ft-priority-high);
}

.ft-priority-urgent {
  color: var(--ft-priority-urgent);
}

.ft-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.ft-priority-dot.none { background: var(--ft-priority-none); }
.ft-priority-dot.low { background: var(--ft-priority-low); }
.ft-priority-dot.medium { background: var(--ft-priority-medium); }
.ft-priority-dot.high { background: var(--ft-priority-high); }
.ft-priority-dot.urgent {
  background: var(--ft-priority-urgent);
  animation: ft-pulse-soft 2s ease-in-out infinite;
}

@keyframes ft-pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Skeleton loader --- */
.ft-skeleton {
  background: linear-gradient(
    90deg,
    var(--ft-skeleton-base) 25%,
    var(--ft-skeleton-shine) 50%,
    var(--ft-skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: ft-shimmer 1.5s infinite linear;
  border-radius: 0.375rem;
}

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

/* --- Focus ring (accesibilidad) --- */
.ft-focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ft-surface), 0 0 0 4px var(--ft-accent);
}

/* --- Custom scrollbar --- */
.ft-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.ft-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.ft-scrollbar::-webkit-scrollbar-thumb {
  background: var(--ft-border-strong);
  border-radius: 3px;
}

.ft-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--ft-text-tertiary);
}

/* Firefox scrollbar */
.ft-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--ft-border-strong) transparent;
}

/* --- Toast animations --- */
.ft-toast-enter {
  animation: ft-toast-in 0.35s var(--ft-ease-spring) both;
}

.ft-toast-exit {
  animation: ft-toast-out 0.25s var(--ft-ease-out) both;
}

@keyframes ft-toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ft-toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
}

/* --- Bottom sheet --- */
.ft-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: var(--ft-backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  animation: ft-fade-in 0.2s var(--ft-ease-out) both;
}

@keyframes ft-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ft-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ft-surface-raised);
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  z-index: 51;
  max-height: 85vh;
  overflow-y: auto;
  animation: ft-slide-up 0.35s var(--ft-ease-spring) both;
}

@keyframes ft-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ft-bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--ft-border-strong);
  border-radius: 2px;
  margin: 0.75rem auto;
}

/* --- FAB (Floating Action Button) --- */
.ft-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ft-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.2s var(--ft-ease-spring);
  z-index: 40;
}

.ft-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.ft-fab:active {
  transform: scale(0.95);
}

/* Task 4: FAB above BottomTabBar on mobile (<1024px) */
@media (max-width: 1023px) {
  .ft-fab {
    bottom: calc(56px + 1rem);
  }
}

/* --- Notification bell ring --- */
.ft-bell-ring {
  animation: ft-ring 0.6s ease-in-out;
}

@keyframes ft-ring {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(7deg); }
  40% { transform: rotate(-4deg); }
  50%, 100% { transform: rotate(0deg); }
}

/* --- Badge pulse (para notificaciones) --- */
.ft-badge-pulse {
  position: relative;
}

.ft-badge-pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: inherit;
  opacity: 0;
  animation: ft-badge-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ft-badge-ping {
  0% { transform: scale(1); opacity: 0.5; }
  75%, 100% { transform: scale(1.75); opacity: 0; }
}

/* --- Upgrade prompt gradient card --- */
.ft-upgrade-card {
  background: linear-gradient(135deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(139, 92, 246, 0.06) 50%,
    rgba(236, 72, 153, 0.04) 100%
  );
  border: 1px solid var(--ft-accent-soft);
  border-radius: 0.75rem;
  position: relative;
  overflow: hidden;
}

.ft-upgrade-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--ft-accent-soft) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}
