/**
 * packet_tracer.css - Authentic Cisco Packet Tracer Visual Design & Theme
 * Part of PXL Web NetSim (Hogeschool PXL)
 */

:root {
  --pxl-blue: #0284c7;
  --pxl-blue-dark: #0369a1;
  --pxl-accent: #f59e0b;
  --cisco-cyan: #00bceb;
  --pt-canvas-bg: #f8fafc;
  --pt-border: #cbd5e1;
  --pt-header-bg: #ffffff;
  --pt-shelf-bg: #f1f5f9;
  --pt-text: #0f172a;
  --pt-text-muted: #64748b;
  --pt-green: #22c55e;
  --pt-red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--pt-canvas-bg);
  color: var(--pt-text);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP NAVBAR */
.pt-header {
  height: 56px;
  background-color: var(--pt-header-bg);
  border-bottom: 1px solid var(--pt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  z-index: 20;
}

.pt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pt-brand-logo {
  height: 38px;
  width: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.pt-brand-titles h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--pxl-blue-dark);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.pt-brand-titles p {
  display: none !important;
}

.pt-header-center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pt-exam-title-badge {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  background: #f1f5f9;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-timer-badge {
  font-family: 'Consolas', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--pt-border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-score-badge {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  gap: 4px;
}

.pt-score-text {
  font-size: 12px;
  font-weight: 700;
  color: #0284c7;
}

.pt-score-progress {
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.pt-score-bar {
  height: 100%;
  width: 0%;
  background-color: var(--pt-green);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pt-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* BUTTONS */
.pt-btn {
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pt-btn-primary {
  background-color: var(--pxl-blue);
  color: #ffffff;
}

.pt-btn-primary:hover {
  background-color: var(--pxl-blue-dark);
}

.pt-btn-secondary {
  background-color: #ffffff;
  color: #334155;
  border-color: var(--pt-border);
}

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

.pt-btn-accent {
  background-color: #f59e0b;
  color: #ffffff;
}

.pt-btn-accent:hover {
  background-color: #d97706;
}

.pt-btn-sm {
  padding: 5px 9px;
  font-size: 11px;
}

/* WORKSPACE TOOLBAR */
.pt-toolbar {
  height: 38px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--pt-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  z-index: 15;
}

.pt-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
  border-right: 1px solid var(--pt-border);
  padding-right: 8px;
}

.pt-tool-btn {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #475569;
}

.pt-tool-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pt-tool-btn.active {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

/* MAIN WORKSPACE CANVAS */
.pt-workspace {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--pt-canvas-bg);
}

#canvasContainer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#networkCanvas {
  display: block;
}

/* BOTTOM DEVICE SHELF */
.pt-device-shelf {
  height: 105px;
  background-color: var(--pt-shelf-bg);
  border-top: 2px solid var(--pt-border);
  display: flex;
  align-items: stretch;
  z-index: 20;
  user-select: none;
}

.pt-shelf-categories {
  width: 250px;
  border-right: 1px solid var(--pt-border);
  background-color: #f1f5f9;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  gap: 3px;
  align-content: center;
  overflow-y: auto;
}

.pt-category-btn {
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 6px;
  text-align: left;
  border: 1px solid transparent;
  background: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}

.pt-category-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--pxl-blue-dark);
}

.pt-category-btn.active {
  background: #e0f2fe;
  border-color: var(--pxl-blue);
  color: var(--pxl-blue-dark);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--pxl-blue);
}

.pt-shelf-items {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.pt-shelf-btn {
  min-width: 74px;
  height: 84px;
  background: #ffffff;
  border: 1px solid var(--pt-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pt-shelf-btn:hover {
  border-color: var(--pxl-blue);
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.pt-shelf-btn.active {
  border-color: var(--pxl-blue);
  background-color: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.pt-shelf-svg {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-shelf-icon {
  font-size: 26px;
  line-height: 44px;
  color: #0f172a;
}

.pt-shelf-text {
  font-size: 10px;
  font-weight: 600;
  color: #334155;
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
}

/* PORT SELECTION POPOVER */
.pt-port-popover {
  position: absolute;
  z-index: 100;
  background: #ffffff;
  border: 1px solid var(--pt-border);
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  padding: 8px;
  min-width: 170px;
  max-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pt-popover-title {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}

.pt-popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 180px;
}

.pt-port-item {
  padding: 5px 8px;
  font-size: 11px;
  font-family: 'Consolas', monospace;
  background: transparent;
  border: none;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
}

.pt-port-item:hover:not(.disabled) {
  background: #e0f2fe;
  color: #0284c7;
}

.pt-port-item.disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.pt-port-cancel {
  margin-top: 4px;
  font-size: 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
}

/* CABLE ACTION POPOVER */
.pt-cable-popover {
  position: absolute;
  z-index: 120;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 12px;
  min-width: 260px;
  max-width: 330px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--pt-font-sans);
  animation: ptPopFadeIn 0.15s ease-out;
}

@keyframes ptPopFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pt-cable-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.pt-cable-popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.pt-cable-popover-close {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
}
.pt-cable-popover-close:hover {
  color: #ef4444;
}

.pt-cable-popover-info {
  font-size: 11px;
  color: #334155;
  line-height: 1.5;
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 4px;
  border-left: 3px solid #0284c7;
}

.pt-chassis-port {
  transition: transform 0.1s ease, background 0.1s ease;
  border-radius: 4px;
  padding: 2px 4px;
}
.pt-chassis-port:hover {
  background: rgba(2, 132, 199, 0.15);
  transform: translateY(-1px);
}
.pt-port-jack.plugged {
  background: #0284c7 !important;
  box-shadow: 0 0 6px #0284c7;
}

/* SLIDE-OUT RUBRIC PANEL */
.pt-rubric-side-panel {
  position: fixed;
  top: 56px;
  right: -420px;
  width: 400px;
  bottom: 105px;
  background: #ffffff;
  border-left: 2px solid var(--pt-border);
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.pt-rubric-side-panel.open {
  right: 0;
}

#rubricSidePanelContent {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.pt-rubric-panel-header {
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.pt-rubric-summary-score {
  font-size: 13px;
  color: #0284c7;
  margin-top: 4px;
}

.pt-rubric-panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pt-rubric-panel-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.pt-rubric-panel-item.passed {
  border-left: 4px solid var(--pt-green);
  background: #f0fdf4;
}

.pt-rubric-panel-item.failed {
  border-left: 4px solid var(--pt-red);
}

.pt-panel-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.pt-panel-item-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.pt-panel-item-detail {
  font-size: 11px;
  font-family: 'Consolas', monospace;
  color: #334155;
  margin-top: 4px;
  background: rgba(0,0,0,0.03);
  padding: 4px;
  border-radius: 4px;
}

/* TOAST NOTIFICATION */
.pt-toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 1000;
}

.pt-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* REALTIME VS SIMULATION MODE SWITCHER */
.pt-mode-switcher {
  display: flex;
  background: #0f172a;
  border-radius: 6px;
  padding: 2px;
  border: 1px solid #334155;
  gap: 2px;
}

.pt-mode-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.pt-mode-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.pt-mode-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* CANVAS FLOATING COMPLETION BADGE */
.pt-canvas-score-badge {
  position: absolute;
  top: 14px;
  right: 18px;
  background: #0f172a;
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #0284c7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pt-canvas-score-badge:hover {
  transform: scale(1.05);
  background: #1e293b;
  border-color: #38bdf8;
}

/* SIMULATION MODE EVENT LIST DOCK */
.pt-sim-dock {
  position: absolute;
  right: 18px;
  bottom: 8px;
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: 380px;
  background: #0f172a;
  border: 2px solid #0284c7;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
  color: #f8fafc;
  animation: ptSlideUp 0.2s ease-out;
}

@keyframes ptSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.pt-sim-dock-header {
  background: #1e293b;
  border-bottom: 2px solid #334155;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  user-select: none;
}

.pt-sim-time-badge {
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  background: #0284c7;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
}

.pt-sim-btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.pt-sim-btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.pt-sim-dock-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.pt-sim-controls-bar {
  background: #131d2e;
  border-bottom: 1px solid #1e293b;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pt-sim-ctrl-btn {
  border: none;
  border-radius: 5px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s ease;
}

.pt-sim-btn-play {
  background: #059669;
  color: #ffffff;
}

.pt-sim-btn-play:hover {
  background: #10b981;
}

.pt-sim-btn-play.playing {
  background: #d97706;
}

.pt-sim-btn-step {
  background: #0284c7;
  color: #ffffff;
}

.pt-sim-btn-step:hover {
  background: #0ea5e9;
}

.pt-sim-btn-reset {
  background: #334155;
  color: #f8fafc;
}

.pt-sim-btn-reset:hover {
  background: #475569;
}

.pt-sim-speed-box {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
  margin-left: auto;
}

.pt-sim-select {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
}

.pt-sim-filters-bar {
  background: #090e17;
  border-bottom: 1px solid #1e293b;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: #cbd5e1;
}

.pt-sim-filter-lbl {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.pt-sim-table-wrap {
  flex: 1;
  max-height: 220px;
  overflow-y: auto;
  background: #050b14;
}

.pt-sim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.pt-sim-table th {
  background: #0f172a;
  color: #38bdf8;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 2;
}

.pt-sim-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.pt-sim-row {
  cursor: pointer;
  transition: background 0.1s ease;
}

.pt-sim-row:hover {
  background: rgba(56, 189, 248, 0.1) !important;
}

.pt-sim-row.current {
  background: rgba(2, 132, 199, 0.28) !important;
  border-left: 3px solid #38bdf8;
}

.pt-sim-pdu-btn {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 3px;
  color: #38bdf8;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 11px;
  line-height: 1;
  transition: all 0.1s;
}

.pt-sim-pdu-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: scale(1.15);
}

.pt-sim-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.sim-badge-icmp { background: #065f46; color: #a7f3d0; border: 1px solid #10b981; }
.sim-badge-arp { background: #78350f; color: #fde68a; border: 1px solid #f59e0b; }
.sim-badge-tcp { background: #1e3a8a; color: #bfdbfe; border: 1px solid #3b82f6; }
.sim-badge-http { background: #14532d; color: #bbf7d0; border: 1px solid #22c55e; }
.sim-badge-dns { background: #312e81; color: #c7d2fe; border: 1px solid #6366f1; }
.sim-badge-dhcp { background: #831843; color: #fbcfe8; border: 1px solid #f43f5e; }
.sim-badge-default { background: #334155; color: #cbd5e1; }

.pt-sim-info-cell {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #cbd5e1;
}

.pt-sim-dock-footer {
  background: #1e293b;
  border-top: 1px solid #334155;
  padding: 5px 12px;
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


