/**
 * @file
 * Styles for the NodeHive sitemap visualization.
 */

.nodehive-sitemap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nodehive-sitemap .sitemap-header {
  margin-bottom: 30px;
  text-align: center;
}

.nodehive-sitemap .sitemap-header h2 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 2rem;
  font-weight: 600;
}

.nodehive-sitemap .sitemap-description {
  color: #7f8c8d;
  font-size: 1.1rem;
  margin: 0;
}

.nodehive-sitemap .sitemap-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.nodehive-sitemap .sitemap-section {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
}

.nodehive-sitemap .sitemap-section--menu .section-header {
  background: linear-gradient(135deg, #0052cc 0%, #2684ff 100%);
  color: white;
  padding: 12px 16px;
}

.nodehive-sitemap .sitemap-section--orphaned {
  margin-top: 30px;
}

.nodehive-sitemap .sitemap-section--orphaned .section-header {
  background: linear-gradient(135deg, #ffab00 0%, #ff8b00 100%);
  color: white;
  padding: 12px 16px;
}

.nodehive-sitemap .sitemap-section--info .section-header {
  background: linear-gradient(135deg, #36b37e 0%, #00875a 100%);
  color: white;
  padding: 12px 16px;
}

.nodehive-sitemap .info-section {
  padding: 16px;
  background: #e3fcef;
  border-left: 4px solid #36b37e;
  margin: 0;
}

.nodehive-sitemap .info-section p {
  margin: 0;
  color: #006644;
  font-size: 0.9rem;
  line-height: 1.5;
}

.nodehive-sitemap .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nodehive-sitemap .section-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nodehive-sitemap .section-icon {
  font-size: 1.2rem;
}

.nodehive-sitemap .section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nodehive-sitemap .section-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.nodehive-sitemap .section-edit-link:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

.nodehive-sitemap .sitemap-tree {
  padding: 16px;
}

.nodehive-sitemap .sitemap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nodehive-sitemap .sitemap-item {
  position: relative;
}

.nodehive-sitemap .sitemap-item--node {
  flex: 0 0 auto;
}

.nodehive-sitemap .sitemap-item--menu_item {
  flex: 1 1 100%;
  margin-bottom: 12px;
}

.nodehive-sitemap .sitemap-children {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid #dfe1e6;
}

.nodehive-sitemap .sitemap-children .sitemap-list {
  margin-top: 8px;
}

/* Node Cards - Compact Jira-style */
.nodehive-sitemap .node-card {
  background: #ffffff;
  border: 1px solid #dfe1e6;
  border-radius: 4px;
  padding: 8px 12px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  max-width: 280px;
  min-height: 60px;
}

.nodehive-sitemap .node-card:hover {
  border-color: #0052cc;
  box-shadow: 0 2px 6px rgba(0, 82, 204, 0.15);
  transform: translateY(-1px);
}

.nodehive-sitemap .node-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.nodehive-sitemap .node-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nodehive-sitemap .node-title a {
  color: #172b4d;
  text-decoration: none;
}

.nodehive-sitemap .node-title a:hover {
  color: #0052cc;
  text-decoration: underline;
}

.nodehive-sitemap .node-status {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  margin-left: 8px;
}

.nodehive-sitemap .node-status--published {
  background: #e3fcef;
  color: #006644;
}

.nodehive-sitemap .node-status--unpublished {
  background: #ffebe6;
  color: #bf2600;
}

.nodehive-sitemap .status-indicator {
  font-size: 0.6rem;
}

.nodehive-sitemap .node-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nodehive-sitemap .node-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.nodehive-sitemap .content-type {
  display: inline-flex;
  align-items: center;
}

.nodehive-sitemap .node-slug {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.nodehive-sitemap .content-type-badge {
  background: #f4f5f7;
  color: #5e6c84;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nodehive-sitemap .content-type-badge--page {
  background: #deebff;
  color: #0747a6;
}

.nodehive-sitemap .content-type-badge--article {
  background: #e6fcff;
  color: #026aa7;
}

.nodehive-sitemap .content-type-badge--product {
  background: #e3fcef;
  color: #006644;
}

.nodehive-sitemap .content-type-badge--menu_item {
  background: #eae6ff;
  color: #5243aa;
}

.nodehive-sitemap .content-type-badge--external_node {
  background: #f4f5f7;
  color: #97a0af;
}

.nodehive-sitemap .content-type-badge--broken_link {
  background: #ffebe6;
  color: #bf2600;
}

.nodehive-sitemap .slug {
  background: transparent;
  color: #6b778c;
  font-size: 0.7rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 4px;
}

.nodehive-sitemap .node-actions {
  display: none; /* Hide actions in compact view, show on hover */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #dfe1e6;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 6px;
  gap: 6px;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nodehive-sitemap .node-card {
  position: relative;
}

.nodehive-sitemap .node-card:hover .node-actions {
  display: flex;
}

.nodehive-sitemap .action-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

.nodehive-sitemap .action-link--edit {
  background: #fff4e6;
  color: #974f0c;
  border: 1px solid #ffab00;
}

.nodehive-sitemap .action-link--edit:hover {
  background: #ffab00;
  color: white;
}

.nodehive-sitemap .action-link--view {
  background: #e6fcff;
  color: #026aa7;
  border: 1px solid #00b8d9;
}

.nodehive-sitemap .action-link--view:hover {
  background: #00b8d9;
  color: white;
}

/* Menu Items */
.nodehive-sitemap .menu-item {
  background: #f4f5f7;
  border: 1px solid #dfe1e6;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.nodehive-sitemap .menu-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nodehive-sitemap .menu-item-title {
  font-weight: 500;
  color: #172b4d;
  font-size: 0.9rem;
}

.nodehive-sitemap .menu-item-url {
  font-size: 0.75rem;
}

.nodehive-sitemap .menu-item-url code {
  background: #e4e6ea;
  color: #6b778c;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.7rem;
}

/* Empty States */
.nodehive-sitemap .empty-section,
.nodehive-sitemap .empty-sitemap {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.nodehive-sitemap .empty-section p,
.nodehive-sitemap .empty-sitemap p {
  margin: 0 0 10px 0;
  font-size: 1rem;
}

.nodehive-sitemap .empty-sitemap {
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

/* Search and Controls */
.nodehive-sitemap .sitemap-search-container {
  margin: 20px 0;
  text-align: center;
}

.nodehive-sitemap .sitemap-search {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.nodehive-sitemap .sitemap-search:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.nodehive-sitemap .sitemap-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0 25px 0;
}

.nodehive-sitemap .sitemap-control-btn {
  padding: 8px 16px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nodehive-sitemap .sitemap-control-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* Toggle Buttons */
.nodehive-sitemap .sitemap-toggle,
.nodehive-sitemap .section-toggle {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 4px;
  margin-right: 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  transition: all 0.2s ease;
  min-width: 20px;
  text-align: center;
}

.nodehive-sitemap .sitemap-toggle:hover,
.nodehive-sitemap .section-toggle:hover {
  background: #e9ecef;
  color: #495057;
}

.nodehive-sitemap .section-toggle {
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.nodehive-sitemap .section-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Search States */
.nodehive-sitemap .search-hidden {
  display: none !important;
}

.nodehive-sitemap .search-match {
  background: rgba(255, 235, 59, 0.1);
  border-color: #ffc107 !important;
}

.nodehive-sitemap .search-match .node-card {
  border-color: #ffc107;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

/* Collapsed States */
.nodehive-sitemap .collapsed > .sitemap-children {
  display: none;
}

.nodehive-sitemap .section-collapsed .sitemap-tree,
.nodehive-sitemap .section-collapsed .empty-section {
  display: none;
}

/* Animation for tree lines */
.nodehive-sitemap .sitemap-item::before {
  transition: opacity 0.3s ease;
}

.nodehive-sitemap .collapsed::before {
  opacity: 0.3;
}

/* Orphaned Content Table */
.nodehive-sitemap .orphaned-content-section {
  background: #ffffff;
}

.nodehive-sitemap .orphaned-search-container {
  padding: 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #dfe1e6;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nodehive-sitemap .orphaned-search {
  flex: 1;
  max-width: 400px;
  padding: 10px 16px;
  border: 2px solid #dfe1e6;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease;
  background: white;
}

.nodehive-sitemap .orphaned-search:focus {
  border-color: #0052cc;
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.nodehive-sitemap .search-results-info {
  font-size: 0.8rem;
  color: #6b778c;
  font-weight: 500;
}

.nodehive-sitemap .orphaned-table-container {
  padding: 16px;
  overflow-x: auto;
}

.nodehive-sitemap .orphaned-content-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 20px 0;
  table-layout: auto;
}

.nodehive-sitemap .orphaned-content-table thead th {
  background: #f4f5f7;
  padding: 16px 20px;
  border-radius: 8px 8px 0 0;
  border: 1px solid #dfe1e6;
  border-bottom: none;
  vertical-align: top;
  position: sticky;
  top: 0;
  z-index: 10;
  min-width: 320px;
  max-width: 400px;
}

.nodehive-sitemap .orphaned-content-table tbody td {
  background: #ffffff;
  padding: 0 20px 20px 20px;
  border: 1px solid #dfe1e6;
  border-top: none;
  border-radius: 0 0 8px 8px;
  vertical-align: top;
  min-width: 320px;
  max-width: 400px;
}

.nodehive-sitemap .content-type-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 4px 0;
}

.nodehive-sitemap .content-type-header .content-type-badge {
  font-size: 0.85rem;
  padding: 4px 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nodehive-sitemap .content-count {
  font-size: 0.85rem;
  color: #6b778c;
  font-weight: 600;
  background: #f4f5f7;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

.nodehive-sitemap .content-type-nodes {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 700px;
  overflow-y: auto;
  padding-right: 8px;
}

.nodehive-sitemap .content-type-nodes::-webkit-scrollbar {
  width: 8px;
}

.nodehive-sitemap .content-type-nodes::-webkit-scrollbar-track {
  background: #f4f5f7;
  border-radius: 4px;
}

.nodehive-sitemap .content-type-nodes::-webkit-scrollbar-thumb {
  background: #dfe1e6;
  border-radius: 4px;
}

.nodehive-sitemap .content-type-nodes::-webkit-scrollbar-thumb:hover {
  background: #b3bac5;
}

.nodehive-sitemap .node-card--table {
  margin-bottom: 0;
  width: 100%;
  max-width: none;
  min-height: 100px;
  padding: 12px 16px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nodehive-sitemap .node-card--table .node-title {
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  max-height: none;
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.nodehive-sitemap .node-card--table .node-title a {
  color: #172b4d;
  text-decoration: none;
  display: block;
}

.nodehive-sitemap .node-card--table .node-title a:hover {
  color: #0052cc;
  text-decoration: underline;
}

.nodehive-sitemap .node-card--table .slug {
  font-size: 0.75rem;
  color: #6b778c;
  background: #f4f5f7;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

.nodehive-sitemap .node-card--table .node-status {
  font-size: 0.75rem;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.nodehive-sitemap .node-card--table .action-link {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.nodehive-sitemap .node-card--table .node-card-header {
  margin-bottom: 8px;
  align-items: flex-start;
}

.nodehive-sitemap .node-card--table .node-meta {
  margin-top: 8px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* Empty table state */
.nodehive-sitemap .orphaned-content-table tbody td:empty::after {
  content: "No content";
  color: #97a0af;
  font-style: italic;
  font-size: 0.9rem;
  display: block;
  text-align: center;
  padding: 20px;
}

/* Search functionality */
.nodehive-sitemap .node-card--hidden {
  display: none !important;
}

.nodehive-sitemap .node-card--search-match {
  background: #fff3cd;
  border-color: #ffc107;
}

.nodehive-sitemap .search-highlight {
  background: #ffeb3b;
  padding: 1px 2px;
  border-radius: 2px;
}

/* Table responsive behavior */
@media (max-width: 1400px) {
  .nodehive-sitemap .orphaned-content-table {
    border-spacing: 16px 0;
  }

  .nodehive-sitemap .orphaned-content-table thead th,
  .nodehive-sitemap .orphaned-content-table tbody td {
    min-width: 300px;
    max-width: 350px;
  }
}

@media (max-width: 1200px) {
  .nodehive-sitemap .orphaned-content-table {
    border-spacing: 12px 0;
  }

  .nodehive-sitemap .orphaned-content-table thead th,
  .nodehive-sitemap .orphaned-content-table tbody td {
    min-width: 280px;
    max-width: 320px;
  }
}

@media (max-width: 900px) {
  .nodehive-sitemap .orphaned-table-container {
    padding: 12px;
  }

  .nodehive-sitemap .orphaned-content-table {
    border-spacing: 8px 0;
  }

  .nodehive-sitemap .orphaned-content-table thead th,
  .nodehive-sitemap .orphaned-content-table tbody td {
    min-width: 250px;
    max-width: 280px;
  }

  .nodehive-sitemap .content-type-nodes {
    max-height: 500px;
  }

  .nodehive-sitemap .node-card--table {
    min-height: 90px;
    padding: 10px 12px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .nodehive-sitemap {
    padding: 15px;
  }

  .nodehive-sitemap .sitemap-header h2 {
    font-size: 1.5rem;
  }

  .nodehive-sitemap .sitemap-description {
    font-size: 1rem;
  }

  .nodehive-sitemap .node-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nodehive-sitemap .node-meta {
    font-size: 0.85rem;
  }

  .nodehive-sitemap .sitemap-children {
    margin-left: 15px;
    padding-left: 15px;
  }

  .nodehive-sitemap .action-link {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .nodehive-sitemap .sitemap-controls {
    flex-direction: column;
    align-items: center;
  }

  .nodehive-sitemap .sitemap-control-btn {
    width: 120px;
  }

  .nodehive-sitemap .sitemap-search {
    font-size: 0.9rem;
    padding: 10px 14px;
  }
}
