/* MetaMouse — lofi.os page styles */
:root {
  --accent-ink: var(--accent);
}

[data-theme="white"] {
  --accent-ink: #000000;
}

.mm-main {
  position: relative;
  z-index: 5;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.mm-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.mm-hero h1 {
  font-family: "Syne", sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}

.mm-hero h1 span {
  color: var(--accent-ink);
}

.mm-hero p {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 420px;
}

.mm-hero-mascot img {
  height: 140px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.mm-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mm-tag {
  font-family: "VT323", monospace;
  font-size: 13px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent-ink);
  background: var(--bg3);
}

.mm-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--bg2);
  padding: 1.25rem 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.mm-drop-zone-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.mm-drop-zone-copy {
  flex: 1;
  min-width: 0;
}

.mm-drop-zone-copy .os-btn-primary {
  margin-top: 0.75rem;
  display: inline-block;
}

.mm-drop-zone:hover,
.mm-drop-zone.dragover {
  border-color: var(--accent);
  background: var(--bg3);
}

.mm-drop-zone-copy h2 {
  font-family: "VT323", monospace;
  font-size: 1.4rem;
  color: var(--accent-ink);
  margin: 0 0 0.35rem;
}

.mm-drop-zone-copy p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

.mm-drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.mm-drop-zone {
  cursor: pointer;
}

.mm-drop-zone .drop-icon,
.mm-drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mm-drop-zone .drop-icon img,
.mm-drop-icon img {
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}

#results {
  margin-top: 1.25rem;
}

.mm-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.mm-result-header img {
  height: 52px;
}

.mm-result-header h2 {
  font-family: "VT323", monospace;
  font-size: 1.35rem;
  color: var(--accent-ink);
  margin: 0;
}

.mm-result-header p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .files-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .files-grid {
    grid-template-columns: 1fr;
  }
}

.file-card {
  background: var(--win-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  animation: mmSlideIn 0.3s ease both;
}

@keyframes mmSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.file-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.file-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

.file-name {
  font-family: "VT323", monospace;
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.2;
}

.file-size {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: "VT323", monospace;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  max-width: 100%;
}

.status-badge img {
  height: 22px;
}

.status-badge.found {
  color: var(--accent-ink);
  border-color: var(--accent);
}

.status-badge.not-found {
  color: var(--text-muted);
}

.meta-body {
  padding: 12px;
  flex: 1;
  overflow: hidden;
}

.meta-section {
  margin-bottom: 12px;
}

.meta-section-title {
  font-family: "VT323", monospace;
  font-size: 14px;
  color: var(--accent-ink);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.meta-table tr {
  border-bottom: 1px solid var(--border);
}

.meta-table td:first-child {
  width: 38%;
  padding: 5px 8px 5px 0;
  color: var(--text-muted);
  vertical-align: top;
}

.meta-table td:last-child {
  padding: 5px 0;
  color: var(--text);
  word-break: break-word;
}

.prompt-box {
  background: var(--bg3);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}

.no-meta {
  text-align: center;
  padding: 1.5rem 0.5rem;
  color: var(--text-muted);
}

.no-meta img {
  height: 56px;
  margin-bottom: 8px;
}

.copy-btn,
.expand-btn,
.tab-btn {
  font-family: "VT323", monospace;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}

.copy-btn:hover,
.expand-btn:hover,
.tab-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.copy-btn.copied {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.clear-btn {
  margin-left: auto;
  font-family: "VT323", monospace;
  font-size: 14px;
  padding: 4px 12px;
}

.mm-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  display: none;
  position: fixed;
  z-index: 200;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--win-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 95vw;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-family: "VT323", monospace;
  color: var(--accent-ink);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--accent-ink);
}

.modal-body {
  padding: 12px;
  overflow: auto;
}

.modal-body img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.workflow-text,
.workflow-canvas-container {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 8px;
  max-height: 280px;
  overflow: auto;
  font-size: 10px;
}

.view-toggle {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.view-btn {
  font-family: "VT323", monospace;
  font-size: 12px;
  padding: 2px 8px;
}

.view-btn.active {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tab-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}
