/*
 * Depends on:
 * - index.html inline app shell tokens: --bg-page, --bg-white, --border-light, --text-*, --accent, --radius
 * - Content ideas DOM ids/classes rendered by index.html: #tab-ideas, .idea-*, .ideas-*
 */

#tab-ideas .ideas-workspace,
#tab-bookmarks .bookmarks-workspace {
  padding: 0;
  overflow: hidden;
  border-color: rgba(24, 24, 27, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), #fff 42%),
    radial-gradient(circle at 0 0, rgba(255, 0, 0, 0.07), transparent 32%);
}

.ideas-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-light);
  background:
    linear-gradient(135deg, rgba(255, 0, 0, 0.045), rgba(255, 255, 255, 0) 46%),
    #fff;
}

.bookmarks-hero {
  align-items: center;
}

.ideas-hero h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(0.86rem, 1.05vw, 1rem);
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ideas-hero p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.ideas-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.bookmark-filter {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #f5f6f8;
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.04);
}

.bookmark-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.bookmark-filter-btn:hover {
  color: var(--text-primary);
}

.bookmark-filter-btn.active {
  border-color: rgba(255, 0, 0, 0.14);
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.ideas-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 0, 0, 0.18);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.ideas-action-primary {
  background: linear-gradient(135deg, #ff0000, #d91414);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 0, 0, 0.18);
}

.ideas-action-short {
  background: rgba(255, 0, 0, 0.045);
  color: var(--accent);
}

.ideas-action-btn:hover {
  transform: translateY(-1px);
}

.ideas-action-primary:hover {
  box-shadow: 0 14px 28px rgba(255, 0, 0, 0.24);
}

.ideas-action-short:hover {
  background: rgba(255, 0, 0, 0.08);
  border-color: rgba(255, 0, 0, 0.28);
}

.ideas-progress,
.ideas-research-grid,
.ideas-result-section {
  margin: 18px 24px 0;
}

.ideas-progress {
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
}

.ideas-progress .progress-text {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 750;
}

.ideas-status-stack {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.ideas-status-stack .status-msg {
  margin: 0;
  border: 1px solid var(--border-light);
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.45;
}

.ideas-research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ideas-research-panel {
  min-width: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
}

.ideas-research-panel details {
  padding: 14px 16px;
}

.ideas-research-panel summary {
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.35;
}

.ideas-keyword-list,
.ideas-youtube-data {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.65;
}

.ideas-youtube-data {
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.ideas-result-section {
  margin-bottom: 24px;
}

.bookmarks-result-section {
  margin-top: 18px;
}

.ideas-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ideas-section-title {
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.25;
}

.ideas-section-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.ideas-list,
#bookmarkList {
  display: grid;
  gap: 12px;
}

.idea-strategy-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  background: rgba(248, 249, 250, 0.7);
}

.idea-strategy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.idea-strategy-head > div {
  display: grid;
  gap: 3px;
}

.idea-strategy-head strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 900;
}

.idea-strategy-head span {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.idea-strategy-head em {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

.idea-strategy-list {
  display: grid;
  gap: 10px;
}

.tag-strategy-safe {
  border: 1px solid var(--green-border);
  background: var(--green-subtle);
  color: var(--green);
}

.tag-strategy-expansion {
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
}

.tag-strategy-experimental {
  border: 1px solid var(--purple-border);
  background: var(--purple-subtle);
  color: var(--purple);
}

.tag-similar {
  border: 1px solid var(--yellow-border);
  background: var(--yellow-subtle);
  color: var(--yellow);
}

.idea-similarity-card {
  border-color: var(--yellow-border);
  background: var(--yellow-subtle);
}

.bookmark-list .idea-card {
  border-color: rgba(17, 24, 39, 0.075);
}

.bookmark-list .idea-card:hover {
  border-color: rgba(255, 0, 0, 0.16);
}

.idea-empty-state {
  display: flex;
  min-height: 124px;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(17, 24, 39, 0.16);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.035);
}

.idea-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.idea-card:hover {
  border-color: rgba(255, 0, 0, 0.18);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.06);
  transform: translateY(-1px);
}

.idea-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px 9px;
}

.idea-card-main {
  min-width: 0;
}

.idea-card-no-rank .idea-card-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.idea-card-no-rank .idea-rank-note,
.idea-card-no-rank .idea-ref {
  margin-left: 16px;
}

.idea-card-no-rank .idea-signal-grid,
.idea-card-no-rank .idea-actions {
  padding-left: 16px;
}

.idea-rank-medal {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 0, 0, 0.17);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(255, 0, 0, 0.06);
}

.idea-score {
  display: grid;
  min-width: 64px;
  gap: 2px;
  justify-items: end;
  padding-top: 1px;
}

.idea-score span {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.idea-score strong {
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1;
}

.idea-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.idea-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
}

.idea-rank-note {
  margin: 0 16px 9px 68px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 0, 0, 0.09);
  border-radius: var(--radius-sm);
  background: rgba(255, 0, 0, 0.035);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.4;
}

.idea-rank-reason {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.idea-title {
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  font-weight: 850;
  line-height: 1.38;
}

.idea-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.idea-signal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 0 16px 10px 68px;
}

.idea-signal-grid:empty {
  display: none;
}

.idea-signal-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  background: rgba(248, 249, 250, 0.72);
}

.idea-signal-wide {
  grid-column: 1 / -1;
}

.idea-signal-card span {
  display: block;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.idea-signal-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.4;
}

.idea-ref {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: 0 16px 10px 68px;
  padding: 8px 9px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  background: #f8f9fa;
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.4;
}

.idea-ref span {
  display: block;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.idea-ref strong {
  display: block;
  overflow: hidden;
  min-width: 0;
  color: var(--text-secondary);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 14px 68px;
}

.idea-action-meta {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.4;
}

.idea-actions .btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
}

.bookmark-remove-btn {
  border-color: rgba(255, 0, 0, 0.16);
  background: rgba(255, 0, 0, 0.045);
  color: var(--accent);
}

.bookmark-remove-btn:hover {
  border-color: rgba(255, 0, 0, 0.26);
  background: rgba(255, 0, 0, 0.075);
}

@media (max-width: 900px) {
  .ideas-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .ideas-hero-actions {
    justify-content: flex-start;
  }

  .ideas-research-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #tab-ideas .ideas-workspace {
    border-radius: 0;
  }

  .ideas-hero,
  .ideas-progress,
  .ideas-research-grid,
  .ideas-result-section {
    margin-left: 18px;
    margin-right: 18px;
  }

  .ideas-hero {
    margin: 0;
    padding: 18px;
  }

  .bookmark-filter {
    width: 100%;
  }

  .bookmark-filter-btn {
    flex: 1;
    min-width: 0;
  }

  .ideas-action-btn {
    flex: 1;
  }

  .idea-card-head {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .idea-score {
    grid-column: 2;
    justify-items: start;
  }

  .idea-rank-note,
  .idea-signal-grid,
  .idea-ref,
  .idea-actions {
    margin-left: 0;
    padding-left: 16px;
  }

  .idea-signal-card,
  .idea-ref {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .idea-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
