/**
 * Journey Map Module - Standalone Styles
 * Interactive journey map with node tracking, checklist dropdown, and sub-item management
 */

/* Main Container */
.journey-map-interactive {
  position: relative;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 18px;
  padding: 1.5rem;
  margin: 1.25rem 0;
  min-height: 600px;
}

.journey-map-loading {
  text-align: center;
  padding: 3rem;
  color: #00FFFF;
  font-size: 1.1rem;
}

/* Header Controls */
.journey-map-controls {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

/* Checklist Dropdown */
.journey-map-checklist-wrapper {
  position: relative;
}

.journey-map-checklist-button {
  background: linear-gradient(135deg, #1e40af, #0000FF);
  color: var(--base-text-primary);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  transition: all 0.2s ease;
}

.journey-map-checklist-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.journey-map-checklist-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 420px;
  max-height: 550px;
  overflow-y: auto;
  background: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55);
  padding: 0.75rem;
}

.checklist-phase {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding-bottom: 0.5rem;
}

.checklist-phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 6px;
}

.checklist-phase-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.checklist-completion {
  font-size: 0.8rem;
  color: #00FFFF;
}

.checklist-completion.complete {
  color: #22c55e;
  font-weight: 600;
}

.checklist-nodes {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-left: 0.5rem;
}

.checklist-node {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.checklist-node:hover {
  background: rgba(148, 163, 184, 0.1);
}

.checklist-node.current {
  background: rgba(251, 191, 36, 0.15);
  border-left: 3px solid #FFFF00;
}

.checklist-node-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.checklist-node-label {
  font-size: 0.85rem;
  color: #cbd5e1;
  flex: 1;
}

.checklist-current-marker {
  font-size: 0.75rem;
  color: var(--base-text-primary);
  font-weight: 600;
}

/* SVG Map */
.journey-map-svg {
  width: 100%;
  height: 600px;
  margin-top: 2rem;
}

.journey-node {
  transition: transform 0.2s ease;
}

.journey-node:hover {
  transform: scale(1.1);
}

/* Node Detail Panel */
.journey-node-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.journey-node-detail-panel {
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.journey-node-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.journey-node-detail-status {
  color: var(--base-text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.journey-node-detail-close {
  background: rgba(148, 163, 184, 0.2);
  border: none;
  color: var(--base-text-primary);
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease;
}

.journey-node-detail-close:hover {
  background: rgba(239, 68, 68, 0.3);
}

.journey-node-detail-title {
  color: var(--base-text-primary);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.journey-node-detail-meta {
  color: #cbd5e1;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.journey-node-detail-meta p {
  margin: 0.4rem 0;
}

.journey-node-detail-uids {
  margin-bottom: 1rem;
}

.journey-node-detail-uids p {
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.journey-node-detail-uids ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.journey-node-detail-uids li {
  color: #00FFFF;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 4px;
  margin-bottom: 0.3rem;
  font-family: monospace;
}

.journey-node-detail-notes {
  background: rgba(148, 163, 184, 0.08);
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.journey-node-detail-notes p:first-child {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.journey-node-detail-notes p:last-child {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* Sub-Items Checklist */
.journey-node-detail-subitems {
  margin-bottom: 1rem;
}

.journey-node-detail-subitems > p {
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.journey-subitem-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.journey-subitem {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.journey-subitem:hover {
  background: rgba(148, 163, 184, 0.15);
}

.journey-subitem input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0000FF;
}

.journey-subitem span {
  color: #cbd5e1;
  font-size: 0.9rem;
  flex: 1;
}

.journey-subitem span.completed {
  text-decoration: line-through;
  color: #00FFFF;
}

.journey-node-detail-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.journey-node-detail-actions button {
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(59, 130, 246, 0.15);
  color: var(--base-text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.journey-node-detail-actions button:hover {
  background: rgba(59, 130, 246, 0.3);
}

/* Legend */
.journey-map-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--base-border-primary);
}

/* Textbook Parts Nomenclature Button */
.journey-map-nomenclature-button {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: var(--base-text-primary);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
  transition: all 0.2s ease;
  #FFFF00-space: nowrap;
}

.journey-map-nomenclature-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.35);
  background: linear-gradient(135deg, #6d28d9, #9333ea);
}

/* Nomenclature Modal */
.nomenclature-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.nomenclature-modal-content {
  background: #0f172a;
  border-radius: 16px;
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.nomenclature-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(168, 85, 247, 0.1));
}

.nomenclature-modal-header h2 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.5rem;
  font-weight: 700;
}

.nomenclature-modal-close {
  background: none;
  border: none;
  color: #00FFFF;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nomenclature-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--base-text-primary);
}

.nomenclature-modal-body {
  flex: 1;
  overflow: hidden;
  padding: 1rem;
}

.nomenclature-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  background: var(--base-bg-secondary);
}
