/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 *
 * "Basic 2004 web layout" skin:
 * - fixed-width centered page
 * - light gray background, white content area
 * - table-ish / boxy panels, bevel borders
 * - classic blue links, Verdana/Tahoma fonts
 * - no flexbox-driven layout (works like old browsers; still uses your IDs)
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: Verdana, Tahoma, Arial, sans-serif;
  font-size: 12px;
  background: #cfcfcf;
  color: #000;
}

/* ===== Page chrome (centered fixed width like 2004) ===== */
header, main, footer {
  width: 80vw;
  margin: 0 auto;
}

header {
  background: #003366;
  color: #fff;
  border: 1px solid #000;
  border-bottom: none;
  padding: 12px 14px;
}

header h1 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
}

header p {
  font-size: 11px;
  color: #d8e6ff;
}

/* Content area */
main {
  background: #ffffff;
  border: 1px solid #000;
  border-top: none;
  padding: 12px;
}

/* Footer */
footer {
  background: #e9e9e9;
  border: 1px solid #000;
  border-top: none;
  padding: 10px 14px;
  text-align: center;
  color: #333;
  font-size: 11px;
}

footer a {
  color: #0000ee;
  text-decoration: underline;
}
footer a:visited {
  color: #551a8b;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* ===== Generic 2004-ish UI elements ===== */
a {
  color: #0000ee;
}
a:visited {
  color: #551a8b;
}

button,
.file-button,
select,
input[type="text"],
input[type="checkbox"] {
  font-family: Verdana, Tahoma, Arial, sans-serif;
  font-size: 12px;
}

button,
.file-button {
  padding: 4px 10px;
  border: 1px solid #000;
  background: #e1e1e1;
  color: #000;
  cursor: pointer;
}

button:hover,
.file-button:hover {
  background: #f1f1f1;
}

button:active,
.file-button:active {
  background: #d6d6d6;
}

/* ===== Upload Section ===== */
#upload-section {
  margin-bottom: 12px;
}

#drop-zone {
  border: 1px dashed #666;
  background: #f6f6f6;
  padding: 14px;
  text-align: center;
}

#drop-zone.drag-over {
  border-color: #003366;
  background: #e6f0ff;
}

#drop-zone p {
  margin-bottom: 8px;
  color: #333;
}

#file-input {
  display: none;
}

#file-info {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #999;
  background: #f4f4f4;
}

#file-name {
  font-weight: bold;
  display: inline-block;
  margin-right: 10px;
}

/* Make the action buttons line up old-school */
#download-btn,
#clear-btn {
  margin-left: 6px;
}

/* ===== Loading Section ===== */
#loading-section {
  padding: 16px;
  text-align: center;
}

.spinner {
  width: 22px;
  height: 22px;
  margin: 0 auto 10px auto;
  border: 3px solid #999;
  border-top-color: #003366;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Keep animation, but the rest looks retro */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Error Section ===== */
#error-section {
  border: 1px solid #990000;
  background: #ffecec;
  padding: 10px;
  margin-bottom: 12px;
}

#error-section h2 {
  color: #990000;
  font-size: 13px;
  margin-bottom: 6px;
}

#error-message {
  border: 1px solid #ccaaaa;
  background: #fff6f6;
  padding: 8px;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

#error-dismiss {
  background: #e1e1e1;
}

/* ===== 2-column "classic" layout ===== */
#content-section {
  /* old-school two columns: float sidebar left, content right */
  overflow: hidden; /* clearfix */
}

/* Left Panel */
#left-panel {
  float: left;
  width: 220px;
  border: 1px solid #999;
  background: #f4f4f4;
}

/* Tabs: looks like old nav bar */
#panel-tabs {
  border-bottom: 1px solid #999;
  background: #e1e1e1;
  overflow: hidden;
}

.tab-btn {
  float: left;
  width: 50%;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: #000;
  cursor: pointer;
  font-weight: bold;
}

.tab-btn:hover {
  background: #f1f1f1;
}

.tab-btn.active {
  background: #ffffff;
  border-bottom: 1px solid #ffffff; /* fake "selected" tab */
}

/* Tab contents */
.tab-content {
  display: none;
  padding: 6px 0;
  height: 420px;       /* fixed-ish like old layouts */
  overflow: auto;
}

.tab-content.active {
  display: block;
}

/* Asset filters */
#asset-filters {
  padding: 6px 8px;
  border-bottom: 1px solid #ddd;
  background: #f0f0f0;
}

#asset-search {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #999;
  margin-bottom: 6px;
}

#type-filters {
  font-size: 10px;
}

#type-filter-actions {
  margin-bottom: 4px;
}

#type-filter-actions button {
  padding: 2px 8px;
  font-size: 10px;
  margin-right: 4px;
}

#type-filters label {
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 2px;
  white-space: nowrap;
}

#type-filters input[type="checkbox"] {
  margin-right: 2px;
}

#asset-count {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}

#script-list, #asset-list {
  list-style: none;
}

#script-list li, #asset-list li {
  padding: 6px 10px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

#script-list li:hover, #asset-list li:hover {
  background: #e9f2ff;
}

#script-list li.selected, #asset-list li.selected {
  background: #d6e6ff;
}

.script-type, .asset-type {
  display: block;
  font-size: 10px;
  color: #444;
  margin-top: 2px;
}

.asset-id {
  font-size: 10px;
  color: #666;
}

/* Right Panel */
#right-panel {
  margin-left: 232px; /* 220 + borders/gap */
}

/* Code / Asset panels: "module boxes" */
#code-panel, #asset-panel {
  border: 1px solid #999;
  background: #fff;
  margin-bottom: 12px;
}

#code-header,
#asset-header {
  background: #e1e1e1;
  border-bottom: 1px solid #999;
  padding: 8px 10px;
  overflow: hidden;
}

#code-header h2,
#asset-header h2 {
  float: left;
  font-size: 13px;
}

#code-options,
#asset-options {
  float: right;
}

#code-options label {
  margin-right: 10px;
  font-size: 11px;
}

/* Code view tabs (Lingo/LASM) */
#code-view-tabs {
  display: inline-block;
  margin-right: 12px;
  border: 1px solid #999;
  background: #e1e1e1;
}

.code-view-btn {
  padding: 3px 10px;
  border: none;
  background: transparent;
  color: #000;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
}

.code-view-btn:hover {
  background: #f1f1f1;
}

.code-view-btn.active {
  background: #ffffff;
}

.code-view-btn + .code-view-btn {
  border-left: 1px solid #999;
}

/* Retro code area */
#code-display {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  background: #f8f8f8;
  padding: 10px;
  overflow: auto;
  white-space: pre;
}

#code-display code {
  display: block;
}

/* Lingo syntax highlighting - Classic IDE colors */
.hl-keyword {
  color: #0000ff;
  font-weight: bold;
}

.hl-operator {
  color: #444444;
}

.hl-string {
  color: #008000;
}

.hl-comment {
  color: #808080;
  font-style: italic;
}

.hl-number {
  color: #ff6600;
}

.hl-symbol {
  color: #990099;
}

.hl-builtin {
  color: #008080;
}

/* LASM syntax highlighting */
.hl-position {
  color: #666666;
}

.hl-opcode {
  color: #0000cc;
  font-weight: bold;
}

.hl-operand {
  color: #cc6600;
}

.hl-translation {
  color: #808080;
  font-style: italic;
}

/* Asset preview area */
#asset-preview {
  background: #f8f8f8;
  padding: 10px;
  overflow: auto;
}

#asset-info {
  border: 1px solid #ddd;
  background: #fff;
  padding: 8px;
  margin-bottom: 10px;
  font-size: 11px;
}

#asset-info strong {
  color: #003366;
}

#asset-canvas {
  max-width: 100%;
  border: 1px solid #999;
  background: #fff;
  image-rendering: pixelated;
}

/* Audio player */
#audio-player {
  padding: 10px;
  background: #fff;
  border: 1px solid #ddd;
  margin-bottom: 10px;
}

#sound-preview {
  width: 100%;
}

#asset-text,
#asset-binary {
  border: 1px solid #ddd;
  background: #fff;
  padding: 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow: auto;
}

.hex-row {
  display: block; /* simple stacked rows */
  margin-bottom: 4px;
}

.hex-offset {
  color: #333;
  display: inline-block;
  width: 70px;
}

.hex-bytes {
  color: #003366;
  display: inline-block;
  width: 380px;
}

.hex-ascii {
  color: #333;
  display: inline-block;
}

/* ===== Simple responsive fallback (not "2004", but prevents breakage) ===== */
@media (max-width: 820px) {
  header, main, footer {
    width: auto;
    margin: 0 10px;
  }
  #left-panel {
    float: none;
    width: auto;
    margin-bottom: 12px;
  }
  #right-panel {
    margin-left: 0;
  }
  .tab-btn {
    width: 50%;
  }
}
