/* ============================================================
   NOTEPAD / TEXT EDITOR WINDOW
   ============================================================ */
#notepad-window {
  top: 60px;
  left: 150px;
  width: 680px;
  height: 480px;
  min-width: 400px;
  min-height: 280px;
  z-index: 15;
  background: #1e1e1e;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif;
  color: #eee;
}

/* --- Notepad Header Bar --- */
#notepad-header {
  display: flex;
  align-items: center;
  background: #2d2d2d;
  padding: 0 8px;
  height: 38px;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  border-bottom: 1px solid #3a3a3a;
  gap: 6px;
}
#notepad-header:active { cursor: grabbing; }

#notepad-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}
#notepad-title .notepad-unsaved { color: var(--accent-color); }

/* --- Toolbar --- */
#notepad-toolbar {
  display: flex;
  align-items: center;
  background: #272727;
  padding: 4px 8px;
  gap: 2px;
  border-bottom: 1px solid #3a3a3a;
  flex-shrink: 0;
}

.notepad-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #bbb;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.notepad-tool-btn:hover { background: rgba(255,255,255,0.10); color: #fff; }
.notepad-tool-btn svg { width: 14px; height: 14px; fill: currentColor; }

.notepad-tool-sep {
  width: 1px;
  height: 20px;
  background: #3a3a3a;
  margin: 0 4px;
}

/* Open file dropdown */
#notepad-file-list {
  display: none;
  position: absolute;
  top: 76px;
  left: 8px;
  background: #2d2d2d;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 6px 0;
  min-width: 280px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
#notepad-file-list.active { display: block; }
#notepad-file-list::-webkit-scrollbar { width: 4px; }
#notepad-file-list::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

.notepad-file-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12.5px;
  color: #ccc;
  transition: background 0.1s;
}
.notepad-file-option:hover { background: var(--accent-color); color: #fff; }
.notepad-file-option svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.notepad-file-option .notepad-file-path { color: #888; font-size: 11px; margin-left: auto; }
.notepad-file-option:hover .notepad-file-path { color: rgba(255,255,255,0.7); }

/* --- Editor Area --- */
#notepad-editor {
  flex: 1;
  display: flex;
  min-height: 0;
}

#notepad-lines {
  width: 44px;
  flex-shrink: 0;
  background: #252525;
  border-right: 1px solid #3a3a3a;
  padding: 10px 0;
  text-align: right;
  font-family: 'Ubuntu Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  overflow: hidden;
  user-select: none;
}

#notepad-textarea {
  flex: 1;
  background: #1e1e1e;
  color: #ddd;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-family: 'Ubuntu Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  tab-size: 4;
  -moz-tab-size: 4;
  white-space: pre;
  overflow: auto;
}
#notepad-textarea::-webkit-scrollbar { width: 6px; height: 6px; }
#notepad-textarea::-webkit-scrollbar-track { background: transparent; }
#notepad-textarea::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

#notepad-textarea::placeholder {
  color: #555;
  font-style: italic;
}

/* --- Status Bar --- */
#notepad-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #252525;
  border-top: 1px solid #3a3a3a;
  padding: 3px 14px;
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
}
#notepad-statusbar .notepad-status-left { display: flex; gap: 16px; }
#notepad-statusbar .notepad-status-right { display: flex; gap: 16px; }

/* --- Save dialog --- */
#notepad-save-dialog {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #2d2d2d;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 20px 24px;
  z-index: 70;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  min-width: 320px;
}
#notepad-save-dialog.active { display: block; }

.notepad-dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

#notepad-save-input {
  width: 100%;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 12px;
  color: #ddd;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 13px;
  outline: none;
  margin-bottom: 14px;
}
#notepad-save-input:focus { border-color: var(--accent-color); }

.notepad-dialog-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.notepad-dialog-btn {
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  border: 1px solid #444;
  background: #333;
  color: #ccc;
  transition: background 0.12s;
}
.notepad-dialog-btn:hover { background: #3a3a3a; }
.notepad-dialog-btn.primary {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}
.notepad-dialog-btn.primary:hover { background: #d4441a; }

/* Overlay behind dialog */
#notepad-dialog-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 65;
}
#notepad-dialog-overlay.active { display: block; }
