/* ==========================================================================
   YAKS MARINE — Ports & Network Styles
   ========================================================================== */

/* ── Dashboard Layout ───────────────────────────────────────────────────── */

.ports-dashboard {
  background: radial-gradient(circle at 50% 0%, var(--navy) 0%, var(--deep-navy) 100%);
  padding: var(--space-12) 0;
  border-bottom: 1.5px solid var(--border);
  position: relative;
  overflow: hidden;
  color: var(--white);
}

.ports-dashboard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath fill-rule='evenodd' d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zM11 13c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm48 25c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.ports-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-6);
  align-items: stretch;
}

/* ── Interactive Map Canvas ─────────────────────────────────────────────── */

.ports-map-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
}

.ports-map-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.ports-map-header h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ports-map-header h3::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #10B981;
  border-radius: 50%;
  animation: pulse-green 1.5s infinite;
}

.ports-map-filters {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.map-filter-input,
.map-filter-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  outline: none;
  transition: all 0.2s ease;
}

.map-filter-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.map-filter-input:focus,
.map-filter-select:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.15);
}

.map-filter-select option {
  background: var(--navy);
  color: var(--white);
}

.ports-map-canvas {
  flex: 1;
  padding: var(--space-6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

/* SVG Styling */
#ports-svg-map {
  width: 100%;
  max-width: 1000px;
  height: auto;
  display: block;
}

.port-marker-node {
  cursor: pointer;
  outline: none;
}

.port-marker-node circle {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.port-marker-node:hover circle {
  fill: var(--gold);
  stroke-width: 3.5;
  r: 9;
  filter: drop-shadow(0 0 8px rgba(var(--gold-rgb), 0.6));
}

.port-marker-node.active circle {
  fill: var(--gold);
  stroke: var(--white);
  stroke-width: 3.5;
  r: 9.5;
  filter: drop-shadow(0 0 12px rgba(var(--gold-rgb), 0.8));
}

.port-marker-node text {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: 11px;
  fill: var(--white);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
}

.port-marker-node.pulse-match circle {
  animation: marker-pulse-orange 1.5s infinite;
}

/* Simulated Vessel Node Animations */
.vessel-node {
  pointer-events: none;
  transition: transform 1.5s linear;
}

.vessel-node text {
  font-size: 8px;
  font-weight: 700;
  fill: var(--white);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

.vessel-pulse .v-ring {
  animation: pulse-ring-expand 1s ease-out infinite;
}

/* ── Telemetry Side Panel ───────────────────────────────────────────────── */

.telemetry-side-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.telemetry-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
}

.telemetry-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-badge {
  font-size: 10px;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
}

.status-operational {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
}

.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
}

.telemetry-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.telemetry-spec-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.telemetry-spec-label {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 2px;
}

.telemetry-spec-val {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--white);
}

/* Weather Widget Panel */
.weather-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.weather-metric-box {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.weather-metric-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  stroke: var(--gold);
}

.weather-metric-data .lbl {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.weather-metric-data .val {
  font-size: 12px;
  font-weight: var(--weight-bold);
  color: var(--white);
}

/* ── Live Fleet Simulator Section ───────────────────────────────────────── */

.fleet-section {
  padding: var(--space-12) 0;
  background: var(--light-bg);
}

.fleet-table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.fleet-table-container {
  overflow-x: auto;
}

.fleet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.fleet-table th {
  background: var(--deep-navy);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: var(--space-4) var(--space-6);
  border: none;
}

.fleet-table td {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1.5px solid var(--border);
  vertical-align: middle;
  font-size: var(--text-sm);
  color: var(--text-body);
}

.fleet-table tr:last-child td {
  border-bottom: none;
}

.fleet-table .vessel-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.fleet-table .vessel-row:hover {
  background-color: var(--light-bg-alt);
}

.fleet-table .v-name {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  color: var(--navy);
  font-size: var(--text-sm);
}

.fleet-table .v-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.vessel-status-badge {
  font-size: 10px;
  font-weight: var(--weight-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  display: inline-block;
}

.vessel-status-badge.en-route {
  background: rgba(var(--secondary-rgb), 0.1);
  color: var(--secondary);
}

.vessel-status-badge.transiting-canal {
  background: rgba(14, 116, 144, 0.1);
  color: #0E7490;
}

.vessel-status-badge.docked {
  background: rgba(16, 185, 129, 0.1);
  color: #10B981;
}

.vessel-status-badge.anchored {
  background: rgba(245, 158, 11, 0.1);
  color: #D97706;
}

.fleet-table .v-dest {
  font-weight: var(--weight-semibold);
  color: var(--text-dark);
}

.fleet-table .v-eta {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.fleet-table .v-speed {
  font-weight: var(--weight-semibold);
  color: var(--text-dark);
}

.fleet-table .v-heading {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Port Cards Section ─────────────────────────────────────────────────── */

.ports-grid-section {
  padding: var(--space-16) 0;
  background: var(--white);
}

.port-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.port-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-dark);
}

.port-card-img-wrapper {
  height: 220px;
  position: relative;
  overflow: hidden;
}

.port-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.port-card:hover .port-card-img {
  transform: scale(1.05);
}

.port-card-badge {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  background: rgba(var(--navy-rgb), 0.85);
  backdrop-filter: blur(4px);
  color: var(--white);
  border: none;
  font-size: 10px;
  padding: 4px 10px;
}

.port-card-content {
  padding: var(--space-6);
}

.port-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.port-card-desc {
  font-size: var(--text-sm);
  color: var(--text-body);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  min-height: 60px;
}

.port-card-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  margin-bottom: var(--space-6);
}

.port-card-meta span strong {
  color: var(--text-dark);
}

.port-card-actions {
  display: flex;
  gap: var(--space-3);
}

.port-card-actions .btn {
  flex: 1;
  text-align: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* ── Animation Keyframes ────────────────────────────────────────────────── */

@keyframes pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes marker-pulse-orange {
  0% { r: 6; opacity: 1; }
  50% { r: 12; opacity: 0.5; }
  100% { r: 6; opacity: 1; }
}

@keyframes pulse-ring-expand {
  0% { r: 4; opacity: 1; }
  100% { r: 14; opacity: 0; }
}

/* ── Responsive Media Queries ───────────────────────────────────────────── */

@media (max-width: 1200px) {
  .ports-dashboard-grid {
    grid-template-columns: 1fr 340px;
  }
}

@media (max-width: 992px) {
  .ports-dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .ports-map-canvas {
    min-height: 350px;
  }
}

@media (max-width: 768px) {
  .ports-map-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .ports-map-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .telemetry-spec-grid {
    grid-template-columns: 1fr;
  }
}
