/* category-highlighting.css */
/* ADD THIS FILE - Works with your existing port-detail-panel.css */
/* Highlights important fields based on port category */

/* ========================================
   CATEGORY-BASED FIELD HIGHLIGHTING
   ======================================== */

/* Highlight rows based on data attributes we'll add via JS */
.pdp-info-table tr[data-highlight="true"] td:first-child,
.pdp-depths-grid .pdp-depth-item[data-highlight="true"] .pdp-depth-label {
  color: #4a9eff !important;
  font-weight: 600 !important;
  position: relative;
}

.pdp-info-table tr[data-highlight="true"] td:first-child::before,
.pdp-depths-grid .pdp-depth-item[data-highlight="true"]::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 80%;
  background: linear-gradient(180deg, #4a9eff, #3a8eef);
  border-radius: 2px;
}

.pdp-info-table tr[data-highlight="true"] td:last-child {
  color: #fff !important;
  font-weight: 600 !important;
}

.pdp-depths-grid .pdp-depth-item[data-highlight="true"] .pdp-depth-val {
  color: #4a9eff !important;
  font-weight: 700 !important;
  font-size: 18px !important;
}

/* Commercial port highlights (green accent) */
[data-port-category*="commercial"] .pdp-info-table tr[data-field="Cargo Pier Depth (m)"] td:first-child::before,
[data-port-category*="commercial"] .pdp-info-table tr[data-field="Channel Depth (m)"] td:first-child::before,
[data-port-category*="commercial"] .pdp-info-table tr[data-field="Oil Terminal Depth (m)"] td:first-child::before,
[data-port-category*="commercial"] .pdp-info-table tr[data-field="Facilities – Wharves"] td:first-child::before {
  background: linear-gradient(180deg, #2ecc71, #27ae60);
}

/* Passenger port highlights (blue accent) */
[data-port-category*="passenger"] .pdp-info-table tr[data-field="Medical Facilities"] td:first-child::before,
[data-port-category*="passenger"] .pdp-info-table tr[data-field="Shelter Quality"] td:first-child::before,
[data-port-category*="passenger"] .pdp-info-table tr[data-field="Channel Depth (m)"] td:first-child::before,
[data-port-category*="passenger"] .pdp-info-table tr[data-field="Anchorage Depth (m)"] td:first-child::before {
  background: linear-gradient(180deg, #3498db, #2980b9);
}

/* Marina port highlights (teal accent) */
[data-port-category*="marina"] .pdp-info-table tr[data-field="Facilities – Med Mooring"] td:first-child::before,
[data-port-category*="marina"] .pdp-info-table tr[data-field="Facilities – Anchorage"] td:first-child::before,
[data-port-category*="marina"] .pdp-info-table tr[data-field="Shelter Quality"] td:first-child::before,
[data-port-category*="marina"] .pdp-info-table tr[data-field="Tidal Range (m)"] td:first-child::before,
[data-port-category*="marina"] .pdp-info-table tr[data-field="Anchorage Depth (m)"] td:first-child::before {
  background: linear-gradient(180deg, #16a085, #138d75);
}

/* Fishing port highlights (orange accent) */
[data-port-category*="fishing"] .pdp-info-table tr[data-field="Anchorage Depth (m)"] td:first-child::before,
[data-port-category*="fishing"] .pdp-info-table tr[data-field="Harbor Type"] td:first-child::before,
[data-port-category*="fishing"] .pdp-info-table tr[data-field="Shelter Quality"] td:first-child::before,
[data-port-category*="fishing"] .pdp-info-table tr[data-field="Facilities – Wharves"] td:first-child::before {
  background: linear-gradient(180deg, #f39c12, #e67e22);
}

/* Pulse animation for highlighted items */
@keyframes highlightPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pdp-info-table tr[data-highlight="true"],
.pdp-depths-grid .pdp-depth-item[data-highlight="true"] {
  animation: highlightPulse 2s ease-in-out;
}

/* ========================================
   SEARCH BAR FIX
   ======================================== */

/* Fix: Remove line under search icon when sidebar closed */
.sidebar-search {
  position: relative;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  /* Remove any extra borders/lines */
  margin: 0;
  box-shadow: none;
}

/* Fix: Proper icon positioning */
.search-icon {
  position: absolute;
  left: 28px; /* Adjust to align with input padding */
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #aaa;
  pointer-events: none;
  z-index: 1;
  transition: color 0.3s ease;
}

/* Input with proper padding for icon */
#portSearchInput {
  width: 100%;
  padding: 10px 12px 10px 38px; /* Left padding for icon */
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  transition: all 0.3s ease;
}

#portSearchInput:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: #4a9eff;
  outline: none;
}

#portSearchInput:focus ~ .search-icon {
  color: #4a9eff;
}

/* Fix: Hide search container when sidebar not expanded */
#mt-sidebar:not(.expanded):not(.pinned) .sidebar-search {
  display: none;
}

/* Suggestion items styling */
.autocomplete-suggestions > div {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.autocomplete-suggestions > div:hover,
.autocomplete-suggestions > div.highlight {
  background: rgba(74, 158, 255, 0.15);
  padding-left: 20px;
}

/* Highlight matching text in suggestions */
.autocomplete-suggestions > div strong {
  color: #4a9eff;
  font-weight: 600;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .pdp-info-table tr[data-highlight="true"] td:first-child::before,
  .pdp-depths-grid .pdp-depth-item[data-highlight="true"]::before {
    left: -8px;
    width: 3px;
  }
}
