/* styles.css */
body {
  background-color: #1a1a1a;
  color: white;
  font-family: sans-serif;
  overflow: hidden;
  margin: 0;
  display: flex;
}

#canvas-container {
  position: relative; /* Changed for positioning context */
  border: 1px solid #444;
}

#main-canvas {
  display: block;
}

#info-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 350px;
  height: 100%;
  background-color: #2a2a2a;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;
  border-right: 1px solid #444;
  z-index: 10;
}

#main-canvas {
  display: block;
}

/* --- Window Styles --- */
.generic-window-container {
  position: absolute;
  width: 400px;
  min-width: 150px;
  height: 300px;
  min-height: 150px;
  background-color: rgb(34, 34, 34);
  border: 1px solid #555;
  z-index: 30;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
  border-radius: 5px;
  overflow: hidden; /* Important for resizing content */
  opacity: 0.9;
  transition:
    opacity 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out,
    border-color 0.2s ease-in-out;
  user-select: none; /* Disallow text selection by default */
}

.generic-window-container.focused {
  opacity: 0.97;
  border-color: #999;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 1);
}

.window-title-bar {
  width: 100%;
  height: 24px;
  background-color: #444;
  color: white;
  line-height: 30px;
  cursor: move;
  user-select: none; /* Prevents text selection while dragging */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box; /* This is the fix */
}

.window-title-bar > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.close-button {
  background: #c0392b;
  color: white;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}
.close-button:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.5;
}
.close-button:hover:disabled {
  background: #666; /* Prevent hover effect when disabled */
}
.close-button:hover {
  background: #e74c3c;
}

.window-content {
  padding: 10px;
  color: white;
  flex-grow: 1; /* Allows content to fill space */
  font-size: 14px;
  user-select: text; /* Allow text selection ONLY in the content area */
  overflow-y: auto;
}

.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  /* A simple triangle using borders */
  border-bottom: 12px solid #666;
  border-left: 12px solid transparent;
  cursor: se-resize;
  transition: border-bottom-color 0.2s ease-in-out;
}

.resize-handle:hover,
.generic-window-container.resizing .resize-handle {
  border-bottom-color: #999;
}

/* --- Scrollbar Styles --- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 10px;
  border: 2px solid #2a2a2a;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}

::-webkit-scrollbar-corner {
  background: transparent;
}
