/* Custom Styles for Post-Venta GOCAR */

:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --bg-dark-radial: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --border-color: rgba(226, 232, 240, 0.8);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  background-color: #f8fafc !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.97); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite ease-in-out;
}

.animate-ping-small {
  animation: sse-ping 1.5s infinite;
}

@keyframes sse-ping {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.animate-blink {
  animation: bg-blink 1.2s infinite ease-in-out;
}

@keyframes bg-blink {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

/* Filter White for Logos */
.filter-white {
  filter: brightness(0) invert(1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Login screen customization */
#view-login {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark-radial);
  margin: -1.5rem;
  padding: 3rem 1.5rem;
  border-radius: 0 0 12px 12px;
}

#view-login input {
  font-size: 0.95rem;
}

/* Access Hub cards styling */
.hub-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.05) !important;
}

.hub-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.15) !important;
}

/* Gantt Scheduler Timeline CSS */
.gantt-grid {
  display: grid;
  grid-template-columns: 200px 120px 1fr;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background-color: #fff;
}

.gantt-header-row {
  display: contents;
}

.gantt-header-cell {
  background-color: #f8fafc;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  border-bottom: 2px solid #e2e8f0;
}

.gantt-row {
  display: contents;
}

.gantt-cell {
  padding: 4px 8px;
  border-bottom: 1px solid #f1f5f9;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.gantt-timeline-cell {
  position: relative;
  background-color: #fafbfd;
  overflow-x: auto;
  white-space: nowrap;
}

/* Absolute positioned blocks inside Gantt timelines */
.gantt-track {
  position: relative;
  height: 44px;
  width: 100%;
}

.gantt-block {
  position: absolute;
  height: 38px;
  top: 3px;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 2px 4px -1px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 20;
  pointer-events: auto;
}

.gantt-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px -2px rgba(0,0,0,0.15);
}

.gantt-break-block {
  position: absolute;
  height: 32px;
  top: 1px;
  top: 5px;
  background: repeating-linear-gradient(
    45deg,
    #f1f5f9,
    #f1f5f9 10px,
    #e2e8f0 10px,
    #e2e8f0 20px
  );
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.7rem;
}

/* Time labels bar inside timeline */
.gantt-time-marker-container {
  display: flex;
  position: relative;
  height: 36px;
  border-bottom: 2px solid #e2e8f0;
  background-color: #f8fafc;
}

.gantt-time-marker {
  position: absolute;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  border-left: 1px solid #e2e8f0;
  height: 100%;
  padding-top: 8px;
}

/* Current time line tracker */
.gantt-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #dc2626;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.7);
  z-index: 35;
  pointer-events: none;
}

.gantt-now-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #dc2626;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.9);
}

/* Status colors and pills */
.badge-cita { background-color: #8a3f46; color: #fff; } /* Cita / Guinda */
.badge-abierta { background-color: #8c8c8c; color: #fff; } /* Abierta o Sin Asignar / Gris */
.badge-proceso { background-color: #f1c232 !important; color: #000 !important; } /* En Proceso / Amarillo */
.badge-autorizacion { background-color: #c9b6e4 !important; color: #000 !important; } /* Esperando Autorización / Morado */
.badge-pausa { background-color: #c91c1c !important; color: #fff !important; } /* Detenido por Refacción / Rojo */
.badge-lavado { background-color: #49c7dc !important; color: #fff !important; } /* Lavando / Azul claro */
.badge-terminado { background-color: #2e7d32 !important; color: #fff !important; } /* Terminado / Verde */
.badge-entregado { background-color: #6aa84f !important; color: #fff !important; } /* Entregado / Verde */
.badge-prueba { background-color: #111111 !important; color: #fff !important; } /* Prueba de Manejo / Negro */

/* Blinking for Overdue - uses opacity so !important on background-color doesn't block it */
.overdue-blink {
  animation: overdue-opacity-blink 0.6s steps(1, end) infinite !important;
}

@keyframes overdue-opacity-blink {
  0%   { opacity: 1; }
  50%  { opacity: 0.1; }
  100% { opacity: 1; }
}

.badge-blink-red {
  color: #fff !important;
  animation: blink-red 1.2s infinite;
}

@keyframes blink-red {
  0%, 100% { background-color: #dc2626; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  50% { background-color: #ef4444; box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

/* Status circle indicators */
.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Live updates notification animation ping */
.sse-ping-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  display: inline-block;
  margin-right: 4px;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: status-pulsate 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes status-pulsate {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Signature drawing board */
#signature-pad {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  cursor: crosshair;
  background-color: #fafbfd;
}

/* Timeline flow connector highlight */
.gantt-block-flow-highlight {
  box-shadow: 0 0 0 3px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-2px) scale(1.02) !important;
  transition: all 0.2s ease !important;
  z-index: 30 !important;
}

@keyframes gantt-flow-dash {
  to {
    stroke-dashoffset: -20;
  }
}

.gantt-flow-line {
  stroke-dasharray: 8, 4;
  animation: gantt-flow-dash 0.6s linear infinite;
}
