/* ---------- Right side menu ---------- */
.rm-side-menu {
  position: fixed;
  background: #222;
  border-radius: 10px;
  display: flex;
  padding: 5px 0;
  z-index: 900;
  transition: all 0.3s ease;
}

/* Position: Left (default) */
.rm-side-menu.rm-position-left {
  left: 0;
  top: 20px;
  bottom: 20px;
  height: 60%;
  margin: auto;
  width: 20px;
  flex-direction: column;
  justify-content: space-between;
}

/* Position: Right */
.rm-side-menu.rm-position-right {
  right: 0;
  top: 20px;
  bottom: 20px;
  height: 60%;
  margin: auto;
  width: 20px;
  flex-direction: column;
  justify-content: space-between;
}

/* Position: Top */
.rm-side-menu.rm-position-top {
  top: 0;
  left: 20px;
  right: 20px;
  width: 60%;
  margin: auto;
  height: 20px;
  flex-direction: row;
  justify-content: space-between;
  padding: 0 5px;
}

/* Position: Bottom */
.rm-side-menu.rm-position-bottom {
  bottom: 0;
  left: 20px;
  right: 20px;
  width: 60%;
  margin: auto;
  height: 20px;
  flex-direction: row;
  justify-content: space-between;
  padding: 0 5px;
}

/* Settings Icon */
.rm-settings-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
  transition: background 0.18s ease;
  user-select: none;
}

.rm-settings-icon:hover {
  background: #3a3a3a;
}

.rm-tab {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
  transition: background 0.18s ease;
}

.rm-tab:hover {
  background: #3a3a3a;
}

.rm-tab.rm-active-tab {
  background: #008cba;
}

/* ---------- Settings Modal ---------- */
.rm-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.rm-settings-modal.rm-settings-active {
  opacity: 1;
  visibility: visible;
}

.rm-settings-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  min-width: 300px;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.rm-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.rm-settings-header h3 {
  margin: 0;
  color: #333;
  font-size: 20px;
}

.rm-settings-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.rm-settings-close:hover {
  color: #000;
}

.rm-settings-body {
  padding: 10px 0;
}

.rm-settings-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  font-size: 14px;
}

.rm-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rm-radio-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rm-radio-option:hover {
  background: #f5f5f5;
  border-color: #008cba;
}

.rm-radio-option input[type="radio"] {
  margin-right: 10px;
  cursor: pointer;
}

.rm-radio-option span {
  font-size: 14px;
  color: #333;
  user-select: none;
}

/* ---------- Button Options ---------- */
.rm-button-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rm-button-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  gap: 10px;
}

.rm-button-option:hover {
  background: #f9f9f9;
}

.rm-button-checkbox {
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rm-button-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #000000;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.rm-button-preview:hover {
  background: #008cba;
  border-color: #008cba;
  transform: scale(1.1);
}

.rm-button-description {
  flex: 1;
  font-size: 14px;
  color: #333;
  user-select: none;
}

/* Dynamic buttons on sidebar */
.rm-dynamic-button {
  cursor: pointer;
}

/* ---------- Popout container (center) ---------- */
.rm-popout {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 70%;
  max-width: 900px;
  min-height: 380px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(.2,.9,.3,1);
  padding: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.rm-popout.rm-active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.rm-popout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rm-popout-title {
  font-weight: 700;
  font-size: 18px;
}

.rm-close-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: black;
}

/* ---------- Notepad controls ---------- */
.rm-controls {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.rm-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fafafa;
  cursor: pointer;
  font-size: 14px;
  color: grey;
}

.rm-btn:hover {
  filter: brightness(.96);
  color: white;
}

/* ---------- Notepad area ---------- */
.rm-editor {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  flex: 1;
  min-height: 200px;
}

.rm-textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-family: monospace;
  font-size: 14px;
  box-sizing: border-box;
}

.rm-preview {
  width: 100%;
  min-height: 260px;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 12px;
  box-sizing: border-box;
  background: #fff;
  overflow: auto;
}

.rm-preview a {
  word-break: break-all;
  text-decoration: underline;
}

.rm-preview iframe {
  display: block;
  margin: 8px 0;
  max-width: 100%;
}

/* Small helpers */
.rm-note-small {
  color: #666;
  font-size: 13px;
  margin-left: 6px;
}

.rm-footer {
  margin-top: 12px;
  text-align: right;
  color: #555;
  font-size: 13px;
}

@media (max-width: 720px) {
  .rm-editor {
    grid-template-columns: 1fr;
  }
  .rm-popout {
    width: 92%;
    min-height: 420px;
    padding: 14px;
  }
}