/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  background: linear-gradient(120deg, #1a1016 0%, #2a161b 100%);
  color: #ffd5d5;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* === Main Container === */
main {
  max-width: 740px;
  margin: 40px auto 40px auto;
  background: rgba(34, 16, 25, 0.98);
  border-radius: 18px;
  box-shadow: 0 8px 32px #0007;
  padding: 40px 28px;
  border: 1px solid #3a1a22;
}

/* === Headings === */
h1, h2 {
  color: #ff4155;
  font-weight: 900;
  margin-bottom: 24px;
  letter-spacing: 1px;
  user-select: none;
  text-align: center;
}
h2 {
  font-size: 1.5em;
  margin-top: 36px;
}

/* === Labels & Inputs === */
label {
  color: #ff7d7d;
  font-weight: 700;
  display: block;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  letter-spacing: 0.5px;
}
input[type="text"], input[type="search"], textarea {
  width: 100%;
  font-size: 1em;
  background: #221019;
  color: #ffd5d5;
  border: 1.5px solid #46121a;
  border-radius: 8px;
  font-family: 'Fira Mono', monospace;
  padding: 12px;
  margin-bottom: 10px;
  transition: border 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus, textarea:focus {
  border-color: #ff4155;
  box-shadow: 0 0 0 2px #ff415544;
  outline: none;
}
textarea {
  min-height: 120px;
  max-height: 320px;
  resize: vertical;
}

/* === Buttons === */
button {
  background: #ff4155;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7em 1.8em;
  font-size: 1.08em;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
  margin-right: 12px;
  box-shadow: 0 2px 8px #ff415533;
  transition: background 0.2s, transform 0.15s, box-shadow 0.15s;
  user-select: none;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:hover:not(:disabled), button:focus:not(:disabled) {
  background: #b31127;
  transform: scale(1.05);
  box-shadow: 0 4px 16px #ff415544;
  outline: none;
}

/* === Tabs === */
#tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
  gap: 10px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 16px 0;
  cursor: pointer;
  background: #2a161b;
  color: #ff7d7d;
  font-weight: 700;
  font-size: 1.15em;
  border-bottom: 4px solid transparent;
  border-radius: 8px 8px 0 0;
  user-select: none;
  transition: all 0.3s;
  max-width: 240px;
}
.tab:hover:not(.active), .tab:focus:not(.active) {
  background: #3d2127;
  color: #ff6060;
  outline: none;
}
.tab.active {
  border-bottom: 4px solid #ff4155;
  color: #ff4155;
  background: #391d23;
}

/* === Output Areas === */
#output, #clear-output {
  min-height: 80px;
  margin-top: 18px;
  margin-bottom: 14px;
  background: #221019;
  color: #ffd5d5;
  border-left: 5px solid #ff4155;
  border-radius: 8px;
  white-space: pre-line;
  overflow-wrap: break-word;
  font-family: 'Fira Mono', monospace;
  padding: 16px;
  box-shadow: 0 2px 8px #ff415522;
}

/* === Section Divider === */
section {
  margin-bottom: 48px;
  border-bottom: 1px solid #46121a;
  padding-bottom: 24px;
}

/* === Copy Message === */
.copy-msg {
  color: #ff93ae;
  display: none;
  font-size: 1em;
  margin-top: 8px;
  user-select: none;
  font-style: italic;
}

/* === Storage Slots === */
#storage-slots-container .slot {
  margin-bottom: 30px;
  padding: 18px;
  border: 1.5px solid #46121a;
  border-radius: 12px;
  background: #1a1016;
  box-shadow: 0 2px 8px #ff415522;
}
#storage-slots-container label {
  margin-top: 0;
  margin-bottom: 8px;
}
#storage-slots-container input[type="text"] {
  font-family: 'Segoe UI', sans-serif;
  font-weight: 700;
  color: #ffb7b7;
  background: #2b161d;
  border: 1.5px solid #590b13;
  padding: 10px 12px;
  border-radius: 8px;
}
#storage-slots-container textarea {
  margin-top: 6px;
}
#storage-slots-container .buttons {
  margin-top: 10px;
}
#storage-slots-container .buttons button {
  margin-top: 0;
  margin-right: 14px;
}
#storage-slots-container .copy-msg {
  vertical-align: middle;
  margin-left: 8px;
  display: inline-block;
}

/* === Modal === */
#warning-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(24, 16, 20, 0.97);
  backdrop-filter: blur(8px);
  padding: 40px 20px;
  overflow-y: auto;
  font-family: 'Segoe UI', sans-serif;
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
#warning-modal[style*="display: block"] {
  opacity: 1;
  pointer-events: auto;
}
#warning-modal .modal-content {
  max-width: 740px;
  margin: 0 auto;
  background: #2e191f;
  border-radius: 18px;
  padding: 32px 40px;
  color: #ffa0a0;
  box-shadow: 0 8px 32px #000c;
}
#warning-modal pre {
  background: #451c23;
  border-radius: 10px;
  padding: 18px;
  max-height: 340px;
  overflow: auto;
  font-family: 'Fira Mono', monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: #ffe0e0;
  border: 2px solid #ff5a5a;
  margin: 14px 0 18px 0;
}
#warning-modal pre span.highlight {
  background-color: #ff0000cc;
  color: #fff9f9;
  font-weight: 900;
  padding: 0 4px;
  border-radius: 4px;
}
#warning-modal h2 {
  margin-top: 0;
  font-weight: 900;
  font-size: 2.3em;
  color: #ff5a5a;
  text-align: center;
  margin-bottom: 18px;
}
#warning-modal p {
  text-align: center;
  font-size: 1.15em;
  margin-bottom: 22px;
  color: #ff7070;
}
#warning-modal .important-label {
  font-weight: bold;
  font-size: 1.3em;
  margin-top: 26px;
  margin-bottom: 10px;
  border-bottom: 2px solid #ff5a5a;
  color: #ff9494;
}
#warning-modal .important-text {
  min-height: 44px;
  border: 1.5px dashed #ff6b6b;
  background: #3c1c20;
  color: #ff9b9b;
  padding: 16px;
  border-radius: 10px;
  font-size: 1.08em;
  white-space: pre-wrap;
  word-wrap: break-word;
}
#warning-modal .buttons {
  text-align: center;
  margin-top: 32px;
}
#warning-modal button {
  background: linear-gradient(90deg, #ff4155 60%, #ff7d7d 100%);
  padding: 16px 34px;
  margin: 0 18px;
  font-size: 1.3em;
  border-radius: 12px;
  font-weight: 900;
  min-width: 140px;
  user-select: none;
  box-shadow: 0 2px 8px #ff415533;
}
#warning-modal button:hover {
  background: linear-gradient(90deg, #b31127 60%, #ff4155 100%);
}

/* === Responsive === */
@media (max-width: 700px) {
  main, #warning-modal .modal-content {
    padding: 18px 8px;
    max-width: 98vw;
  }
  h1, h2 {
    font-size: 1.2em;
  }
  button, #warning-modal button {
    font-size: 1em;
    padding: 0.5em 1em;
  }
  #tabs .tab {
    font-size: 1em;
    padding: 10px 0;
    max-width: 140px;
  }
}
/* Custom Checkbox Styles */
input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #ff4155;
  border-radius: 6px;
  background: #221019;
  transition: border-color 0.2s, box-shadow 0.2s;
  vertical-align: middle;
  margin-right: 8px;
  position: relative;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 8px #ff415522;
}

input[type="checkbox"]:checked {
  border-color: #ff7d7d;
  background: linear-gradient(135deg, #ff4155 60%, #ff7d7d 100%);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 4px 4px 0;
  transform: rotate(45deg);
  border-radius: 2px;
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 0 2px #ff415544;
  border-color: #ff4155;
}

/* Checkbox label spacing */
label > input[type="checkbox"] {
  margin-right: 8px;
}
/* Add to your style.css */
.checkbox-row {
  align-items: center;
  margin-bottom: 12px;
  gap: 4px;

}