@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.toolbar {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sprint-stat {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  color: #cbd5e1;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sprint-stat:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.sprint-stat b {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  height: calc(100vh - 160px);
  padding: 1.5rem;
}

.list {
  color: #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4), 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.list::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}

.list.pendiente {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
  backdrop-filter: blur(20px);
}

.list.pendiente::before {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.list.en-progreso {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 146, 60, 0.15) 100%);
  backdrop-filter: blur(20px);
}

.list.en-progreso::before {
  background: linear-gradient(90deg, #f59e0b 0%, #fb923c 100%);
}

.list.hecho {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
  backdrop-filter: blur(20px);
}

.list.hecho::before {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.list-header {
  margin-bottom: 1.2rem;
  padding-top: 0.5rem;
}

.list-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.025em;
}

.dropzone {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.dropzone::-webkit-scrollbar {
  width: 6px;
}

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

.dropzone::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  transition: background 0.3s;
}

.dropzone::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.card-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #1f2937;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #3b82f6 0%, #8b5cf6 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card-item:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.card-item:hover::before {
  opacity: 1;
}

.card-item.dragging {
  opacity: .6;
  cursor: grabbing !important;
  transform: rotate(2deg);
}

.story-points-badge {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  min-width: 28px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.ghost {
  border: 2px dashed rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 12px;
  height: 60px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

.btn {
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
  border: none;
}

.btn-dark-soft {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  border: 1px solid #374151;
  color: #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-dark-soft:hover {
  background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-add-card {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.875rem;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.btn-add-card:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.btn-outline-info {
  border: 2px solid #06b6d4;
  color: #06b6d4;
  background: transparent;
}

.btn-outline-info:hover {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  border-color: #06b6d4;
  transform: translateY(-2px);
}

.btn-outline-danger {
  border: 2px solid #ef4444;
  color: #ef4444;
  background: transparent;
}

.btn-outline-danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: #ef4444;
  transform: translateY(-2px);
}

.modal-content {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.modal-header h5 {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid #374151;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#customPromptInput:focus,
#newBoardNameInput:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 8px;
}

.table-dark {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
}

.table-dark th {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #94a3b8;
  border-bottom: 2px solid #334155;
}

.table-dark tbody tr {
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  transition: all 0.2s ease;
}

.table-dark tbody tr:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.01);
}

#currentBoardName {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-group .btn {
  font-size: 0.875rem;
  padding: 0.4rem 1rem;
}

/* Timeline de actividades */
.activity-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1rem;
  border-left: 2px solid rgba(59, 130, 246, 0.3);
  margin-left: 0.5rem;
}

.activity-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.activity-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.activity-content {
  background: rgba(30, 41, 59, 0.6);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: all 0.2s ease;
}

.activity-content:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(59, 130, 246, 0.4);
}

.activity-content .btn-sm {
  opacity: 0.7;
  transition: all 0.2s ease;
}

.activity-content:hover .btn-sm {
  opacity: 1;
}

.activity-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
}

.activity-text {
  color: #e2e8f0;
  font-size: 0.875rem;
  line-height: 1.5;
}

#activitiesTimeline::-webkit-scrollbar {
  width: 6px;
}

#activitiesTimeline::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

#activitiesTimeline::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 10px;
}

#activitiesTimeline::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

/* Archivos adjuntos */
.attachment-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.attachment-preview:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateX(3px);
}

.attachment-preview img {
  max-height: 40px;
  border-radius: 4px;
}

.attachment-icon {
  font-size: 1.5rem;
}

.attachment-info {
  display: flex;
  flex-direction: column;
}

.attachment-name {
  font-size: 0.85rem;
  color: #e2e8f0;
  font-weight: 500;
}

.attachment-size {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Inputs de fecha - Icono del calendario en blanco */
input[type="date"] {
  color-scheme: dark;
  cursor: pointer;
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5) !important;
  cursor: pointer !important;
  opacity: 1 !important;
  transition: all 0.2s ease;
  background: transparent !important;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) brightness(2) !important;
  transform: scale(1.1);
}

/* Firefox */
input[type="date"]::-moz-calendar-picker-indicator {
  filter: invert(1) brightness(1.5) !important;
  cursor: pointer !important;
  opacity: 1 !important;
}

input[type="date"]::-moz-calendar-picker-indicator:hover {
  filter: invert(1) brightness(2) !important;
}

/* Asegurar que el icono sea visible en inputs con bg-dark */
.bg-dark input[type="date"]::-webkit-calendar-picker-indicator,
input[type="date"].bg-dark::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.8) !important;
}

/* Filtros Vista Lista */
#vistaLista .form-label {
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

#vistaLista .form-control,
#vistaLista .form-select {
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

#vistaLista .form-control:focus,
#vistaLista .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

#vistaLista .btn {
  transition: all 0.2s ease;
  font-weight: 600;
}

#vistaLista .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#vistaLista .btn-info {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
  border: none;
  color: #0f172a;
}

#vistaLista .btn-info:hover {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* ============================================
   ANIMACIÓN PULSE PARA BADGES DE PRIORIDAD IA
   ============================================ */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* Destacar top 3 con glow effect */
.card-item:has([style*="🥇"]),
.card-item:has([style*="🥈"]),
.card-item:has([style*="🥉"]) {
  border-left: 3px solid #fbbf24;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}
