/* Unified view styles for nebula + monitoring */
.view {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.view.active {
  display: block;
}

/* Demo mode label - styled like taskbar buttons */
.demo-label {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 217, 255, 0.15);
  border: 1px solid rgba(0, 217, 255, 0.4);
  border-radius: 20px;
  color: #00D9FF;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
  animation: demoPulse 2s ease-in-out infinite;
}

@keyframes demoPulse {
  0%, 100% {
    opacity: 0.8;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.4);
  }
}

@media (max-width: 768px) {
  .demo-label {
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Nebula view */
#nebulaView {
  background: #000;
}

#nebulaView canvas {
  display: block;
}

/* Monitoring view */
#monitoringView {
  background: #0a0a0a;
  color: #fff;
  font-family: 'Bruno Ace SC';
  padding: 2rem;
  padding-bottom: 80px;
  overflow-y: auto;
  height: 100vh;
}

#monitoringView h1 {
  font-family: 'Bruno Ace SC';
  color: #00D9FF;
  font-size: 2rem;
  margin-bottom: 0;
  text-shadow: 0 2px 8px rgba(0, 217, 255, 0.5);
  font-weight: 700;
}

#monitoringView .subtitle {
  color: #888;
  margin-bottom: 2rem;
  font-size: 89%;
}

#monitoringView .dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

#monitoringView .card {
  background: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

#monitoringView .card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #00D9FF;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#monitoringView .status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

#monitoringView .status-item {
  text-align: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

#monitoringView .status-value {
  font-size: 2rem;
  font-weight: bold;
  color: #00D9FF;
}

#monitoringView .status-label {
  font-size: 0.9rem;
  color: #888;
  margin-top: 0.5rem;
}

#monitoringView .task-filter {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Bruno Ace SC';
  transition: all 0.2s;
}

#monitoringView .task-filter:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

#monitoringView .task-filter.active {
  background: rgba(0, 217, 255, 0.15);
  color: #00D9FF;
  border-color: #00D9FF;
}

#monitoringView .task-container {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 300px);
}

#monitoringView .task-list {
  background: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow-y: auto;
  padding: 1rem;
}

#monitoringView .task-item {
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s;
}

#monitoringView .task-item:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 217, 255, 0.3);
}

#monitoringView .task-item.selected {
  background: rgba(0, 217, 255, 0.1);
  border-color: #00D9FF;
}

#monitoringView .task-details {
  background: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-y: auto;
}

#monitoringView .status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

#monitoringView .status-badge.queued { background: rgba(255, 193, 7, 0.2); color: #FFC107; }
#monitoringView .status-badge.in_progress { background: rgba(33, 150, 243, 0.2); color: #2196F3; }
#monitoringView .status-badge.blocked { background: rgba(244, 67, 54, 0.2); color: #F44336; }
#monitoringView .status-badge.complete { background: rgba(76, 175, 80, 0.2); color: #4CAF50; }

/* Project dropdown */
#monitoringView .project-dropdown {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Bruno Ace SC';
  transition: all 0.2s;
  padding-right: 1.5rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
}

#monitoringView .project-dropdown:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

#monitoringView .project-dropdown:focus {
  outline: none;
  border-color: #00D9FF;
  color: #00D9FF;
}

#monitoringView .project-dropdown option {
  background: #1a1a1a;
  color: #ccc;
}

/* Archive button */
#monitoringView .archive-btn {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(244, 67, 54, 0.4);
  border-radius: 4px;
  background: rgba(244, 67, 54, 0.1);
  color: #F44336;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Bruno Ace SC';
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

#monitoringView .archive-btn:hover {
  background: rgba(244, 67, 54, 0.25);
  border-color: #F44336;
}

/* Project tag in task list */
#monitoringView .project-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  background: rgba(0, 217, 255, 0.1);
  color: #00D9FF;
  border: 1px solid rgba(0, 217, 255, 0.2);
}

/* Chain tag in task list */
#monitoringView .chain-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  background: rgba(255, 152, 0, 0.1);
  color: #FF9800;
  border: 1px solid rgba(255, 152, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s;
}

#monitoringView .chain-tag:hover {
  background: rgba(255, 152, 0, 0.25);
  border-color: #FF9800;
}

#monitoringView .chain-depth-badge {
  font-size: 0.6rem;
  opacity: 0.7;
}

/* Chain filter pill */
#monitoringView .chain-filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-family: 'Bruno Ace SC';
  background: rgba(255, 152, 0, 0.15);
  color: #FF9800;
  border: 1px solid rgba(255, 152, 0, 0.4);
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-family: 'Bruno Ace SC';
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.modal-btn-cancel {
  background: transparent;
  color: #888;
  border-color: rgba(255, 255, 255, 0.15);
}

.modal-btn-cancel:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-btn-confirm {
  background: rgba(244, 67, 54, 0.2);
  color: #F44336;
  border-color: rgba(244, 67, 54, 0.4);
}

.modal-btn-confirm:hover {
  background: rgba(244, 67, 54, 0.35);
}

@media (max-width: 768px) {
  #monitoringView {
    padding: 1rem;
  }

  #monitoringView .task-container {
    grid-template-columns: 1fr;
    height: auto;
  }

  #monitoringView .task-list {
    max-height: 400px;
  }

  #taskFilters {
    flex-direction: column;
  }

  #taskFilters > div:last-child {
    margin-left: 0 !important;
  }
}
