/* ====== CloverPit Game-Themed Dark Style ====== */
/* Color Palette:
   Background: #0C0C0C (near-black)
   Accent Red: #C00000 (blood red)
   Soft Red Glow: #FF2E2E (hover/active)
   Text Primary: #EDEDED (off-white)
   Text Secondary: #A3A3A3 (muted grey)
   Lucky Clover Green: #237C3C
   Rusty Metal: #4B4B4B (panels)
   Faded Gold: #BBAA66 (highlights)
*/

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
  background:#0C0C0C;
  min-height:100vh;
  padding:20px;
  color:#EDEDED;
}

.container {
  max-width:1200px;
  margin:0 auto;
  background:#1a1a1a;
  border-radius:8px;
  box-shadow:0 8px 32px rgba(0,0,0,.5);
  overflow:hidden;
  border:1px solid #2a2a2a;
}

header {
  background:#1a1a1a;
  color:#EDEDED;
  padding:40px 30px;
  text-align:center;
  border-bottom:2px solid #C00000;
}

h1 {
  font-size:2.5em;
  font-weight:700;
  margin-bottom:8px;
  color:#EDEDED;
  letter-spacing:-0.5px;
}

.subtitle {
  font-size:1.05em;
  font-weight:400;
  color:#6a6a6a;
}

.main-content { padding:40px; }

.upload-section {
  background:#1a1a1a;
  border:2px dashed #4B4B4B;
  border-radius:8px;
  padding:50px 40px;
  text-align:center;
  margin-bottom:30px;
  transition:.3s;
  cursor:pointer;
}

.upload-section:hover {
  border-color:#C00000;
  background:#1f1f1f;
}

.upload-section.dragover {
  border-color:#C00000;
  background:#2a1a1a;
  border-style:solid;
}

.upload-section h3 {
  font-size:1.2em;
  margin-bottom:8px;
  color:#EDEDED;
  font-weight:600;
}

input[type="file"]{ display:none; }

.btn {
  background:#C00000;
  color:#EDEDED;
  border:none;
  padding:12px 24px;
  font-size:14px;
  border-radius:4px;
  cursor:pointer;
  transition:.2s;
  font-weight:600;
  box-shadow:0 2px 4px rgba(0,0,0,.3);
}

.btn:hover {
  background:#d91010;
  box-shadow:0 4px 8px rgba(0,0,0,.4);
  transform:translateY(-1px);
}

.btn:active {
  transform:translateY(0) scale(.98);
}

.btn-secondary {
  background:#4B4B4B;
  color:#EDEDED;
}

.btn-secondary:hover {
  background:#5a5a5a;
  box-shadow:0 2px 12px rgba(75,75,75,.5);
}

.editor-section {
  display:none;
  animation:fadeIn .4s;
}

.editor-section.active { display:block; }

@keyframes fadeIn {
  from {opacity:0; transform:translateY(10px)}
  to {opacity:1; transform:translateY(0)}
}

.tabs {
  display:flex;
  gap:8px;
  margin-bottom:24px;
  border-bottom:2px solid #2a2a2a;
  overflow-x:auto;
  padding-bottom:12px;
  scrollbar-gutter:stable;
}

.tab {
  padding:12px 24px;
  background:transparent;
  border:none;
  border-bottom:3px solid transparent;
  cursor:pointer;
  font-size:15px;
  font-weight:600;
  color:#A3A3A3;
  transition:.2s;
  white-space:nowrap;
}

.tab:hover {
  color:#EDEDED;
  background:rgba(192,0,0,.1);
}

.tab.active {
  color:#EDEDED;
  border-bottom-color:#C00000;
  background:rgba(192,0,0,.15);
}

.tab-content { display:none; animation:fadeIn .3s; }
.tab-content.active { display:block; }

.form-group {
  margin-bottom:24px;
  background:#1a1a1a;
  padding:20px;
  border-radius:8px;
  border:1px solid #2a2a2a;
}

.form-row {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:16px;
  margin-bottom:12px;
}

.form-field { display:flex; flex-direction:column; }

.form-field label {
  font-weight:600;
  margin-bottom:6px;
  color:#EDEDED;
  font-size:14px;
  display:flex;
  align-items:center;
  gap:8px;
}

.form-field input, .form-field select, .form-field textarea {
  padding:10px 14px;
  border:2px solid #2a2a2a;
  border-radius:6px;
  font-size:15px;
  transition:.2s;
  background:#0C0C0C;
  color:#EDEDED;
}

.form-field textarea {
  min-height:120px;
  font-family:Consolas,Monaco,'Courier New',monospace;
  font-size:13px;
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline:none;
  border-color:#C00000;
  box-shadow:0 0 0 3px rgba(192,0,0,.2);
}

.form-field input[type="checkbox"] {
  width:20px;
  height:20px;
  cursor:pointer;
  accent-color:#C00000;
}

.section-title {
  font-size:1.3em;
  font-weight:600;
  margin-bottom:20px;
  padding-bottom:10px;
  color:#EDEDED;
  border-bottom:2px solid #2a2a2a;
}

.subsection-title {
  font-size:1.1em;
  font-weight:600;
  margin:20px 0 12px;
  color:#A3A3A3;
}

.help-text {
  font-size:13px;
  color:#A3A3A3;
  margin-top:4px;
}

.warning-box {
  background:rgba(192,0,0,.1);
  border-left:3px solid #C00000;
  padding:12px 16px;
  margin-bottom:16px;
  border-radius:4px;
  font-size:14px;
  color:#FF9999;
}

.info-box {
  background:#1a1a1a;
  border-left:3px solid #4B4B4B;
  padding:16px 20px;
  margin-bottom:20px;
  border-radius:4px;
}

.info-box p { margin:4px 0; font-size:14px; color:#A3A3A3; }

.status {
  padding:16px 20px;
  border-radius:8px;
  margin-bottom:20px;
  display:none;
  font-size:.95em;
  font-weight:500;
}

.status.success {
  background:rgba(35,124,60,.15);
  color:#EDEDED;
  border:1px solid #237C3C;
  display:block;
}

.status.error {
  background:rgba(192,0,0,.15);
  color:#FF9999;
  border:1px solid #C00000;
  display:block;
}

.action-bar {
  position:sticky;
  bottom:0;
  background:#1a1a1a;
  padding:20px;
  border-top:2px solid #2a2a2a;
  display:flex;
  gap:12px;
  justify-content:space-between;
  box-shadow:0 -4px 12px rgba(0,0,0,.3);
}

.powerup-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:12px;
  max-height:400px;
  overflow-y:auto;
  padding:12px;
  background:#0C0C0C;
  border:2px solid #2a2a2a;
  border-radius:8px;
}

.powerup-item {
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px;
  background:#1a1a1a;
  border-radius:6px;
  border:1px solid #2a2a2a;
  transition:.2s;
}

.powerup-item:hover {
  background:#242424;
  border-color:#4B4B4B;
}

.list {
  max-height:420px;
  overflow:auto;
  border:1px solid #2a2a2a;
  border-radius:8px;
  background:#0C0C0C;
}

/* Explorer: avoid nested scrollbars in the fields section */
#explorerHost.list { max-height:none; overflow:visible; }

/* Advanced JSON editor sizing */
#jsonEditor {
  width:100%;
  min-height:60vh;
  resize:vertical;
  padding:10px 14px;
  border:2px solid #2a2a2a;
  border-radius:6px;
  background:#0C0C0C;
  color:#EDEDED;
  font-family:Consolas,Monaco,'Courier New',monospace;
  font-size:13px;
  line-height:1.4;
}

.list table {
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

.list th, .list td {
  padding:8px 10px;
  border-bottom:1px solid #2a2a2a;
  vertical-align:top;
  color:#EDEDED;
}

.list th {
  position:sticky;
  top:0;
  background:#1a1a1a;
  text-align:left;
  font-weight:700;
}

.chip {
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  background:#2a2a2a;
  font-size:12px;
  color:#A3A3A3;
}

.row-actions { display:flex; gap:8px; }
.small { font-size:12px; }

footer {
  background:#1a1a1a;
  padding:24px;
  text-align:center;
  font-size:0.95em;
  color:#A3A3A3;
  border-top:1px solid #2a2a2a;
}

footer p { margin:6px 0; }
footer .muted { color:#6a6a6a; font-size:.9em; }

.collapsible {
  cursor:pointer;
  user-select:none;
  padding:12px 16px;
  background:#1a1a1a;
  border-radius:6px;
  border:1px solid #2a2a2a;
  margin-bottom:20px;
  transition:.2s;
}

.collapsible:hover {
  background:#242424;
  border-color:#4B4B4B;
}

.collapsible-header {
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  color:#EDEDED;
}

.collapsible-arrow {
  font-size:0.8em;
  transition:transform .2s;
  color:#C00000;
}

.collapsible-arrow.open {
  transform:rotate(90deg);
}

.collapsible-content {
  display:none;
  padding:12px 0 0 24px;
  font-size:13px;
  color:#A3A3A3;
}

.collapsible-content.open { display:block; }
.collapsible-content ul { margin:8px 0; padding-left:20px; }
.collapsible-content li { margin:4px 0; }
.collapsible-content code {
  background:#0C0C0C;
  padding:2px 6px;
  border-radius:3px;
  color:#BBAA66;
  border:1px solid #2a2a2a;
}

.password-field { margin-bottom:20px; }
.password-field input { width:100%; max-width:400px; }

.initial-sections {
  transition:opacity .3s, max-height .3s;
  overflow:hidden;
}

.initial-sections.hidden {
  opacity:0;
  max-height:0;
  margin:0;
  padding:0;
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
  width:12px;
  height:12px;
}

::-webkit-scrollbar-track {
  background:#0C0C0C;
}

::-webkit-scrollbar-thumb {
  background:#4B4B4B;
  border-radius:6px;
  border:2px solid #0C0C0C;
}

::-webkit-scrollbar-thumb:hover {
  background:#5a5a5a;
}

@media (max-width:768px){
  .form-row { grid-template-columns:1fr; }
  .action-bar { flex-direction:column; }
}
