@import url("./colors.css");

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

/* Ensure body and html occupy full viewport without scroll */
html, body {
  height: 100%;
  overflow: hidden;
  background-color: var(--content-color);
}

/* Set up a flex container for the main layout */
body {
  display: flex;
  flex-direction: row;
  height: 100%;
  font-family: Arial, sans-serif;
}

/* Container to handle flex layout and overflow */
.container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--content-color);
}

/* Floating button on the top-right corner */
.floating-btn, .floating-btn-view {
  position: fixed;
  user-select: none;
  right: 20px;
  background-color: var(--btn-bg);
  color: var(--primary-color);
  border: 1px solid transparent;
  padding: 5px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 0px 6px var(--inset-color);
}

.floating-btn {
  top: 20px;
}

.floating-btn-view {
  top: 80px;
}

.floating-btn:hover, .floating-btn-view:hover {
  background-color: var(--btn-hover-bg);
}

.floating-btn img, .floating-btn-view img {
  width: 30px;
  height: 30px;
  background-color: transparent;
}

.tooltip-container {
  position: fixed;
  display: inline-block;
  top: 0;
  right: 188px;
  box-shadow: 0px 0px 6px var(--inset-color);
  z-index: 1000;
}

.tooltip {
  visibility: hidden;
  width: 120px;
  background-color: var(--btn-bg);
  color: var(--primary-color);
  text-align: center;
  border-radius: 5px;
  padding: 5px;
  position: absolute;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Add this block for the arrow */
.tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3px;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background-color: var(--btn-bg);
}

/* Positioning for file tooltip */
.tooltip.file {
  top: 25px;
}

/* Positioning for view tooltip */
.tooltip.view {
  top: 85px;
}

.tooltip-container:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Style for textarea */
#markdown-input {
  width: 50%;
  height: 100%;
  padding: 10px;
  font-size: 18px;
  outline: none;
  resize: none;
  border: none;
  font-family: Arial, sans-serif;
  background-color: var(--content-color);
  color: var(--primary-color);
  transition: width 0.5s ease;
}

.full-width #markdown-input {
  padding: 0;
  width: 0;
  visibility: hidden;
}

/* Style for preview area */
.preview {
  flex: 1;
  padding: 10px 0 10px 10px;
  background-color: var(--content-color);
  overflow-y: auto;
  box-sizing: border-box;
  color: var(--primary-color);
  transition: width 0.5s ease;
}

/* Adjust the full-width behavior */
.full-width .preview {
  width: 100%;
}

/* Style for markdown content */
.markdown-body {
  box-shadow: inset 0 0 10px var(--inset-color);
  padding: 10px;
  font-family: 'Arial', sans-serif;
  font-size: 18px;
}

/* Style for code blocks and copy button */
.code-block {
  position: relative;
  margin-bottom: 20px;
  z-index: 1;
}

.copy-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: var(--btn-bg);
  border: 1px solid transparent;
  padding: 10px;
  cursor: pointer;
  font-size: 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn img {
  width: 20px;
  height: 20px;
  background-color: transparent;
}

.copy-btn:hover {
  background-color: var(--btn-hover-bg);
  border: 1px solid var(--btn-hover-border);
}

.copy-btn.copied {
  border: 1px solid var(--btn-copied);
  box-shadow: 0 0 2px 2px var(--btn-copied-shadow);
}
