/* Roadmap Viewer Styles */

body {
  background-color: #1f252d;
  margin: 0;
  padding: 0;
  color: #fff;
}

/* Full-width layout for roadmap viewer (overrides common.css) */
body .roadmap-viewer-layout {
  width: 100%;
}

.roadmap-viewer-layout {
  display: flex;
  height: 100vh;
  background-color: #1f252d;
  color: #fff;
}

/* Left Panel - Roadmap Viewer */
.left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #1f252d;
  border-right: 1px solid #333;
}

.panel-header {
  padding: 1rem;
  background-color: #1f252d;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

.company-logo {
  height: 40px;
  width: auto;
  max-width: 200px;
  cursor: pointer;
}

.header-left h2 {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
}

.panel-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Legend - transparent overlay on left (above nodes/edges) */
.roadmap-legend {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "Rubik", sans-serif;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-item i {
  color: var(--primary-color, #10ac84);
  width: 1rem;
  text-align: center;
}

/* Show desktop/touch legend based on input type */
.legend-touch {
  display: none;
}
.legend-desktop {
  display: inline;
}
@media (hover: none) and (pointer: coarse) {
  .legend-touch {
    display: inline;
  }
  .legend-desktop {
    display: none;
  }
}

/* Right Panel - Node Content Viewer */
.right-panel {
  width: 500px;
  min-width: 300px;
  max-width: 80vw;
  background-color: #1f252d;
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Resize Handle */
.resize-handle {
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 6px;
  background-color: transparent;
  cursor: col-resize;
  z-index: 10;
  transition: background-color 0.2s ease;
}

.resize-handle:hover {
  background-color: #10ac84;
}

.resize-handle:active {
  background-color: #0d8f6f;
}

.right-panel-header {
  padding: 1rem;
  background-color: #1f252d;
  border-bottom: 1px solid #333;
}

.right-panel-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
}

.menu-content {
  flex: 1;
  overflow-y: auto;
}

.node-content-panel {
  padding: 1rem;
}

.node-content-header h4 {
  margin: 0 0 1rem 0;
  color: #fff;
  font-size: 1.1rem;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
}

.node-content-body {
  color: #fff;
}

.placeholder-text {
  font-style: italic;
  color: #666;
  text-align: center;
  margin-top: 2rem;
}

/* Topic Content Styles */
.topic-content {
  margin-top: 1rem;
}

.topic-content h3 {
  margin: 0 0 1rem 0;
  color: #10ac84;
  font-size: 1.2rem;
  border-bottom: 2px solid #10ac84;
  padding-bottom: 0.5rem;
}

.topic-body {
  color: #e2e8f0;
  line-height: 1.7;
  text-align: left;
  font-size: 15px;
  font-weight: 400;
  max-width: none;
}

.topic-body h1,
.topic-body h2,
.topic-body h3,
.topic-body h4,
.topic-body h5,
.topic-body h6 {
  color: #fff;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.topic-body h1 {
  font-size: 2rem;
  border-bottom: 2px solid #10ac84;
  padding-bottom: 0.5rem;
  margin-top: 0;
}

.topic-body h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #4a5568;
  padding-bottom: 0.3rem;
}

.topic-body h3 {
  font-size: 1.25rem;
  color: #10ac84;
}

.topic-body h4 {
  font-size: 1.1rem;
  color: #cbd5e0;
}

.topic-body h5,
.topic-body h6 {
  font-size: 1rem;
  color: #a0aec0;
}

.topic-body p {
  margin-bottom: 1.25rem;
  color: #e2e8f0;
}

.topic-body ul,
.topic-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: #e2e8f0;
}

.topic-body li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.topic-body ul li {
  list-style-type: disc;
}

.topic-body ol li {
  list-style-type: decimal;
}

.topic-body code {
  background-color: #2d3748;
  color: #f7fafc;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
    "Source Code Pro", monospace;
  font-size: 0.875rem;
  font-weight: 500;
}

.topic-body pre {
  background-color: #1a202c;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #2d3748;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
    "Source Code Pro", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.topic-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.topic-body blockquote {
  border-left: 4px solid #10ac84;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background-color: #2d3748;
  border-radius: 0 4px 4px 0;
  color: #cbd5e0;
  font-style: italic;
}

.topic-body a {
  color: #10ac84;
  text-decoration: none;
  font-weight: 500;
}

.topic-body a:hover {
  text-decoration: underline;
  color: #0d8f6f;
}

.topic-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #4a5568;
}

.topic-body th,
.topic-body td {
  border: 1px solid #4a5568;
  padding: 0.75rem 1rem;
  text-align: left;
  color: #e2e8f0;
}

.topic-body th {
  background-color: #2d3748;
  font-weight: 600;
  color: #fff;
}

.topic-body tr:nth-child(even) {
  background-color: #2d3748;
}

.topic-body tr:hover {
  background-color: #4a5568;
}

.topic-loading {
  text-align: center;
  padding: 0.5rem;
  color: #666;
  font-style: italic;
}

.topic-error {
  text-align: center;
  padding: 2rem;
  color: #dc3545;
  font-style: italic;
}

/* Modal Styles */
.modal {
  display: block;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #000101 0%, #1f252d 100%);
}

.modal-content {
  background-color: #1f252d;
  margin: 15% auto;
  padding: 0;
  border: 1px solid #333;
  border-radius: 8px;
  width: 400px;
  max-width: 90%;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.modal-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-logo {
  height: 50px;
  width: auto;
  max-width: 250px;
}

.modal-header h3 {
  margin: 0;
  color: #fff;
  text-align: center;
}

.modal-body {
  padding: 1rem;
}

.modal-body label {
  display: block;
  margin-bottom: 0.5rem;
  color: #fff;
  font-weight: 500;
}

.modal-body input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #2d3748;
  color: #fff;
  font-size: 1rem;
  box-sizing: border-box;
}

.modal-body input:focus {
  outline: none;
  border-color: #10ac84;
}

.modal-footer {
  padding: 1rem;
  border-top: 1px solid #333;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: #10ac84;
  color: white;
}

.btn-primary:hover {
  background-color: #0e9a73;
}

.btn-secondary {
  background-color: #333;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
  .roadmap-viewer-layout {
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
  }

  .left-panel {
    flex: 1;
    min-height: 0;
    min-width: 0;
  }

  .panel-content {
    min-height: 200px;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .logo-link {
    display: flex;
    align-items: center;
  }

  .company-logo {
    height: 30px;
  }

  .header-left h2 {
    font-size: 1.2rem;
  }

  .roadmap-legend {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    left: 0.5rem;
    top: 0.5rem;
  }

  .right-panel {
    width: 100%;
    min-width: 0; /* Allow flex shrink, prevent overflow */
    max-width: none;
    height: 40vh;
    min-height: 200px;
    max-height: 50vh;
    border-left: none;
    border-top: 1px solid #333;
    flex-shrink: 0;
  }

  .right-panel-header {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding-inline-end: max(1rem, env(safe-area-inset-right));
  }

  .menu-content,
  .node-content-panel,
  .node-content-body,
  #nodeContentDisplay,
  .topic-content,
  .topic-body {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .node-content-panel {
    padding: 1rem;
    padding-inline-end: max(1rem, env(safe-area-inset-right));
  }

  .topic-body {
    overflow-wrap: break-word;
  }

  .topic-body pre {
    max-width: 100%;
  }

  .resize-handle {
    display: none;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .modal-logo {
    height: 40px;
    max-width: 200px;
  }

  .modal-header {
    padding: 0.75rem;
    gap: 0.75rem;
  }
}
