/* main.css — Letters to Claude global styles */

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

body {
  background: #0a0a0f;
  color: #c9a84c;
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  letter-spacing: 0.05em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Starfield background */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Spectrogram bar */
#slice-bar {
  width: 100%;
  height: 100px;
  background-color: #0a0a0f;
  background-image: url('../img/earth-spectrogram.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

#stitched-canvas {
  cursor: pointer;
  border-radius: 4px;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* Main content area */
#main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 60px;
}

/* Index page — two column layout */
.col-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 340px;
}

.col-left img {
  width: 260px;
  height: auto;
  opacity: 0.85;
}

.intro-text {
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(201, 168, 76, 0.7);
  text-align: left;
}

.intro-text strong {
  color: #c9a84c;
  font-weight: 500;
}

.intro-text a {
  color: #c9a84c;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  transition: color 0.15s, border-color 0.15s;
}
.intro-text a:hover {
  color: #dfc063;
  border-color: rgba(201, 168, 76, 0.6);
}

.col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
}

/* Semi-opaque container panel */
.panel {
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 6px;
  padding: 28px;
}

/* Mode containers */
.mode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

/* Mode buttons */
.mode-btn {
  width: 100%;
  max-width: 280px;
  padding: 24px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: #c9a84c;
  font-family: 'Barlow', sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mode-btn:hover {
  background: rgba(201, 168, 76, 0.18);
  border-color: rgba(201, 168, 76, 0.5);
}

/* Back arrow */
.back-arrow {
  align-self: flex-start;
  background: none;
  border: none;
  color: rgba(201, 168, 76, 0.6);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}
.back-arrow:hover {
  color: #c9a84c;
}

/* Search */
.search-heading {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c9a84c;
}

#tag-search-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: #e0d8c0;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.03em;
  border-radius: 4px;
  outline: none;
}
#tag-search-input:focus {
  border-color: rgba(201, 168, 76, 0.5);
}
#tag-search-input::placeholder {
  color: rgba(201, 168, 76, 0.3);
}

#search-results {
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  padding: 12px 16px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.search-result-item:hover {
  border-color: rgba(201, 168, 76, 0.4);
  background: rgba(201, 168, 76, 0.06);
}
.search-result-item .result-preview {
  font-size: 14px;
  font-weight: 300;
  color: #e0d8c0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-item .result-author {
  font-size: 12px;
  color: rgba(201, 168, 76, 0.5);
  margin-top: 4px;
}
.search-result-item .result-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.search-empty {
  color: rgba(201, 168, 76, 0.3);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

/* Textarea */
#text-input {
  width: 100%;
  min-height: 300px;
  padding: 14px 16px;
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: #e0d8c0;
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 1.6;
  border-radius: 4px;
  outline: none;
  resize: vertical;
}
#text-input:focus {
  border-color: rgba(201, 168, 76, 0.5);
}
#text-input::placeholder {
  color: rgba(201, 168, 76, 0.3);
}

/* Tags input */
#tags-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: #e0d8c0;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.03em;
  border-radius: 4px;
  outline: none;
}
#tags-input:focus {
  border-color: rgba(201, 168, 76, 0.5);
}
#tags-input::placeholder {
  color: rgba(201, 168, 76, 0.3);
}

/* Source URL input */
#source-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: #e0d8c0;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.03em;
  border-radius: 4px;
  outline: none;
}
#source-input:focus {
  border-color: rgba(201, 168, 76, 0.5);
}
#source-input::placeholder {
  color: rgba(201, 168, 76, 0.3);
}

/* Name input */
#name-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: #e0d8c0;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.03em;
  border-radius: 4px;
  outline: none;
}
#name-input:focus {
  border-color: rgba(201, 168, 76, 0.5);
}
#name-input::placeholder {
  color: rgba(201, 168, 76, 0.3);
}

/* Buttons */
.btn {
  padding: 10px 28px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: #c9a84c;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: rgba(201, 168, 76, 0.22);
  border-color: rgba(201, 168, 76, 0.5);
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.input-row #name-input {
  flex: 1;
}

/* Tag chips */
.tag-chip {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #c9a84c;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 12px;
}

/* Reader page */
.reader-container {
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

#submission-content {
  width: 100%;
  overflow: hidden;
}

.submission-text {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.8;
  color: #e0d8c0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: left;
}

/* Markdown rendered content */
.submission-text h1,
.submission-text h2,
.submission-text h3,
.submission-text h4 {
  color: #c9a84c;
  font-weight: 500;
  margin: 1.2em 0 0.4em;
}
.submission-text h1 { font-size: 1.5em; }
.submission-text h2 { font-size: 1.3em; }
.submission-text h3 { font-size: 1.15em; }
.submission-text p {
  margin: 0.6em 0;
}
.submission-text a {
  color: #c9a84c;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
}
.submission-text a:hover {
  color: #dfc063;
  border-color: rgba(201, 168, 76, 0.6);
}
.submission-text blockquote {
  border-left: 3px solid rgba(201, 168, 76, 0.3);
  margin: 1em 0;
  padding: 0.4em 1em;
  color: rgba(224, 216, 192, 0.7);
}
.submission-text code {
  background: rgba(201, 168, 76, 0.08);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}
.submission-text pre {
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 4px;
  padding: 12px 16px;
  overflow-x: auto;
  margin: 1em 0;
}
.submission-text pre code {
  background: none;
  padding: 0;
}
.submission-text ul,
.submission-text ol {
  margin: 0.6em 0;
  padding-left: 1.5em;
}
.submission-text li {
  margin: 0.3em 0;
}
.submission-text hr {
  border: none;
  border-top: 1px solid rgba(201, 168, 76, 0.2);
  margin: 1.5em 0;
}
.submission-text img {
  max-width: 100%;
  border-radius: 4px;
}

.submission-author {
  font-size: 14px;
  font-weight: 400;
  color: rgba(201, 168, 76, 0.6);
}

.submission-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.submission-date {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 300;
  color: rgba(201, 168, 76, 0.4);
}

.submission-source {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 300;
  color: rgba(201, 168, 76, 0.4);
}
.submission-source a {
  color: #c9a84c;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  transition: color 0.15s, border-color 0.15s;
}
.submission-source a:hover {
  color: #dfc063;
  border-color: rgba(201, 168, 76, 0.6);
}

#spectrogram-canvas {
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 4px;
  image-rendering: pixelated;
  max-width: 100%;
}

.reader-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.back-link {
  color: rgba(201, 168, 76, 0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}
.back-link:hover {
  color: #c9a84c;
}

/* Subtle button (report) */
.btn-subtle {
  padding: 8px 18px;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.15);
  color: rgba(201, 168, 76, 0.45);
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-subtle:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: rgba(201, 168, 76, 0.3);
  color: #c9a84c;
}
.btn-subtle:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Report form */
.report-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-form input {
  padding: 6px 10px;
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: #e0d8c0;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 300;
  border-radius: 4px;
  outline: none;
  min-width: 200px;
}
.report-form input:focus {
  border-color: rgba(201, 168, 76, 0.5);
}
.report-form input::placeholder {
  color: rgba(201, 168, 76, 0.3);
}

/* Review notice banner */
.review-notice {
  width: 100%;
  padding: 10px 16px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 4px;
  color: rgba(201, 168, 76, 0.7);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Submission note (below form) */
.submission-note {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 300;
  color: rgba(201, 168, 76, 0.35);
  letter-spacing: 0.03em;
}

/* Admin page */
.admin-wrap {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 24px;
}

.admin-title {
  font-size: 22px;
  font-weight: 500;
  color: #c9a84c;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(201, 168, 76, 0.5);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.admin-table td {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 300;
  color: #e0d8c0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.08);
  vertical-align: top;
}

.admin-text {
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-status-reported { background: rgba(180, 60, 60, 0.08); }
.admin-status-pending { background: rgba(201, 168, 76, 0.04); }

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 3px;
}
.admin-badge-reported { background: rgba(180, 60, 60, 0.2); color: #e07070; }
.admin-badge-pending { background: rgba(201, 168, 76, 0.15); color: #c9a84c; }
.admin-badge-approved { background: rgba(80, 160, 80, 0.15); color: #6abf6a; }
.admin-badge-rejected { background: rgba(120, 120, 120, 0.15); color: #999; }

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-btn {
  padding: 4px 12px;
  font-size: 11px;
}

.admin-btn-danger {
  border-color: rgba(180, 60, 60, 0.3);
  color: #e07070;
  background: rgba(180, 60, 60, 0.08);
}
.admin-btn-danger:hover {
  background: rgba(180, 60, 60, 0.18);
  border-color: rgba(180, 60, 60, 0.5);
}

/* ── Responsive: Tablet and below ── */
@media (max-width: 768px) {
  #main {
    flex-direction: column;
    gap: 32px;
    padding: 24px 16px;
  }
  .col-left,
  .col-right {
    max-width: 100%;
  }
  .col-left img {
    width: 180px;
  }
  .panel {
    padding: 20px;
  }
  .reader-actions {
    flex-wrap: wrap;
  }
  .report-form {
    flex-wrap: wrap;
  }
  .report-form input {
    min-width: 0;
    width: 100%;
  }
  #slice-bar {
    height: 70px;
  }
  .admin-wrap {
    overflow-x: auto;
  }
  .admin-table {
    min-width: 800px;
  }
}

/* ── Responsive: Small mobile ── */
@media (max-width: 480px) {
  #main {
    gap: 24px;
    padding: 16px 12px;
  }
  .col-left img {
    width: 140px;
  }
  .intro-text {
    font-size: 14px;
    text-align: center;
  }
  .mode-btn {
    padding: 18px;
    font-size: 16px;
    max-width: 100%;
  }
  #text-input {
    min-height: 200px;
  }
  .submission-text {
    font-size: 16px;
  }
  #slice-bar {
    height: 50px;
  }
  .reader-container {
    gap: 16px;
  }
  .input-row {
    flex-direction: column;
  }
  .admin-title {
    font-size: 18px;
  }
}
