/* Styles and Animations for Gestor 5P */

/* Custom Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Dark mode scrollbars */
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #475569;
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Timeline grid pattern for Gantt Chart */
.gantt-grid {
  background-size: 8.3333% 100%; /* 12 columns */
  background-image: linear-gradient(to right, rgba(226, 232, 240, 0.6) 1px, transparent 1px);
}
.dark .gantt-grid {
  background-image: linear-gradient(to right, rgba(71, 85, 105, 0.4) 1px, transparent 1px);
}

/* Card hover scaling and transitions */
.kanban-card, .task-card {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease, opacity 0.2s ease;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(9, 20, 38, 0.06);
}

.dark .kanban-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Dragging state representation */
.kanban-card.dragging {
  opacity: 0.5;
  transform: scale(0.96) rotate(1deg);
  border: 2px dashed #006c49;
}

.kanban-column.drag-over {
  background-color: rgba(108, 248, 187, 0.08) !important;
  border-color: rgba(0, 108, 73, 0.3) !important;
}

/* Success transition for completed tasks */
.task-completed-anim {
  animation: taskComplete 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes taskComplete {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  30% {
    transform: scale(1.02);
    background-color: rgba(108, 248, 187, 0.15);
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
  }
}

/* Glassmorphism panel styling */
.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dark .glass-panel {
  background: rgba(30, 41, 59, 0.7);
}

/* Custom modal dialogs animations */
dialog::backdrop {
  background: rgba(9, 20, 38, 0.4);
  backdrop-filter: blur(4px);
  animation: fadeInBackdrop 0.25s ease-out forwards;
}

dialog[open] {
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

@keyframes modalSlideUp {
  from {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Dark mode structural classes overrides */
.dark body {
  background-color: #0f172a;
  color: #eff1f3;
}

/* Estilo global de campos de entrada para legibilidad y contraste */
input, select, textarea {
  color: #0f172a !important; /* Texto oscuro para tema claro */
}

.dark input, 
.dark select, 
.dark textarea {
  color: #eff1f3 !important; /* Texto claro para tema oscuro */
}

.dark select option {
  background-color: #1e293b !important;
  color: #eff1f3 !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}


/* Focus Mode Pomodoro Circle */
.timer-circle {
  transition: stroke-dashoffset 0.3s linear;
}

/* Pulse animation for alarms */
.pulse-error {
  animation: pulseError 2s infinite;
}
@keyframes pulseError {
  0% {
    box-shadow: 0 0 0 0 rgba(186, 26, 26, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(186, 26, 26, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(186, 26, 26, 0);
  }
}

/* Navigation items transition */
.nav-link-active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
  border-left: 4px solid #6ffbbe;
}

/* General transitions */
.transition-all-custom {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Dropzone drag and drop files */
.upload-dropzone {
  border: 2px dashed rgba(117, 119, 125, 0.3);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
}
.upload-dropzone:hover {
  border-color: rgba(0, 108, 73, 0.6);
}
.upload-dropzone.dragover {
  border-color: #006c49;
  background-color: rgba(108, 248, 187, 0.08);
  transform: scale(1.01);
}
.dark .upload-dropzone.dragover {
  border-color: #4edea3;
  background-color: rgba(78, 222, 163, 0.05);
}

/* Sub-pestañas activas para el panel de administración */
.admin-tab-active {
  border-bottom: 3px solid #006c49;
  color: #006c49 !important;
  font-weight: 700;
}
.dark .admin-tab-active {
  border-bottom: 3px solid #6ffbbe;
  color: #6ffbbe !important;
}

/* ====================================================================
   MEJORAS PREMIUM DE CONTRASTE Y LEGIBILIDAD (MODO OSCURO / CLARO)
   ==================================================================== */
.text-error {
  color: #ba1a1a !important;
}
.dark .text-error {
  color: #f87171 !important; /* Rosa/rojo brillante de alta visibilidad */
}

.text-secondary {
  color: #006c49 !important;
}
.dark .text-secondary {
  color: #6ffbbe !important; /* Esmeralda/turquesa brillante de alta visibilidad */
}

.bg-error-container {
  background-color: rgba(186, 26, 26, 0.08) !important;
}
.dark .bg-error-container {
  background-color: rgba(248, 113, 113, 0.15) !important;
}

.text-on-tertiary-container {
  color: #b45309 !important; /* Ámbar/marrón legible en tema claro */
}
.dark .text-on-tertiary-container {
  color: #fbbf24 !important; /* Amarillo/ámbar brillante de alta visibilidad */
}

.bg-tertiary-container\/10 {
  background-color: rgba(217, 119, 6, 0.08) !important;
}
.dark .bg-tertiary-container\/10 {
  background-color: rgba(251, 191, 36, 0.15) !important;
}

/* Sombras y bordes legibles para modo oscuro */
.dark .bg-surface-container-low, 
.dark .bg-surface-container-lowest, 
.dark .bg-slate-900, 
.dark .bg-slate-950 {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Asegurar legibilidad del texto en inputs deshabilitados/readonly */
.dark input[readonly], 
.dark input[disabled] {
  color: rgba(255, 255, 255, 0.5) !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
}

/* ====================================================================
   CLASES SEMÁNTICAS DE CONTRASTE AUTOMÁTICO (CLARO / OSCURO)
   ==================================================================== */

/* 1. Badges de Estado de Tareas */
.badge-in-progress {
  background-color: rgba(2, 132, 199, 0.1) !important; /* sky-600 a 10% */
  color: #0284c7 !important; /* sky-600 */
}
.dark .badge-in-progress {
  background-color: rgba(56, 189, 248, 0.15) !important; /* sky-400 a 15% */
  color: #38bdf8 !important; /* sky-400 */
}

.badge-todo {
  background-color: rgba(100, 116, 139, 0.1) !important; /* slate-500 a 10% */
  color: #64748b !important; /* slate-500 */
}
.dark .badge-todo {
  background-color: rgba(148, 163, 184, 0.15) !important; /* slate-400 a 15% */
  color: #94a3b8 !important; /* slate-400 */
}

.badge-completed {
  background-color: rgba(0, 108, 73, 0.1) !important; /* esmeralda a 10% */
  color: #006c49 !important;
}
.dark .badge-completed {
  background-color: rgba(110, 251, 190, 0.15) !important; /* esmeralda brillante a 15% */
  color: #6ffbbe !important;
}

.badge-blocked {
  background-color: rgba(186, 26, 26, 0.1) !important; /* error a 10% */
  color: #ba1a1a !important;
}
.dark .badge-blocked {
  background-color: rgba(248, 113, 113, 0.15) !important; /* error brillante a 15% */
  color: #f87171 !important;
}

/* 2. Badges de Disponibilidad de Colaboradores */
.badge-overload {
  background-color: rgba(186, 26, 26, 0.1) !important;
  color: #ba1a1a !important;
}
.dark .badge-overload {
  background-color: rgba(248, 113, 113, 0.15) !important;
  color: #f87171 !important;
}

.badge-limit {
  background-color: rgba(217, 119, 6, 0.1) !important; /* amber-600 */
  color: #d97706 !important;
}
.dark .badge-limit {
  background-color: rgba(245, 158, 11, 0.15) !important; /* amber-500 */
  color: #f59e0b !important;
}

.badge-available {
  background-color: rgba(0, 108, 73, 0.1) !important;
  color: #006c49 !important;
}
.dark .badge-available {
  background-color: rgba(110, 251, 190, 0.15) !important;
  color: #6ffbbe !important;
}

/* 3. Utilidad para truncamiento de texto multilínea */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}


