/* tags.css — タグランキングページ専用スタイル */

.logo-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}

/* ===== TAGS MAIN ===== */
.tags-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* ===== CONTROLS ===== */
.tags-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.view-btn {
  width: 34px; height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.view-btn:hover { border-color: var(--accent); color: var(--accent); }
.view-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===== LOADING / ERROR ===== */
.tags-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; padding: 6rem 2rem;
  color: var(--text-muted); font-size: 14px;
}
.tags-error {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 4rem 2rem; text-align: center;
  color: var(--accent); font-size: 14px;
}
.error-emoji { font-size: 36px; }
.hidden { display: none !important; }

/* ===== GRID VIEW ===== */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.tag-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column; gap: 10px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.3s ease both;
}

.tag-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.tag-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-med);
  transform: translateY(-2px);
}
.tag-card:hover::before { opacity: 1; }

.tag-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}

.tag-rank {
  font-family: var(--font-display);
  font-weight: 800; font-size: 11px;
  min-width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tag-rank.rank-1 { background: var(--rank-1); color: #fff; }
.tag-rank.rank-2 { background: var(--rank-2); color: #fff; }
.tag-rank.rank-3 { background: var(--rank-3); color: #fff; }
.tag-rank.rank-other { background: var(--badge-bg); color: var(--badge-text); }

.tag-icon-img {
  width: 32px; height: 32px;
  border-radius: 6px; object-fit: cover;
  background: var(--bg-muted);
}

.tag-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 16px;
  color: var(--text-primary);
  word-break: break-all;
}

.tag-bar-wrap {
  background: var(--bg-muted);
  border-radius: 100px;
  height: 5px;
  overflow: hidden;
}

.tag-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.6s ease;
}

.tag-stats {
  display: flex; justify-content: space-between;
}

.tag-stat {
  display: flex; flex-direction: column; gap: 2px;
}

.tag-stat-num {
  font-family: var(--font-display);
  font-weight: 700; font-size: 14px;
  color: var(--text-primary);
}

.tag-stat-label {
  font-size: 10px; color: var(--text-muted);
}

/* ===== LIST VIEW ===== */
.tags-list {
  display: flex; flex-direction: column; gap: 6px;
}

.tag-list-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: grid;
  grid-template-columns: 40px 1fr 120px 120px 160px;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  animation: fadeUp 0.2s ease both;
}

.tag-list-item:hover {
  border-color: var(--border-med);
  box-shadow: var(--shadow);
  transform: translateX(3px);
}

.list-rank {
  font-family: var(--font-display);
  font-weight: 800; font-size: 14px;
  text-align: center;
  color: var(--text-muted);
}
.list-rank.rank-1 { color: var(--rank-1); }
.list-rank.rank-2 { color: var(--rank-2); }
.list-rank.rank-3 { color: var(--rank-3); }

.list-tag-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

.list-icon {
  width: 22px; height: 22px;
  border-radius: 4px; object-fit: cover;
  background: var(--bg-muted); flex-shrink: 0;
}

.list-bar-wrap {
  background: var(--bg-muted);
  border-radius: 100px; height: 6px; overflow: hidden;
}

.list-bar {
  height: 100%; background: var(--accent);
  border-radius: 100px; transition: width 0.6s ease;
}

.list-items {
  font-family: var(--font-display);
  font-weight: 700; font-size: 14px;
  color: var(--text-primary); text-align: right;
}
.list-items span { font-size: 10px; font-weight: 400; color: var(--text-muted); margin-left: 3px; }

.list-followers {
  font-size: 13px; color: var(--text-secondary); text-align: right;
}
.list-followers span { font-size: 10px; color: var(--text-muted); margin-left: 3px; }

/* ===== LIST HEADER ===== */
.tags-list-header {
  display: grid;
  grid-template-columns: 40px 1fr 120px 120px 160px;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ===== LOAD MORE ===== */
.load-more-wrap { text-align: center; margin-top: 2rem; }

.load-more-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-md);
  padding: 10px 32px;
  font-size: 13px; font-family: var(--font-body);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  margin-top: 5rem;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 2rem; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo-mark {
  width: 40px; height: 40px; background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); flex-shrink: 0;
}
.footer-logo-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--text-primary); }
.footer-logo-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.footer-links { display: flex; gap: 3rem; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-title { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.footer-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; transition: color var(--transition); }
.footer-link:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.25rem 2rem; text-align: center; font-size: 11px; color: var(--text-muted); }
.footer-bottom a { color: var(--accent); text-decoration: none; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .tags-main { padding: 0 1rem; }
  .tags-grid { grid-template-columns: repeat(2, 1fr); }
  .tag-list-item {
    grid-template-columns: 32px 1fr 80px;
    grid-template-rows: auto auto;
  }
  .list-bar-wrap, .list-followers { display: none; }
}
