/* --- Network Protocol Game Styles --- */

.npg-container {
    border: 1px solid #ccc;
    padding: 20px;
    background-color: #f9f9f9;
    font-family: sans-serif;
    max-width: 800px; /* Adjust as needed */
    margin: 20px auto;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    position: relative; /* For absolute positioning inside */
    min-height: 400px; /* Ensure space for content */
}

.npg-container h2 {
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

.npg-container h3 {
    color: #555;
    margin-top: 25px;
}

.npg-container p,
.npg-container li {
    line-height: 1.6;
    color: #444;
}

.npg-container code {
    background-color: #e4e4e4;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

/* --- Icon (SVG embedded as background) --- */
.npg-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #0073aa; /* WordPress blue as default */
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M50,5 C25.2,5 5,25.2 5,50 s20.2,45 45,45 s45,-20.2 45,-45 S74.8,5 50,5 z M50,15 c4.4,0 8,3.6 8,8 s-3.6,8 -8,8 s-8,-3.6 -8,-8 S45.6,15 50,15 z M80,70 c0,4.4 -3.6,8 -8,8 s-8,-3.6 -8,-8 s3.6,-8 8,-8 S80,65.6 80,70 z M30,70 c0,4.4 -3.6,8 -8,8 s-8,-3.6 -8,-8 s3.6,-8 8,-8 S30,65.6 30,70 z M50,40 c-5.5,0 -10,4.5 -10,10 s4.5,10 10,10 s10,-4.5 10,-10 S55.5,40 50,40 z"/><line stroke="currentColor" stroke-width="5" x1="50" y1="31" x2="50" y2="40"/><line stroke="currentColor" stroke-width="5" x1="36" y1="64" x2="43" y2="57"/><line stroke="currentColor" stroke-width="5" x1="64" y1="64" x2="57" y2="57"/></svg>');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    vertical-align: middle;
    margin-right: 5px;
}

/* --- Game UI Elements --- */
.npg-module {
    /* Styles for module content area */
    margin-top: 20px;
}

.npg-educational-content {
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.npg-interactive-area {
    border: 1px dashed #aaa;
    padding: 15px;
    margin-top: 20px;
    min-height: 200px; /* Example height */
    position: relative;
}

.npg-controls button,
.npg-interactive-area button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    font-size: 14px;
}

.npg-controls button:hover,
.npg-interactive-area button:hover {
    background-color: #005a87;
}

.npg-controls button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.npg-feedback {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.npg-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.npg-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.npg-progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 15px 0;
}

.npg-progress-bar {
    height: 10px;
    width: 0%; /* Updated by JS */
    background-color: #4caf50;
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

/* --- Specific Scenario Elements (Example for IP) --- */
.npg-network-map {
    position: relative;
    height: 150px; /* Adjust */
    background-color: #eef;
    border: 1px solid #ccf;
    margin-bottom: 15px;
    border-radius: 4px;
    padding: 10px;
    display: flex; /* Simple layout */
    justify-content: space-around;
    align-items: center;
}

.npg-network-device {
    border: 1px solid #999;
    padding: 10px;
    background-color: white;
    border-radius: 50%; /* Circle */
    text-align: center;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
}
.npg-network-device.client { border-color: blue; }
.npg-network-device.server { border-color: green; }
.npg-network-device.router { border-color: orange; }

.npg-config-panel {
    background-color: #f0f0f0;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.npg-config-panel label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.npg-config-panel input[type="text"] {
    width: calc(100% - 16px); /* Adjust for padding */
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* --- Module Navigation --- */
.npg-module-nav {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.npg-module-nav button {
    margin-right: 10px;
}

/* --- Tooltips (Basic Example) --- */
.npg-tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black; /* Indicates tooltip */
  cursor: help;
}

.npg-tooltip .npg-tooltiptext {
  visibility: hidden;
  width: 160px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 125%; /* Position above the text */
  left: 50%;
  margin-left: -80px; /* Use half of the width */
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  line-height: 1.4;
}

/* Tooltip arrow */
.npg-tooltip .npg-tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

.npg-tooltip:hover .npg-tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* --- Accessibility --- */
.npg-container button:focus,
.npg-container input:focus,
.npg-network-device:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode (Example - toggled via JS class on .npg-container) */
.npg-high-contrast {
    background-color: black;
    color: white;
    border-color: yellow;
}
.npg-high-contrast h2, .npg-high-contrast h3 { color: yellow; border-color: yellow; }
.npg-high-contrast p, .npg-high-contrast li { color: white; }
.npg-high-contrast code { background-color: #333; color: white; }
.npg-high-contrast .npg-educational-content { background-color: #111; color: white; }
.npg-high-contrast .npg-interactive-area { border-color: yellow; }
.npg-high-contrast button { background-color: yellow; color: black; border: 1px solid black; }
.npg-high-contrast button:disabled { background-color: #555; color: #aaa; border-color: #777; }
.npg-high-contrast .npg-feedback.success { background-color: #0f0; color: black; border-color: black; }
.npg-high-contrast .npg-feedback.error { background-color: #f00; color: black; border-color: black; }
.npg-high-contrast .npg-progress-bar-container { background-color: #555; }
.npg-high-contrast .npg-progress-bar { background-color: yellow; }
.npg-high-contrast .npg-network-device { background-color: black; border-color: yellow; color: yellow; }
.npg-high-contrast .npg-config-panel { background-color: #222; }
.npg-high-contrast label { color: yellow; }
.npg-high-contrast input[type="text"] { background-color: #333; color: white; border-color: yellow; }
.npg-high-contrast .npg-tooltip { border-bottom-color: yellow; }
.npg-high-contrast .npg-tooltip .npg-tooltiptext { background-color: yellow; color: black; }
.npg-high-contrast .npg-tooltip .npg-tooltiptext::after { border-top-color: yellow; }