/* Global Styles */
body {
  margin: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
}

/* Toolbar */
.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #fff;
  border-bottom: 1px solid #ccc;
  display: flex;
  align-items: center;
  padding: 0 10px;
  z-index: 1000;
  overflow-x: auto;
  white-space: nowrap;
}

.toolbar select,
.toolbar button,
.toolbar input {
  margin: 0 5px;
  height: 30px;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}
#toggleFiles {
    border: 10px 30px;
}

#fontSize {
  place-items: center;
}

/* Ace Editor */
#editor {
  position: absolute;
  top: 40px;
  bottom: 0;
  left: 0;
  right: 0;
}

/* Confirmation Modal (sama dengan modal info, disesuaikan) */
.modal {
  display: none; 
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.modal ul,
.modal li {
  text-align: left;
}
.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 8px;
  text-align: center;
}

.confirm-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

.confirm-buttons button {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

/* Log AI Panel (Slide dari kanan) */
.log-container {
  position: fixed;
  top: 40px;
  right: -320px;
  width: 300px;
  height: calc(100% - 40px);
  background: #fff;
  border-left: 1px solid #ccc;
  overflow-y: auto;
  transition: right 0.3s ease;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.log-container.show {
  right: 10px;
}

.log-buttons {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.log-buttons button {
  flex: 1;
  padding: 5px 0;
  font-size: 14px;
  transition: background 0.3s, box-shadow 0.3s;
  cursor: pointer;
  border-radius: 4px;
}

.log-buttons button:hover {
  background: #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.log-messages {
  max-height: calc(100% - 90px);
  overflow-y: auto;
  margin-bottom: 10px;
}

.log-message {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  margin-bottom: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.log-message.you {
  background: linear-gradient(135deg, #FFA07A, #FFE4B5) !important;
  color: #000 !important;
}

.log-message.ai.finished {
  background: linear-gradient(135deg, #00DFFF, #ffffff) !important;
  color: #000 !important;
}

.log-message.ai.typing {
  background: linear-gradient(135deg, #87CEFA, #E0FFFF) !important;
  color: #000 !important;
}

.log-message.ai.code {
  background: linear-gradient(135deg, #ffffff, #FFFACD) !important;
  color: #000 !important;
}

.log-message > .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

pre {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  color: #000;
  font-family: monospace;
  padding: 10px;
  border-radius: 4px;
  margin: 5px 0;
  max-width: 100%;
  overflow-x: auto;
}

h3 {
  margin: 5px 0;
  font-size: 16px;
  color: #333;
}

/* Log Input */
.log-input {
  display: flex;
}

.log-input input {
  flex: 1;
  padding: 5px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.log-input button {
  padding: 5px 10px;
  font-size: 14px;
  margin-left: 5px;
  transition: background 0.3s, box-shadow 0.3s;
  cursor: pointer;
  border-radius: 4px;
}

.log-input button:hover {
  background: #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Typing Indicator */
.typing-indicator {
  display: inline-block;
  margin-left: 5px;
}

.typing-indicator .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 2px;
  background: #333;
  border-radius: 50%;
  animation: blink 1s infinite;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 50%, 100% { opacity: 0; }
  25% { opacity: 1; }
}

/* Info Box untuk Ace Editor */
#editorInfo {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1100;
  display: none;
  max-width: 300px;
}

/* File Panel (Slide dari kiri) */
#filePanel {
  position: fixed;
  top: 40px;
  left: -320px;
  width: 300px;
  height: calc(100% - 40px);
  background: #fff;
  border-right: 1px solid #ccc;
  overflow-y: auto;
  transition: left 0.3s ease;
  padding: 10px;
  box-sizing: border-box;
  z-index: 1000;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

#filePanel.show {
  left: 10px;
}

#filePanel h3 {
  margin-top: 0;
}

/* Add File Section */
#addFileSection {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

#addFileSection input {
  flex: 1;
  padding: 4px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* File List */
#filePanel ul {
  padding: 0;
  margin: 0;
}

#filePanel li {
  padding: 8px;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
}

#filePanel li.active {
  background: #e0e0e0;
}

/* Run Panel (Slide dari bawah) dengan Tabs */
/* Gunakan unit viewport agar responsif */
#outputContainer {
  position: fixed;
  bottom: -50vh;
  left: 0;
  right: 0;
  height: 50vh;
  background: #fff;
  border-top: 1px solid #ccc;
  transition: bottom 0.3s ease;
  z-index: 900;
}

#outputContainer.show {
  bottom: 0;
}

#runTabs {
  display: flex;
  border-bottom: 1px solid #ccc;
}

.run-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background: #f5f5f5;
  border: none;
  outline: none;
  font-size: 14px;
  transition: background 0.3s ease;
}

.run-tab.active {
  background: #ddd;
}

#runContent {
  height: calc(100% - 40px);
  display: flex;
  flex-direction: column;
}

.run-pane {
  display: none;
  height: 100%;
}

.run-pane.active {
  display: block;
}

/* Isi dalam tab memenuhi 100% */
#outputFrame {
  width: 100%;
  height: 100%;
  border: 1px solid #ccc;
}

#runLog {
  width: 100%;
  height: 100%;
  background: #1e1e1e;
  color: #fff;
  padding: 10px;
  overflow-y: auto;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 12px;
}

/* Modal Info */
.modal {
  display: none; 
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, #ffffff, #f2f2f2);
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  animation: slideDown 0.5s;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.github-icon {
  width: 30px;
  height: 30px;
  margin-top: 10px;
}

/* Toolbar */
.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #fff;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  z-index: 1000;
  overflow-x: auto;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 5px;
}
