@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap');

:root {
  --bg-dark: #1e1e1e;
  --bg-darker: #121212;
  --bg-menu: #1f222b;
  --tabs: #1e1f24;
  --accent-color: #6c72c8;
  --gradient: linear-gradient(135deg, #4b64d2, #5451a6);
  --button-bg: #6c72c8;
  --button-bg-hover: #7b82d2;
  --button-shadow: 0 2px 6px rgba(70, 86, 190, 0.25);
  --button-shadow-hover: 0 4px 12px rgba(70, 86, 190, 0.35);
  --button-border: rgba(135, 145, 220, 0.3);
  --text-light: #e0e0e0;
  --text-dim: #9e9e9e;
  --section-bg: #1e1f24;
  --border-color: #3e3e3e;
  --editor-bg: #1e1e1e;
  --text-strong: #ffffff;
  --input-text: #f2f2f2;
  --panel-control-bg: #1a1d24;
  --panel-control-hover-bg: #242934;
  --panel-control-icon: #888;
  --panel-control-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  --surface-shadow: inset 0px 0px 5px #00000088;
  --interactive-hover-bg: rgba(255, 255, 255, 0.1);
  --card-bg: #1a1d24;
  --card-outline: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  --danger-color: #e05b5b;
  --success-color: #3ddc6b;
  --button-text: #0d1220;
  --button-disabled-bg: #3b3f4a;
  --button-disabled-text: #a5acba;
  --wallet-menu-toggle-bg: #1a1d24;
  --wallet-menu-toggle-text: #d0d0d0;
  --wallet-menu-toggle-hover-bg: #222733;
  --wallet-menu-panel-bg: #11141a;
  --wallet-menu-item-text: #e6e6e6;
  --wallet-menu-item-hover-bg: rgba(138, 147, 212, 0.2);
  --wallet-disabled-text: #666;
  --wallet-muted-text: #9aa0a6;
  --wallet-key-text: #c7c7c7;
  --console-bg: #000000;
  --console-text: #00cc00;
  --console-link: #00ff00;
  --method-border: #2a2d36;
  --method-box-bg: linear-gradient(135deg, rgba(115, 124, 202, 0.08), rgba(0, 0, 0, 0) 45%);
  --method-box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  --method-left-bg: #1a1d24;
  --method-right-bg: #14161c;
  --method-console-bg: #0b0d12;
  --scrollbar-thumb: #444;
  --scrollbar-track: #222;
  --scrollbar-thumb-hover: #666;
  --method-title-width: 180px;
}

body[data-theme="light"] {
  --bg-dark: #ffffff;
  --bg-darker: #f4f6fb;
  --bg-menu: #f2f4f9;
  --tabs: #f8f9fc;
  --text-light: #1c2333;
  --text-dim: #647086;
  --section-bg: #f6f8fc;
  --border-color: #d7ddea;
  --editor-bg: #ffffff;
  --text-strong: #111827;
  --input-text: #182131;
  --panel-control-bg: #ffffff;
  --panel-control-hover-bg: #eef2fb;
  --panel-control-icon: #607089;
  --panel-control-shadow: 0 8px 18px rgba(105, 122, 153, 0.18);
  --surface-shadow: inset 0px 0px 5px rgba(176, 187, 207, 0.28);
  --interactive-hover-bg: rgba(108, 114, 200, 0.12);
  --card-bg: #ffffff;
  --card-outline: inset 0 0 0 1px rgba(108, 114, 200, 0.08);
  --danger-color: #c74646;
  --success-color: #178f4d;
  --button-text: #ffffff;
  --button-disabled-bg: #d7deea;
  --button-disabled-text: #7b869c;
  --wallet-menu-toggle-bg: #ffffff;
  --wallet-menu-toggle-text: #233047;
  --wallet-menu-toggle-hover-bg: #eef2fb;
  --wallet-menu-panel-bg: #ffffff;
  --wallet-menu-item-text: #1f2a3f;
  --wallet-menu-item-hover-bg: rgba(108, 114, 200, 0.12);
  --wallet-disabled-text: #8b95a9;
  --wallet-muted-text: #5f6b82;
  --wallet-key-text: #2c374d;
  --console-bg: #f7f9fc;
  --console-text: #176b34;
  --console-link: #1b61cf;
  --method-border: #d9dfeb;
  --method-box-bg: linear-gradient(135deg, rgba(108, 114, 200, 0.1), rgba(255, 255, 255, 0) 55%);
  --method-box-shadow: 0 10px 24px rgba(148, 163, 184, 0.16);
  --method-left-bg: #ffffff;
  --method-right-bg: #f8faff;
  --method-console-bg: #f3f6fb;
  --scrollbar-thumb: #bcc6d6;
  --scrollbar-track: #eef2f8;
  --scrollbar-thumb-hover: #98a7bc;
}

html, body { 
  margin: 0; 
  height: 100%; 
  font-family: "Noto Sans", monospace, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  overflow: hidden;
}

body {
  color-scheme: dark;
}

body[data-theme="light"] {
  color-scheme: light;
}

a {
  color: var(--accent-color);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar {
  width: 8px;
}
*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

input[type="text"] {
  width: 200px;
  padding: 0.5rem;
  margin-right: 0.5rem;
  margin-bottom: 1.5rem;
  background-color: var(--editor-bg);
  color: var(--input-text);
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

select {
  width: 140px;
  padding: 0.5rem;
  margin-right: 0.5rem;
  margin-bottom: 1.5rem;
  background-color: var(--editor-bg);
  color: var(--input-text);
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

textarea {
  width: 100%;
  height: 230px;
  background: var(--editor-bg);
  color: var(--input-text);
  font-size: 14px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
}

select option {
  background-color: var(--editor-bg);
  color: var(--input-text);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

.container {
  display: flex;
  height: 100%;
}

#resizer {
  height: 6px;
  background: var(--border-color);
  cursor: row-resize;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

#panel-collapse {
  position: absolute;
  right: 10px;
  top: 100%;
  transform: translateY(2px);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: var(--panel-control-bg);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--panel-control-shadow);
  color: var(--panel-control-icon);
}

#panel-collapse:hover {
  background: var(--panel-control-hover-bg);
  transform: translateY(2px);
  box-shadow: var(--panel-control-shadow);
}

#panel-collapse:active {
  transform: translateY(2px);
  box-shadow: var(--panel-control-shadow);
}

.box {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.accent {
  color: var(--accent-color);
}

.accent-solid {
  color: var(--accent-color);
}

.brand-name {
  font-size: 12px;
}

.version-text {
  font-size: 8px;
  color: var(--text-dim);
}

.sidebar {
  width: 50px;
  height: 100%;
  background-color: var(--bg-menu);
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--border-color);
  box-shadow: var(--surface-shadow);
}

.sidebar-icon {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-icon:hover {
  color: var(--text-light);
  background-color: var(--interactive-hover-bg);
}

.sidebar-icon.active {
  color: var(--text-strong);
  border-left: 5px solid var(--accent-color);
}

.sidebar-bottom {
  width: 100%;
  margin-top: auto;
}

.sidebar-label {
  font-size: 0.5rem;
  margin-top: 2px;
  color: var(--text-light);
  line-height: 1;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-icon {
  margin-top: 0;
}

.settings-icon {
  margin-top: 0;
}

.github-icon {
  margin-top: 0;
}

.logo {
    width: 30px;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  position: relative;
}

#editor-container {
  border-bottom: 1px solid var(--border-color);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--surface-shadow);
  min-width: 0;
  min-height: 200px;
  overflow: hidden;
}

#editor-tabs-container {
  background-color: var(--tabs);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding-right: 8px;
  box-shadow: var(--surface-shadow);
}

#header-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6em;
  color: var(--text-dim);
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

#header-menu.hidden {
  display: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-dim);
  border: none;
  box-shadow: none;
  padding: 2px 4px;
  margin: 0;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
}

.theme-toggle:hover:not(:disabled) {
  background: transparent;
  color: var(--text-light);
  box-shadow: none;
  transform: none;
}

.theme-toggle:active:not(:disabled) {
  box-shadow: none;
  transform: none;
}

.theme-toggle i {
  display: block;
}

#header-menu a {
  text-decoration: none;
  padding: 2px 6px;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

#header-menu a:hover {
  color: var(--text-light);
}

.menu-separator {
  color: var(--text-dim);
  margin: 0 2px;
}

#editor-tabs {
  display: flex;
  align-items: center;
  height: 35px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-width: 0;
}

#editor-tabs::-webkit-scrollbar {
  display: none;
}

.editor-tab {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--bg-menu);
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  color: var(--text-dim);
  transition: all 0.2s ease;
  min-width: 120px;
  position: relative;
  height: 35px;
  box-sizing: border-box;
}

.editor-tab:hover {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

.editor-tab.active {
  background-color: var(--bg-dark);
  color: var(--text-strong);
  border-bottom: 2px solid var(--accent-color);
  margin-bottom: -1px;
}

.tab-name {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  margin-left: 8px;
  font-size: 16px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.tab-close:hover {
  background-color: var(--interactive-hover-bg);
  color: var(--text-light);
}

.add-tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background-color: var(--bg-menu);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s ease;
  border-left: 1px solid var(--border-color);
}

.add-tab-button:hover {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

#editor {
  height: 100%;
  width: 100%;
  flex-grow: 1;
}

.editor-ai-shortcut {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0;
  border-radius: 50%;
  background: var(--button-bg);
  color: var(--button-text);
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.editor-ai-shortcut:hover:not(:disabled) {
  background: var(--button-bg-hover);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.editor-ai-shortcut:active:not(:disabled) {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

#panel-container {
  height: 38%;
  background-color: var(--section-bg);
  overflow-y: auto;
  flex-grow: 1;
  min-height: 170px;
  box-shadow: var(--surface-shadow);
}

#panel-expand {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: var(--panel-control-bg);
  color: var(--text-light);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--panel-control-shadow);
  z-index: 20;
}

#panel-expand:hover {
  background: var(--panel-control-hover-bg);
  transform: none;
  box-shadow: var(--panel-control-shadow);
}

#panel-expand:active {
  transform: none;
  box-shadow: var(--panel-control-shadow);
}

#main-content.panel-collapsed #panel-container {
  display: none;
}

#main-content.panel-collapsed #resizer {
  display: none;
}

#main-content.panel-collapsed #panel-expand {
  display: inline-flex;
}

#main-content.panel-collapsed #editor-container {
  height: 100%;
}

.panel {
  padding: 20px;
  display: none;
  height: 100%;
  box-sizing: border-box;
}

.panel.active {
  display: block;
}

.panel-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-loading {
  padding: 20px;
  color: var(--text-dim);
  font-size: 13px;
}

.dim {
  color: var(--text-dim);
}

button {
  background: var(--button-bg);
  color: var(--button-text);
  border: 1px solid var(--button-border);
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--button-shadow);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

button:hover:not(:disabled) {
  background: var(--button-bg-hover);
  box-shadow: var(--button-shadow-hover);
}

button:active:not(:disabled) {
  box-shadow: 0 1px 3px rgba(70, 86, 190, 0.2);
}

button:disabled {
  background: var(--button-disabled-bg);
  color: var(--button-disabled-text);
  border-color: var(--button-disabled-bg);
  box-shadow: none;
  cursor: not-allowed;
}

.status {
  margin-left: 10px;
  color: var(--text-light);
}

h1 {
  margin-top: 0;
  color: var(--text-light);
  font-size: 24px;
}

.console {
  background: var(--console-bg);
  color: var(--console-text);
  padding: 10px;
  font-family: monospace;
  height: 200px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 10px;
}

.console .ansi-console-output {
  margin: 0;
  font: inherit;
  color: inherit;
  background: transparent;
  white-space: pre;
}

.console a {
  color: var(--console-link);
}

.console .tx-hash-link {
  font-size: 0.9em;
}

#build-console {
  display: none;
}
/* Mobile */
@media (max-width: 768px) {
  #header-menu {
    display: none;
  }
}
