@import url('./theme.css');

/* CSS Custom Properties (Variables) */
body.dark {
  --nav-bg: #250b35;
  --nav-text: #e0e0e0;
  --files-bg: #321743;
  --selceted-file-bg: #51276b;
  --sideBar-bg: #291039;
}

* {
  --height: calc(100% - var(--nav-height));
  --width: calc(100% - var(--files-tab-width) - var(--sidebar-width) - var(--drag-bar-width));
  --nav-height: 40px;
  --files-tab-width: calc(15% + 20px);
  --sidebar-width: 80px;
  --drag-bar-width: 1px;
}

body.light {
  --nav-bg: #8355b4;
  --nav-text: #fff;
  --files-bg: #986dc6;
  --selceted-file-bg: #ba97df;
  --sideBar-bg: #8752c0;
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  gap: 0;
  user-select: none;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
  cursor: url('../images/cursor/normal.png') 4 4, default;
}

::-webkit-scrollbar {
    cursor: pointer
}

body {
  height: 100%;
  max-height: 100%;
  overflow-x: visible;
  width: 100%;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
}

input {
  border: 1px solid var(--nav-text);
  outline: #7e56c2;
  font-size: 15px;
  background-color: var(--files-bg);
  color: var(--nav-text);
}

i {
  font-size: 37px !important;
}

::selection {
  background-color: #7e56c280;
}

/* Navigation Bar */
nav.nav-bar {
  min-width: 100%;
  width : 100%;
  background-color: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  padding-left: 0;
  font-size: 15px;
  height: var(--nav-height);
  border-bottom: #333 solid 1px;
}

nav.nav-bar .logo {
  left: 0;
  top: 0;
  width: 10px !important;
  height: 30px !important;
}

nav.nav-bar .logo img {
  margin: 10px, 10px, 10px, 10px !important;
  width: 30px !important;
  height: 30px !important;
}

#toggle img {
  margin-top: 20px;
}

.options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.options .option button {
  background-color: transparent;
  color: var(--nav-text);
}

/* Main Layout */
main {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--nav-height));
  gap: 0;
}

/* Sidebar */
.sideBar {
  width: var(--sidebar-width);
  max-height: calc(100vh - var(--nav-height));
  height: calc(100vh - var(--nav-height));
  background: var(--sideBar-bg);
  color: var(--nav-text);
  display: flex;
  flex-direction: column !important;
}

.sideBar i {
  cursor: pointer;
  margin: 10px;
  margin-top: 20px;
}

/* Files Tab */
.files-tab {
  display: flex;
  flex-direction: column;
  width: var(--files-tab-width);
  max-width: var(--files-tab-width);
  min-width: var(--files-tab-width);
  background-color: var(--files-bg);
  height: calc(100vh - var(--nav-height));
  max-height: calc(100vh - var(--nav-height));
  border-left: #333 solid 1px;
}

.files-tab[data-status="close"] {
  visibility: hidden;
  width: 0;
  transition: width 0.3s ease;
}

.files-tab[data-status="open"] {
  visibility: visible;
  width: 20%;
}

.files-tab i {
  font-size: 15px !important;
}

.files-tab .fileMenu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: 10px;
  margin-left: 10px;
}

.files-tab .fileMenu p {
  font-weight: bolder;
  font-size: 13px;
}

body.light .files-tab .fileMenu i {
  font-weight: bolder !important;
}

/* File Items */
.file {
  display: flex;
  gap: 0;
  margin: 0;
  flex-direction: row;
  align-items: center;
  padding: 10px;
  border-radius: 5px;
  background-color: var(--file-bg);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

.file.selected {
  background-color: var(--selceted-file-bg);
  color: var(--text-color);
}

.fileIcon {
  width: 20px;
  max-width: 20px;
  height: 20px;
  max-height: 20px;
}

.fileIcon i {
  font-size: 20px !important;
}

#welcomeMessage {
  min-width: calc(100% - 20% + 20px) !important;
  max-width: calc(100% - 20% + 20px) !important;
  height: calc(100vh - var(--nav-height)) !important;
  min-height: calc(100vh - var(--nav-height)) !important;
  max-height: calc(100vh - var(--nav-height)) !important;
  color: #fff;
}

.welcome-message {
  color: #fff;
  text-align: center;
  user-select: auto;
  padding: 100px 0 100px 0;
  margin-left: 50px;
  font-size: 18px;
  font-weight: bolder;
  width: calc(100% - 20% + 20px) !important;
  min-width: calc(100% - 20% + 20px) !important;
  max-width: calc(100% - 20% + 20px) !important;
  height: calc(100vh - var(--nav-height) - 100px) !important;
  min-height: calc(100vh - var(--nav-height) - 100px) !important;
  max-height: calc(100vh - var(--nav-height) - 100px) !important;
  background-color: var(--background-color);
}

#megaEditor {
  width: calc(100% - 20% + 20px) !important;
  min-width: calc(100% - 26% + 20px) !important;
  height: calc(100% - var(--nav-height)) !important;
  min-height: calc(100% - var(--nav-height)) !important;
  max-height: calc(100% - var(--nav-height)) !important;
  background-color: var(--background-color);
}

div.cldr.codicon.codicon-folding-expanded::before {
  cursor: url('../images/cursor/pointer.png') 16 16, pointer !important;
}

* div.slider::after {
  cursor: url('../images/cursor/pointer.png') 16 16, pointer !important;
}

/* Editor */
#editor {
  flex: 1 !important;
  margin: 0;
  gap: 0;
  flex-direction: column !important;
  /* width: calc(100% - 15% + 20px) !important; */
  width: 91.25% !important;
  min-width: calc(100% - 8.75%) !important;
  height: calc(100vh - var(--nav-height)) !important;
  min-height: calc(100vh - var(--nav-height)) !important;
  max-height: calc(100vh - var(--nav-height)) !important;
  background-color: var(--background-color);
  color: var(--text-color);
  border-left: #333 solid 1px;
}

#editor * {
  cursor: url('../images/cursor/writer.svg') 16 16, text !important;
}

/* Drag Bar */
.drag-bar {
  width: 5px !important;
  background-color: var(--files-bg);
  cursor: ew-resize;
  min-height: calc(100vh - var(--nav-height)) !important;
  max-height: calc(100vh - var(--nav-height)) !important;
  height: calc(100vh - var(--nav-height)) !important;
  z-index: 1000;
}

.drag-bar:hover {
  background-color: var(--files-bg);
}

/* Extras and File Options */
.extras {
  z-index: 100;
  position: absolute;
  pointer-events: auto;
}

.extras .option {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 5px;
  cursor: pointer;
}

.extras .fileBtnOptions {
  display: none;
  background-color: var(--files-bg);
  width: 100px;
  border-radius: 3px;
  margin-left: 50px;
  margin-top: 28px;
  border: #333 solid 1px;
}

.fileBtnOptions.active {
  display: block;
}

/* Right Click Menu */
.right-click-menu {
  position: absolute;
  display: none;
  background-color: var(--files-bg);
  border: 1px solid #333;
  border-radius: 4px;
  z-index: 1000;
  min-width: 120px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.right-click-menu .menu-item {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--nav-text);
}

.right-click-menu .menu-item:hover {
  background-color: var(--selceted-file-bg);
  color: var(--nav-text);
}

/* Prompt/Modal */
.prompt {
  display: none;
  color: var(--nav-text);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.terminal {
  display: none ;
  position: absolute;
  height: 40%;
  width: 99%;
  top: 60%;
  left: 269px;
  min-width: calc(100% - 15% + 20px) !important;
  max-width: calc(100% - 200px) !important;
  background-color: var(--background-color);
  border: #ebebeb solid 1px;
  border-right: #ebebeb solid 1px;
  border-radius: 5px;
}

.terminal-display {
  background-color: var(--files-bg) !important;
  height: calc(100% - 22px);
  border: #ebebeb solid 1px;
}

.nav-terminal {
  background-color: var(--nav-bg);
  height: 22px;
  display: flex;
  justify-content: right;
  border: #ebebeb solid 1px;
}

.window {
  background: var(--nav-bg);
  padding: 20px 30px;
  border-radius: 10px;
  text-align: center;
  width: 50%;
}

.window input {
  width: 75%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  outline: none;
}

.window button {
  padding: 10px;
}

.window button i {
  font-size: 16px !important;
  font-weight: bolder;
}

/* Indu Chat Panel */
.indu {
  background-color: var(--files-bg);
  max-width: 300px;
  min-width: 300px;
  height: calc(100vh - var(--nav-height));
  font-weight: bolder;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  border-left: #333 solid 1px;
}

.indu .header div {
  display: flex;
  justify-content: center;
}

.indu div img {
  width: 150px;
}

.indu .input {
  display: flex;
  flex-direction: row;
  width: calc(100% - var(--nav-height));
  margin: 20px;
  border: #7e56c2 2px solid;
  padding: 15px;
  border-radius: 20px;
}

.indu .input #induInput {
  border: none;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
}

.indu .input button {
  background-color: transparent;
  color: var(--nav-text);
}

.indu.drag-bar {
  width: 5px !important;
  min-width: 5px !important;
  background-color: var(--files-bg);
  cursor: ew-resize;
  z-index: 1000;
  display: none;
}

.indu.message {
  font-weight: 500;
  display: flex;
  justify-content: center;
}

/* Chat Messages */
#chat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  user-select: auto;
}

.message {
  max-width: 26%;
  width: fit-content;
  height: auto;
  margin: 0;
  padding: 0.4rem 0.75rem;
  user-select: auto;
  color: var(--nav-text);
  background-color: var(--sideBar-bg);
  border-radius: 8px;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
  display: inline-block;
  vertical-align: top;
  margin-bottom: 0.75rem;
}

.message.user {
  margin-left: auto;
  background-color: #7e56c2;
  user-select: auto;
}

.message.indu .indu-icon .indu-icon-img {
  width: 30px;
  user-select: auto;
}

.message.indu div {
  user-select: auto;
}

/* .message.indu pre {
  overflow-y: scroll;
} */

.message.indu pre,
.message.indu pre code,
.message.indu pre.hljs {
  background-color: var(--background-color) !important;
}

.message.indu pre:hover .copy-code-btn {
  opacity: 1;
}

/* Code Block Copy Button */
.copy-code-btn {
  transition: opacity 0.2s ease-in-out;
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  z-index: 10;
  opacity: 0;
}

.copy-code-btn:hover {
  background: #444;
}

.copy-code-btn svg {
  width: 12px;
  height: 12px;
}

/* Syntax Highlighting */
.hljs {
  background: #272626;
  color: #d4d4d4;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  padding: 1em;
  border-radius: 8px;
  /* overflow-x: auto; */
  line-height: 1.5;
  white-space: pre;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-meta .hljs-keyword {
  color: #82AAFF;
}

.hljs-string,
.hljs-meta .hljs-string {
  color: #FF9E64;
}

.hljs-number,
.hljs-literal {
  color: #F78C6C;
}

.hljs-comment,
.hljs-quote {
  color: #546E7A;
  font-style: italic;
}

.hljs-function .hljs-title,
.hljs-title {
  color: #82AAFF;
}

.hljs-variable {
  color: #d4d4d4;
}

.hljs-built_in,
.hljs-type {
  color: #9CDCFE;
}

.hljs-symbol,
.hljs-attr {
  color: #FFD700;
}

.hljs-meta {
  color: #9CDCFE;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}

.right-side {
  display: flex;
  align-items: center; /* vertically center all items */
}

.runBtn {
  margin-right: 20px;
  cursor: pointer;
  border: 2.5px solid var(--selceted-file-bg);
  border-radius: 10px;
}

.runBtn button {
  display: flex;
  align-items: center; /* vertical center icon inside button */
  justify-content: center;
  background: none;
  color: var(--nav-text);
  padding: 2.5px;
}

.theme-toggle {
  display: flex;
  align-items: center; /* vertically center all items */
  gap: 10px;            /* space between text and button */
  margin-top: 10px;
}

.theme-toggle p {
  margin-top: 5px;           /* remove default margin */
  font-size: 20px;
  line-height: 1;      /* prevent extra spacing */
  color: #fff;
}

.theme-toggle button {
  display: flex;
  align-items: center; /* vertical center icon inside button */
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 30px;
}

/* Theme-specific Syntax Highlighting */
body.dark .hljs {
  background: #272626;
  color: #d4d4d4;
}

body.light .hljs {
  background: #ffffff;
  color: #333;
}

body.light .hljs-comment {
  color: #999;
  font-style: italic;
}

body.light .hljs-keyword {
  color: #0000ff;
}

pre code.hljs {
  display: block;
  white-space: pre;
}

/* Monaco Editor Specific */
.codicon-check {
  font-size: 15px !important;
}

.monaco-editor .mtk8 {
  color: #BBBBBB !important;
}

/* Cursor Styles */
.pointer,
.file,
.file * {
  cursor: url('../images/cursor/pointer.png') 4 4, pointer !important;
}

/* Hidden Elements */
think {
  display: none;
}