/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* SortableJS styles */
.sortable-ghost {
  opacity: 0.4;
  background: #f3f4f6;
}

.sortable-drag {
  cursor: grabbing !important;
}

.sortable-chosen {
  cursor: grabbing !important;
}

/* Timestamp Slider styles */
/* Make the slider thumbs clickable and visible */
input[type="range"].slider-thumb-blue {
  pointer-events: auto;
}

input[type="range"].slider-thumb-blue::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

input[type="range"].slider-thumb-blue::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

input[type="range"].slider-thumb-blue::-webkit-slider-thumb:hover {
  background: #1d4ed8;
}

input[type="range"].slider-thumb-blue::-moz-range-thumb:hover {
  background: #1d4ed8;
}

/* Real-time collaboration styles */
.task-updated {
  animation: pulse-update 1s ease-in-out;
}

@keyframes pulse-update {
  0%, 100% { background-color: transparent; }
  50% { background-color: #dbeafe; }
}

.task-created {
  animation: slide-in 0.5s ease-out;
}

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

.task-removed {
  animation: fade-out 0.3s ease-out;
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Flash messages */
.flash-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-out;
  font-weight: 500;
}

.flash-message.show {
  opacity: 1;
  transform: translateX(0);
}

.flash-info {
  background: #3b82f6;
  color: white;
}

.flash-success {
  background: #10b981;
  color: white;
}

.flash-warning {
  background: #f59e0b;
  color: white;
}

.flash-error {
  background: #ef4444;
  color: white;
}

/* Connection error banner */
.connection-error {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fef2f2;
  border-bottom: 2px solid #ef4444;
  padding: 12px 24px;
  text-align: center;
  z-index: 9998;
  color: #991b1b;
  font-weight: 500;
  animation: slide-down 0.3s ease-out;
}

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

.connection-error.hidden {
  display: none;
}

/* Presence indicator */
.presence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1e40af;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.presence-indicator::before {
  content: '👁️';
  font-size: 1rem;
}

.presence-indicator.hidden {
  display: none;
}

/* Optimistic update styling */
.task-row.optimistic {
  opacity: 0.6;
  position: relative;
}

.task-row.optimistic::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(59, 130, 246, 0.05) 10px,
    rgba(59, 130, 246, 0.05) 20px
  );
  pointer-events: none;
}

/* Search highlighting */
mark {
  background-color: #fef08a;
  color: #854d0e;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: 500;
}

.search-result-highlight {
  background-color: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding-left: 8px;
}

/* Search form enhancements */
.search-operator-hint {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: 8px;
}

.search-operator-hint code {
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.875rem;
  font-family: 'Courier New', monospace;
}

/* Task description expand/collapse */
[data-task-expand-target="summary"],
[data-task-expand-target="fullDescription"] {
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

[data-task-expand-target="fullDescription"] {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

[data-task-expand-target="fullDescription"].expanded {
  max-height: none;
  opacity: 1;
  overflow: visible;
}
