/* ── Academy Community ── */
.ac-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
  animation: ac-fadeIn 0.3s ease;
}

@keyframes ac-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ac-loading { text-align: center; padding: 40px; color: #999; font-size: 16px; }
.ac-error { text-align: center; padding: 40px; color: #ef4444; }

/* ── Cards ── */
.ac-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.ac-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.ac-card-title i { margin-right: 6px; }

/* ── Progress Card ── */
.ac-progress-card {
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  border-color: #c7d2fe;
}

.ac-progress-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ac-level-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.ac-level-1 { background: #94a3b8; }
.ac-level-2 { background: #6366f1; }
.ac-level-3 { background: #0ea5e9; }
.ac-level-4 { background: #10b981; }
.ac-level-5 { background: #f59e0b; }
.ac-level-6 { background: #ef4444; }
.ac-level-7 { background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6); }

.ac-level-name { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.ac-points { font-size: 13px; color: #666; }
.ac-founding { font-size: 11px; background: #fef3c7; color: #92400e; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }

.ac-progress-bar-wrap { display: flex; align-items: center; gap: 10px; }
.ac-progress-bar { flex: 1; height: 8px; background: rgba(0,0,0,0.08); border-radius: 4px; overflow: hidden; }
.ac-progress-fill { height: 100%; background: #6366f1; border-radius: 4px; transition: width 0.5s; }
.ac-progress-text { font-size: 12px; color: #666; white-space: nowrap; }

/* ── Tool Unlock Roadmap ── */
.ac-unlocks { display: flex; flex-direction: column; gap: 6px; }

.ac-unlock {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.ac-unlock.unlocked { background: #ecfdf5; }
.ac-unlock.locked { opacity: 0.5; }
.ac-unlock.current { background: #eef2ff; border: 1px solid #c7d2fe; opacity: 1; }

.ac-unlock-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  flex-shrink: 0;
}

.ac-unlock.unlocked .ac-unlock-icon { background: #10b981; color: white; }
.ac-unlock.current .ac-unlock-icon { background: #6366f1; color: white; }

.ac-unlock-name { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.ac-unlock-desc { font-size: 11px; color: #888; }
.ac-unlock.locked .ac-unlock-name { color: #aaa; }

/* ── Filters ── */
.ac-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.ac-filter {
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  color: #666;
  transition: all 0.15s;
}

.ac-filter:hover { border-color: #6366f1; color: #6366f1; }
.ac-filter.active { background: #6366f1; color: white; border-color: #6366f1; }
.ac-filter i { margin-right: 4px; }

/* ── New Post ── */
.ac-new-post { display: flex; flex-direction: column; gap: 8px; }

.ac-textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.ac-textarea:focus { border-color: #6366f1; }

.ac-post-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.ac-select {
  padding: 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.ac-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ac-btn-primary { background: #6366f1; color: white; }
.ac-btn-primary:hover { background: #4f46e5; }
.ac-btn-secondary { background: #f0f0f0; color: #666; width: 100%; margin-top: 8px; }

/* ── Posts ── */
.ac-post {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s;
}

.ac-post:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }

.ac-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ac-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.ac-post-meta { flex: 1; }
.ac-post-author { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.ac-post-time { font-size: 12px; color: #999; margin-left: 6px; }
.ac-pinned { font-size: 11px; color: #6366f1; margin-left: 6px; }
.ac-post-cat { font-size: 11px; font-weight: 500; white-space: nowrap; }
.ac-post-cat i { margin-right: 3px; }

.ac-post-title { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; }
.ac-post-body { font-size: 14px; color: #333; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.ac-post-image { max-width: 100%; border-radius: 8px; margin-top: 10px; }

.ac-post-footer {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.ac-action {
  background: none;
  border: none;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.ac-action:hover { background: #f5f5f5; color: #6366f1; }
.ac-action.liked { color: #ef4444; }
.ac-action.liked i { color: #ef4444; }

.ac-action-sm { background: none; border: none; font-size: 12px; color: #bbb; cursor: pointer; padding: 2px 6px; }
.ac-action-sm.liked { color: #ef4444; }

/* ── Comments ── */
.ac-back { color: #6366f1; cursor: pointer; font-size: 14px; margin-bottom: 12px; font-weight: 500; }
.ac-back:hover { text-decoration: underline; }

.ac-comments-section { margin-top: 12px; }
.ac-comments-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #1a1a1a; }

.ac-comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.ac-comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.ac-comment-content { flex: 1; }
.ac-comment-author { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.ac-comment-time { font-weight: 400; color: #999; font-size: 12px; }
.ac-comment-body { font-size: 13px; color: #333; line-height: 1.5; margin-top: 2px; }

.ac-add-comment { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ac-add-comment .ac-btn { align-self: flex-end; }

/* ── Leaderboard ── */
.ac-lb-tabs { display: flex; gap: 4px; margin-bottom: 12px; }

.ac-lb-tab {
  padding: 4px 12px;
  border: none;
  background: #f0f0f0;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #666;
}

.ac-lb-tab.active { background: #6366f1; color: white; }

.ac-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}

.ac-lb-top { font-weight: 600; }
.ac-lb-rank { width: 30px; text-align: center; font-size: 14px; }
.ac-lb-name { flex: 1; font-size: 14px; color: #1a1a1a; }
.ac-lb-level .ac-level-badge { width: 28px; height: 28px; font-size: 10px; }
.ac-lb-points { font-size: 13px; color: #666; font-weight: 500; }

/* ── Empty states ── */
.ac-empty { text-align: center; padding: 40px 20px; }
.ac-empty-icon { font-size: 32px; margin-bottom: 8px; }
.ac-empty-text { font-size: 14px; color: #999; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ac-wrap { padding: 8px; }
  .ac-filters { gap: 4px; }
  .ac-filter { padding: 5px 8px; font-size: 11px; }
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
  .ac-card { background: #1e1e1e; border-color: #333; }
  .ac-post { background: #1e1e1e; border-color: #333; }
  .ac-progress-card { background: linear-gradient(135deg, #1e1e2e, #1e1e3e); border-color: #333; }
  .ac-post-title, .ac-post-author, .ac-card-title, .ac-level-name, .ac-comment-author { color: #e0e0e0; }
  .ac-post-body, .ac-comment-body { color: #ccc; }
  .ac-textarea { background: #252525; border-color: #444; color: #e0e0e0; }
  .ac-filter { background: #252525; border-color: #444; color: #bbb; }
  .ac-filter.active { background: #6366f1; color: white; }
  .ac-select { background: #252525; border-color: #444; color: #ccc; }
  .ac-unlock-name { color: #e0e0e0; }
}
