/* Tonico Collection Viewer Styles */

/* ── Light theme (default) ────────────────────────────── */
html {
  background: #ffffff;
  color: #111111;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

/* ── Site nav ─────────────────────────────────────────── */
.site-nav {
  position: fixed;
  left: 24px;
  top: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  text-decoration: none;
}
.nav-home:hover { color: #2a7ae2; }
.nav-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-dash {
  font-size: 12px;
  color: #777;
  text-decoration: none;
  padding-left: 31px;
}
.nav-dash:hover { color: #2a7ae2; }
.nav-lang {
  font-size: 12px;
  font-family: inherit;
  color: #777;
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
  margin-left: 31px;
}
.nav-lang:hover { color: #2a7ae2; border-color: #2a7ae2; }

.collection-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ── Header ───────────────────────────────────────────── */
.collection-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e6e6e6;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.collection-title {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.25;
}

.refresh-btn {
  font-size: 20px;
  padding: 4px 8px;
  border: 1px solid #cfcfcf;
  border-radius: 5px;
  background: #fff;
  color: #111;
  cursor: pointer;
  line-height: 1;
  font-family: inherit;
  transition: background 0.2s;
}
.refresh-btn:hover { background: #f5f5f5; }
.refresh-btn:active { background: #e0e0e0; }

.collection-desc {
  margin: 0 0 8px;
  font-size: 15px;
  color: #555;
}

.collection-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #777;
  margin-bottom: 10px;
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn {
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #f8f8f8;
  color: #333;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn:hover {
  border-color: #999;
}

/* ── Items list ───────────────────────────────────────── */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.12s;
  cursor: pointer;
}
.item-row:hover {
  background: rgba(0, 0, 0, 0.04);
}
.item-row.highlight {
  background: rgba(42, 122, 226, 0.08);
}

.item-num {
  flex: 0 0 32px;
  font-weight: 700;
  font-size: 14px;
  color: #999;
  text-align: center;
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-main {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-title {
  font-weight: 600;
}

.key-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(42, 122, 226, 0.1);
  color: #2a7ae2;
  vertical-align: 1px;
}

.private-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(180, 130, 50, 0.12);
  color: #b08030;
}
}

.item-sub {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-view {
  flex: 0 0 auto;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  transition: border-color 0.15s;
}
.item-view:hover {
  border-color: #999;
}
.item-view-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
  font-style: italic;
}

/* ── Notes section ────────────────────────────────────── */
.notes-section {
  margin-top: 24px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #e6e6e6;
  background: #fafafa;
}

.notes-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.notes-body {
  font-size: 14px;
  line-height: 1.55;
  color: #444;
}

/* ── Footer ───────────────────────────────────────────── */
.collection-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #e6e6e6;
  font-size: 12px;
  color: #999;
  text-align: center;
}
.collection-footer a {
  color: #2a7ae2;
  text-decoration: none;
}
.collection-footer a:hover {
  text-decoration: underline;
}

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 8px;
  background: #333;
  color: #fff;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.toast.show {
  opacity: 1;
}

/* ── Dark theme ───────────────────────────────────────── */
[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] {
  background: #13151f;
  color: #dddad2;
}

[data-theme="dark"] .nav-home {
  color: #dddad2;
}
[data-theme="dark"] .nav-home:hover,
[data-theme="dark"] .nav-dash:hover,
[data-theme="dark"] .nav-lang:hover {
  color: #6da8f2;
}
[data-theme="dark"] .nav-dash,
[data-theme="dark"] .nav-lang {
  color: #858890;
}
[data-theme="dark"] .nav-lang {
  border-color: #3a3d50;
}
[data-theme="dark"] .nav-lang:hover {
  border-color: #6da8f2;
}

[data-theme="dark"] .collection-header {
  border-bottom-color: #2e3040;
}

[data-theme="dark"] .collection-desc {
  color: #9a9890;
}

[data-theme="dark"] .collection-meta {
  color: #858890;
}

[data-theme="dark"] .btn {
  border-color: #2e3040;
  background: #1c1e2a;
  color: #dddad2;
}
[data-theme="dark"] .btn:hover {
  border-color: #858890;
}

[data-theme="dark"] .refresh-btn {
  border-color: #2e3040;
  background: #1c1e2a;
  color: #dddad2;
}
[data-theme="dark"] .refresh-btn:hover {
  background: #232535;
}
[data-theme="dark"] .refresh-btn:active {
  background: #2e3040;
}

[data-theme="dark"] .item-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .item-row.highlight {
  background: rgba(109, 168, 242, 0.1);
}

[data-theme="dark"] .item-num {
  color: #666;
}

[data-theme="dark"] .item-sub {
  color: #858890;
}

[data-theme="dark"] .key-badge {
  background: rgba(109, 168, 242, 0.15);
  color: #6da8f2;
}

[data-theme="dark"] .private-badge {
  background: rgba(210, 160, 60, 0.15);
  color: #d4a840;
}

[data-theme="dark"] .item-view {
  border-color: #2e3040;
  color: #dddad2;
}
[data-theme="dark"] .item-view:hover {
  border-color: #858890;
}
[data-theme="dark"] .item-view-disabled {
  opacity: 0.35;
}

[data-theme="dark"] .notes-section {
  border-color: #2e3040;
  background: #1c1e2a;
}

[data-theme="dark"] .notes-label {
  color: #858890;
}

[data-theme="dark"] .notes-body {
  color: #b0ada5;
}

[data-theme="dark"] .collection-footer {
  border-top-color: #2e3040;
  color: #666;
}
[data-theme="dark"] .collection-footer a {
  color: #6da8f2;
}

[data-theme="dark"] .toast {
  background: #dddad2;
  color: #13151f;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 960px) {
  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e6e6e6;
  }
  .nav-dash { padding-left: 0; }
  .nav-lang { margin-left: auto; }
}
[data-theme="dark"] .site-nav {
  border-bottom-color: #2e3040;
}

@media (max-width: 520px) {
  .collection-container {
    padding: 16px 10px 32px;
  }
  .collection-title {
    font-size: 20px;
  }
  .item-row {
    gap: 6px;
    padding: 8px 8px;
  }
  .item-num {
    flex: 0 0 26px;
    font-size: 13px;
  }
  .item-view {
    padding: 3px 8px;
    font-size: 11px;
  }
}
