/* Global text styling */
/* Tema Default (Light) */
:root {
  --bg-color: #fff8e1;
  --text-color: #2c2c2c;
}

/* Tema Dark */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #f0f0f0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: 0.3s; /* Agar transisi warna halus */
  /*background-color: #fff8e1; /* kuning krem lembut */
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 16px;
  line-height: 1.6;
  /*color: #2c2c2c; /* teks abu tua agar mudah dibaca */
  margin: 0;
  padding: 0 1.25rem;
}

/* Heading balance */
h1, h2, h3, h4 {
  font-weight: 700;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  line-height: 1.3;
  color: #1a1a1a;
}

/* Section spacing */
section {
  margin-bottom: 2rem;
}

/* Lists */
ul {
  margin: 0.5rem 0 1rem 1.5rem;
  padding: 0;
}

li {
  margin-bottom: 0.5rem;
}

/* Descriptions and features titles */
h2 span, h3 span {
  display: inline-block;
  vertical-align: middle;
}

/* Icons before headings */
h2::before, h3::before {
  font-size: 1rem;
}

/* Responsive scaling for mobile */
@media (max-width: 600px) {
  body {
    font-size: 15px;
    line-height: 1.5;
    background-color: #fff3cd; /* sedikit lebih hangat di layar kecil */
  }
  h1 {
    font-size: 1.4rem;
  }
}
/* Global

/* 
/* Paragraph inside list item */
li p {
  margin: 0.3rem 0;
  font-size: 0.98rem;
}

/* Optional: link styling (Starship-like blue) */
a {
  /* color: #58a6ff; */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Dark/light auto color (optional) */
@media (prefers-color-scheme: light) {
  p {
    color: #24292f; 
  }
}


.add-button {
  position: absolute;
  top: 1px;
  left: 1px;
  display: none;
}

/*
code {
  display: block;
  background: #0b0c0e;
  color: #f0f0f0;
  padding: 1em;
  border-radius: 5px;
  overflow-x: auto;
}
*/

code {
    padding: .15em .45em;
    border-radius: 6px;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    color: #18181b;
    font-family: ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
    code {
        background: #27272a;
        border-color: #3f3f46;
        color: #fafafa;
    }
}

.github-fork-ribbon:before {
  background-color: #0b0c0e;
}

footer {
  margin-top: 3em;
}

.share-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: nowrap; /* jangan wrap ke baris baru */
  overflow-x: auto;  /* jika kebanyakan elemen, bisa di-scroll horizontal */
  margin-top: 0.5em;
  -webkit-overflow-scrolling: touch; /* smooth scroll di iOS */
}



#player {
  max-width: 100%;
  margin-top: 1em;
}

iframe,
.asciinema-player {
  width: 100% !important;
  height: auto !important;
}

.note {
  font-size: 0.9em;
  background: #fff9c4;
  padding: 1em;
  border-left: 5px solid #fbc02d;
  margin-top: 1em;
}

.share-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-container button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.2s;
}

.share-container button:hover {
  background: #43a047;
  transform: scale(1.05)
}

.share-container button img {
  width: 18px;
  height: 18px;
  filter: invert(1) brightness(1.2);
  transition: filter 0.2s;
}

/* kalau latar tombolnya terang, balik ke ikon hitam */
@media (prefers-color-scheme: light) {
  .share-container button {
    background: #f0f0f0;
    color: #111;
  }

  .share-container button:hover {
    background: #ddd;
  }

  .share-container button img {
    filter: none;
  }
}

/* Tambahan gaya share */
.share {
  font-weight: bold;
  position: relative;
}

.share:before {
  content: ".";
  font-size: 2.2em;
  position: absolute;
  bottom: -2.5px;
  left: -4px;
}

.share:after {
  content: ":";
  font-size: 2em;
  position: absolute;
  bottom: -6px;
  right: -7px;
}
.code-container {
  position: relative; /* Essential for positioning the button */
  /* Other styling for the code container */
}

.copy-code-button {
  position: absolute;
  top: 5px;
  right: 5px;
  /* Add other styling for appearance */
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  padding: 5px 10px;
  cursor: pointer;
}
pre {
  position: relative;
}

.copy-button {
  position: absolute;
  display: inline-block;
  cursor: pointer;
  inset: 5px 5px auto auto;
  width: 1em;
  height: 1em;
  border: 1px solid;
  box-shadow: -3px 3px #999;
}
:is(:focus, :hover) > .copy-button {
  display: inline-block;
}
.copy-success {
  box-shadow: none;
  background: #999;
  transition: box-shadow 300ms ease-out, background 300ms ease-out;
}
.copy-fail {
  border-style: dotted;
}
.copy-box {
  display: inline-block
  align-items: center;
  gap: 6px;
}


.copy-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 420px;
  font-family: ui-monospace, Consolas, "Roboto Mono", monospace;
}

/* ✳️ Styling input agar tampil seperti blok kode */
#installCmd {
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Roboto Mono", monospace;
  font-size: 13px;
  color: #f0f0f0;
  background: #0b0c0e;
  border: none;
  border-left: 4px solid #04AA6D; /* hijau khas W3Schools */
  padding: 10px 12px; 
 /* padding: 10px 75px 10px 12px; /* kanan lebih lebar */
  border-radius: 6px;
  box-sizing: border-box;
  outline: none;
  cursor: default;
}

/* ✳️ Styling tombol copy */
#myFixCopy {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  margin-top: 6px;
  background: #04AA6D;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}


/* 🌙 Mode Gelap */
@media (prefers-color-scheme: dark) {
  #installCmd {
    background: #161b22;
    color: #e6edf3;
    border-left: 4px solid #2ea043;
  }

  #myFixCopy {
    background: #2ea043;
  }

  #myFixCopy:hover {
    background: #238636;
  }
}

/* 📦 Tata letak mirip share-container tapi untuk table */
.table-container {
  display: flex;
  flex-wrap: wrap;         /* elemen bisa turun ke baris baru */
  gap: 10px;               /* jarak antar elemen */
  align-items: flex-start; /* biar sejajar rapi di atas */
  justify-content: flex-start; /* biar semua elemen mulai dari kiri */
  overflow-x: auto;        /* jika kepanjangan, bisa digeser horizontal */
  -webkit-overflow-scrolling: touch; /* smooth scroll di mobile */
  margin-top: 1em;
}

/* Jika kamu pakai <table> langsung di dalamnya */
.table-container table {
  border-collapse: collapse;
  min-width: 250px;
}

/* Sel dan isi tabel biar tetap bersih tapi rapi */
.table-container td,
.table-container th {
  padding: 8px 12px; /* 0 */
  text-align: left;
  border: none;
  font-family: monospace;
  background: #fff;
}

.table-container table {
  border-collapse: separate; /* penting biar border-radius berfungsi */
  border-spacing: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden; /* biar radius nggak bocor */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.table-container td {
  border: none;
  padding: 0.5em;
}

.table-container td:first-child {
  border-right: 1px solid #ddd; /* garis pemisah antara input dan tombol */
}



/* 🌙 Mode Gelap */
@media (prefers-color-scheme: dark) {
  .table-container td,
  .table-container th {
    border-color: #30363d;
    background: #161b22;
    color: #e6edf3;
  }
}

.marquee {
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%;
  animation: scroll 15s linear infinite;
}

.marquee a {
  margin: 0 1em;
  text-decoration: none;
  color: dodgerblue;
}

.marquee a:hover {
  text-decoration: underline;
}

@keyframes scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.toggle-btn {
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: .4rem;
      user-select: none;
}
.toggle-btn button {
      border: none;
      background: none;
      font-size: 1em;
}
.collapse {
      overflow: hidden;
      height: 0;
      transition: height .25s ease;
}

.info-icon {
  cursor: pointer;
  font-size: 0.9em;
  color: #58a6ff;
  margin-left: 6px;
}
.info-icon:hover {
  color: #79c0ff;
}
.info-text {
  margin: 4px 0 10px 0;
  font-size: 0.9em;
  color: #8b949e; 
}

details {
  margin: 6px 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: initial;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details > *:not(summary) {
  margin-left: 20px;
  margin-top: 6px;
  color: initial;
}
summary h4 {
  display: inline;
  margin: 0;
  font-weight: 600;
  font-size: 1em;
}
/* body {
      background: #1e1e1e;
      margin: 0;
    }
*/
/* ===== Base Page ===== 
body {
  background: #0d1117;
  margin: 0;
  padding: 20px;
  font-family: system-ui, sans-serif;
  color: #c9d1d9;
}

/* ===== Editor Container ===== 
#editor {
  width: 100%;
  min-height: 140px;

  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 14px;
  line-height: 1.5;

  background: #0d1117;
  color: #c9d1d9;

  border: 1px solid #30363d;
  border-radius: 8px;

  padding: 10px 12px;

  outline: none;
  overflow: auto;
  resize: vertical;

  white-space: pre-wrap;
  word-break: break-word;

  caret-color: #58a6ff;

  box-sizing: border-box;

  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ===== Focus State ===== 
#editor:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.4);
}

/* ===== Placeholder ===== 
#editor:empty::before {
  content: attr(data-placeholder);
  color: #8b949e;
  opacity: 0.7;
  pointer-events: none;
}

/* Optional: placeholder saat focus 
#editor:focus:empty::before {
  opacity: 0.4;
}

/* ===== Scrollbar (modern) ===== 
#editor::-webkit-scrollbar {
  width: 10px;
}

#editor::-webkit-scrollbar-track {
  background: transparent;
}

#editor::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 6px;
}

#editor::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ===== Highlight.js Fix ===== 
#editor pre,
#editor code {
  margin: 0;
  padding: 0;
  background: transparent !important;
}

/* paksa font tetap monospace 
#editor * {
  font-family: inherit !important;
}

/* ===== Selection ===== 
#editor ::selection {
  background: rgba(88, 166, 255, 0.3);
}

/* ===== Optional: subtle inset effect ===== 
#editor {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* ===== Optional: smooth typing feel ===== 
#editor {
  will-change: contents;
}



/* ===== Page ===== 
body {
  background: #0d1117;
  margin: 0;
  padding: 20px;
  font-family: system-ui, sans-serif;
  color: #c9d1d9;
}
*/

/* ===== Wrapper (INI KUNCINYA) ===== */
.editor-wrapper {
  width: 100%;
  max-width: 900px;
}

/* ===== Header (status + button di dalam border) ===== */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: #0d1117;
  border: 1px solid #30363d;
  border-bottom: none;
  border-radius: 8px 8px 0 0;

  padding: 6px 10px;
}

/* status text */
#status {
  font-family: monospace;
  font-size: 12px;
  color: #00ff9c;
}

/* copy button */
#copyBtn {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;

  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}

#copyBtn:hover {
  background: #30363d;
}

/* ===== Editor box ===== */
#editor {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.5;

  background: #0d1117;
  color: #c9d1d9;

  border: 1px solid #30363d;
  border-top: none;
  border-radius: 0 0 8px 8px;

  padding: 10px 12px;
  min-height: 140px;

  outline: none;
  white-space: pre-wrap;

  caret-color: #58a6ff;

  resize: vertical;
  overflow: auto;

  box-sizing: border-box;
}

/* focus glow */
#editor:focus {
  box-shadow: 0 0 0 1px rgba(88,166,255,0.4);
}

/* placeholder */
#editor:empty::before {
  content: attr(data-placeholder);
  color: #8b949e;
  opacity: 0.7;
}

/* scrollbar */
#editor::-webkit-scrollbar {
  width: 10px;
}

#editor::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 6px;
}
