/** ==================== 
   One-compiler
======================= */

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background-color: var(--panel-bg);
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.topbar select,
.topbar button {
  padding: 8px 12px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
  background-color: rgb(129, 17, 17);
  color: white;
  flex-shrink: 0;
  min-width: 110px;
  font-size: 14px;
}

/* Button colors */
.topbar button.reset-btn { background-color: #e74c3c; }
.topbar button.run-btn { background-color: #27ae60; }
.topbar button.clear-btn { background-color: #c0392b; }
.topbar button.download-btn { background-color: #7f8c8d; }
.theme-toggle { background-color: #6c5ce7; }

/* ===== LAYOUT ===== */
.online-compiler-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 10px;
}

/* Editor */
.editor {
  flex: 3;
  min-width: 280px;
  height: 400px;
  min-height: 260px;
  background-color: var(--editor-bg);
  color: var(--editor-text);
  border-radius: 8px;
  overflow: hidden;
  display: block;
}

/* Side panel */
.sidepanel {
  flex: 2;
  min-width: 260px;
  padding: 15px;
  background-color: var(--panel-bg);
  border-radius: 8px;
}

.sidepanel h3 {
  color: #0077ff;
  margin-bottom: 5px;
}

/* Output */
#output {
  height: 200px;
  white-space: pre-wrap;
  background-color: var(--output-bg);
  border: 1px solid #ccc;
  padding: 10px;
  overflow-y: auto;
  border-radius: 5px;
}

/* Input */
textarea#inputCode {
  width: 100%;
  height: 100px;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 8px;
  font-family: Consolas, monospace;
  font-size: 14px;
  resize: none;
}

/* ===== TABLET ===== */
@media (max-width: 768px) {

  .online-compiler-container {
    flex-direction: column;
  }

  .editor {
    height: 300px;
  }

  .sidepanel {
    width: 100%;
  }

  .topbar {
    gap: 8px;
    padding: 8px;
  }
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {

  /* Buttons: 2 per row */
  .topbar select,
  .topbar button {
    flex: 1 1 48%;
    max-width: 48%;
    text-align: center;
    padding: 7px;
    font-size: 13px;
  }

  /* Reduce hero padding */
  section.online-compiler-section {
    padding-top: 140px !important;
  }

  /* Editor height fix */
  .editor {
    height: 260px !important;
    min-height: 260px !important;
  }

  .online-compiler-container {
    padding: 5px;
  }

  textarea#inputCode {
    height: 80px;
  }

  #output {
    height: 130px;
  }
}

/* ===== HERO SECTION ===== */
section.online-compiler-section {
  position: relative;
  background-image: url(../images/compiler.png);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  padding-top: 230px;
  padding-bottom: 40px;
  text-align: center;
}
