/* --- Editor Tabs --- */
.tab-bar {
  display: flex;
  align-items: center;
  background: #222;
  padding: 4px;
  border-bottom: 1px solid #333;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}
.tab-btn {
  background: #333;
  color: #fff;
  border: none;
  margin-right: 2px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 3px 3px 0 0;
  font-size: 14px;
  position: relative;
  flex: 0 0 auto;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-btn.active {
  background: #444;
  font-weight: bold;
  color: #FFA500;
}
.tab-btn span {
  margin-left: 6px;
  color: #888;
  font-size: 16px;
  outline: none;
}
.tab-btn.active .tab-name {
  margin-left: 6px;
  color: #FFA500;
  font-size: 16px;
}
.add-tab-btn {
  background: #222;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 3px;
}
.editor-view {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
#editor-views {
  height: 100%; 
}
.editor-view.active {
  display: block;
}
/* === LAYOUT === */



body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #000000;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* HEADER */
header#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #222;
  padding: 0.5rem 1rem;
  
}

header .logo img {
  height: 31pt;
  
  object-fit: contain;
}

header .nav-buttons {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

header .nav-buttons a {
  background: none;
  border: 1px solid #ff8c00;
  color: #ff8c00;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 2.5vh;
  text-decoration: none;
}

header .nav-buttons a:hover {
  background: #ff8c00;
  color: #fff;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.5rem;
}
.nav-links li {
  display: flex;
  align-items: center;
}
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s;
}

/* === MAIN CONTENT === */
main#layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* EDITOR (LEFT) */
#editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
}

#code {
  flex: 1;
  background: #1a1a1a;
  color: #ffffff;
  border: 2px solid #ff8c00;
  border-radius: 8px;
  padding: 1rem;
  font-family: monospace;
  font-size: 1rem;
  resize: none;
  outline: none;
}

.btn {
  /*margin-top: 1rem;*/
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #ff8c00;
  color: #000;
  cursor: pointer;
  transition: background 0.2s;
}

.horizontal {
  display: flex;
  gap: 10px;
  justify-content: space-evenly;
}

#run:hover {
  background: #ffa733;
}

/* VISUAL (RIGHT) */
#visual {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

.center {
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding-top: 0px;
  margin: 0px;
}

.centerCanvas {
  display: flex;
  justify-content: center;
}


#canvas {
  background: #fff;
  border: 2px solid #ff8c00;
  border-radius: 8px;
  flex-shrink: 0;
  width: 711px;
  height: 400px;
  transform: scale();
}

@media all and (max-width: 1024px) {
  main#layout {
    flex-direction: column;
  }
  header .nav-buttons {
    display: none;
  }
  header .logo img {
    height: 24pt;
  }
  #canvas {
    width: 100%;
    height: 56%;
  }
  .horizontal {
    font-size: 0.8rem;
    gap: 4px;
    overflow-x: hidden;
    display: block;
    text-align: center;
  }
}

.center button {
  height: fit-content;
  margin-bottom: 10px;
  margin-top: 0px;
}

button svg {
  display: inline;
  vertical-align: middle;
}

/* TABS */
#tabs {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  border-radius: 8px;
  flex-grow: 1;
  overflow: hidden;
}

.tab-buttons {
  display: flex;
}

.tab-buttons button {
  flex: 1;
  background: #333;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  color: #fff;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.tab-buttons button.active {
  background: #ff8c00;
  color: #000;
}

.tab-content {
  flex: 1;
  padding: 0rem;
  overflow: auto;
  background: #1a1a1a;
  color: #eee;
  display: none;
  font-family: monospace;
  border: 2px solid #ff8c00;
  border-radius: 8px;
  border-top: none;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  font-size: 1rem;
  max-height: min-content;
}

.tab-content.active {
  display: block;
}

button {
  font-size: 1rem;
}

.hidden { display: none !important; }

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  padding: 5px;
  background-color: #111;
  overflow-y: auto;
}

.object-card {
  background-color: #222;
  color: white;
  border: 2px dashed orange;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  width: 50px;
  transition: background-color 0.2s ease;
  flex-direction: column;
}

.object-card span {
  font-size: clamp(8px, 5vw, 24px);
  color: white;
  word-break:keep-all;
  line-height: 1.1;
}

.object-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.object-card:hover {
  background-color: #333;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  background-color: #1c1c1c;
  color: white;
  padding: 2rem;
  border-radius: 12px;
  width: 300px;
}

.modal-content input {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background-color: #222;
  color: white;
  border: 1px solid #444;
  border-radius: 8px;
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
}
.modal-actions button {
  background-color: orange;
  border: none;
  padding: 0.5rem 1rem;
  color: black;
  border-radius: 8px;
  cursor: pointer;
}





/* === FOOTER === */
.prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.prompt-box {
  background: #111;
  border: 2px solid orange;
  padding: 1.5em;
  border-radius: 8px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 1em;
}












