/* Reset Defaults */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background-color: #121212;
  color: #00ff90;
  font-family: 'Courier New', monospace;
  padding: 0px;
  min-height: 100%;
}

/* Terminal Header */
#terminalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e1e1e;
  border: 2px solid #00ff90;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 6px 12px;
  box-shadow: 0 0 6px #00ff90;
  margin-bottom: 0px;
}

/* Window + Buttons*/
.window-buttons {
  display: flex;
  gap: 6px;
}

.window-buttons .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red {
  background-color: #ff5f56;
}

.dot.yellow {
  background-color: #ffbd2e;
}

.dot.green {
  background-color: #27c93f;
}

/* window-terminal title*/
.terminal-title {
  color: #00ff90;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
}

/* Content Wrapper (Parent Flexbox) */
#contentWrapper {
  display: flex;
  height: calc(100vh - 60px);
  /* Full height minus header/padding */
  justify-content: space-between;
  align-items: stretch;
  gap: 40px;
  margin-top: 20px;
}

/* Terminal Container */
#terminalWrapper {
  position: relative;
  flex: 2;
  border: 2px solid #00ff90;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 0 10px #00ff90;
  background-color: #1e1e1e;
  min-width: 60%;
  display: flex;
  flex-direction: column;
}

/* Terminal Output */
#terminalOutput {
  flex: 1;
  z-index: 1;
  font-size: 1rem;
  line-height: 1.6;
  overflow-y: auto;
  padding-right: 120px;
}

/* Terminal Button */
#clearTerminal {
  background-color: #00ff90;
  color: #121212;
  border: none;
  padding: 6px 12px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 0 4px #00ff90;
  align-self: flex-end;
  margin-top: 10px;
}

#clearTerminal:hover {
  background-color: #00cc70;
}

#clearTerminal:focus {
  outline: none;
  box-shadow: 0 0 6px #00ff90;
}

/* Directory & File Interactions */
.directory {
  color: #00bfff;
  cursor: pointer;
}

.file {
  color: #00ffff;
  cursor: pointer;
}

ul {
  list-style: none;
  padding-left: 0;
}

ul li {
  margin-left: 20px;
}

/* Popup Viewer (Responsive + Scrollable) */
.popup {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 500px;
  min-width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  background-color: #1e1e1e;
  color: #00ff90;
  border: 2px solid #00ff90;
  border-radius: 6px;
  z-index: 999;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 10px #00ff90;
}

.popup.hidden {
  display: none;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #00ff90;
  color: #121212;
  padding: 8px 12px;
  border-bottom: 2px solid #00ff90;
  font-weight: bold;
  position: sticky;
  top: 0;
}

.popup-title {
  font-size: 0.95rem;
}

.popup-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #121212;
  font-weight: bold;
}

.popup-content {
  padding: 12px;
  font-size: 0.95rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.popup-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 5px #00ff90;
}

/* Nano-style Popup */
.popup.nano-mode {
  background-color: #000000;
  color: #00ff00;
  border: 2px solid #00ff00;
  box-shadow: 0 0 10px #00ff00;
}

.popup.nano-mode .popup-header {
  background-color: #00ff00;
  color: #000000;
}

.popup.nano-mode .popup-content {
  color: #00ff00;
}

/* Panel Row Layout */
#panelWrapper {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-width: 30%;
}

/* Panel Box Styling */
.panelBox {
  width: 100%;
  flex: 1;
  background-color: #1e1e1e;
  border: 2px solid #00ff90;
  padding: 16px;
  border-radius: 6px;
  color: #00ff90;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 10px #00ff90;
  display: flex;
  flex-direction: column;
}

.panelBox h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  border-bottom: 1px solid #00ff90;
  padding-bottom: 4px;
  text-align: center;
}

.badge-icon {
  font-size: 1.5rem;
  margin-right: 6px;
  vertical-align: middle;
}

.level-bar {
  background-color: #00ff90;
  height: 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 0 6px #00ff90;
}

#asciiBox pre {
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.65;
  margin: 0;
  padding: 5;
}

/* Cursor Blink Animation */
.cursor {
  display: inline-block;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  #contentWrapper {
    flex-direction: column;
    /* Stack terminal & panels */
  }

  #panelWrapper {
    flex-direction: row;
    /* Panels side-by-side below terminal */
    gap: 10px;
  }

  .panelBox {
    height: auto;
    /* Let panels resize naturally */
    flex: 1;
  }
}